lizardmenshaman: Merge nested if statements

This commit is contained in:
sdburns1998
2019-07-07 15:23:54 +02:00
parent 60bb8b7001
commit a5acf9b5c9
2 changed files with 6 additions and 15 deletions

View File

@@ -102,14 +102,11 @@ public class LizardmenShamanPlugin extends Plugin
@Subscribe
public void onChatMessage(ChatMessage event)
{
if (this.notifyOnSpawn)
{
if (event.getMessage().contains(MESSAGE))
if (this.notifyOnSpawn && event.getMessage().contains(MESSAGE))
{
notifier.notify(MESSAGE);
}
}
}
@Subscribe
public void onAnimationChanged(AnimationChanged event)
@@ -120,14 +117,11 @@ public class LizardmenShamanPlugin extends Plugin
return;
}
if (actor.getName().equals(SHAMAN) && actor.getAnimation() == 7157)
{
if (this.showTimer)
if (actor.getName().equals(SHAMAN) && actor.getAnimation() == 7157 && this.showTimer)
{
spawns.put(event.getActor().getLocalLocation(), new LizardmenShamanSpawn(8.4, null));
}
}
}
@Subscribe
public void onConfigChanged(ConfigChanged event)

View File

@@ -63,13 +63,10 @@ class ShamanSpawnOverlay extends Overlay
final long startCountdown = Duration.between(spawn.getStart(), now).getSeconds();
final double certainSec = spawn.getCountdownTimer() - startCountdown;
if (certainSec <= 0)
{
if (spawn.getEnd() == null)
if (certainSec <= 0 && spawn.getEnd() == null)
{
spawn.setEnd(Instant.now());
}
}
final ProgressPieComponent pieComponent = new ProgressPieComponent();
final Point loc = Perspective.localToCanvas(client, localPoint, client.getPlane());