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 @Subscribe
public void onChatMessage(ChatMessage event) public void onChatMessage(ChatMessage event)
{ {
if (this.notifyOnSpawn) if (this.notifyOnSpawn && event.getMessage().contains(MESSAGE))
{
if (event.getMessage().contains(MESSAGE))
{ {
notifier.notify(MESSAGE); notifier.notify(MESSAGE);
} }
} }
}
@Subscribe @Subscribe
public void onAnimationChanged(AnimationChanged event) public void onAnimationChanged(AnimationChanged event)
@@ -120,14 +117,11 @@ public class LizardmenShamanPlugin extends Plugin
return; return;
} }
if (actor.getName().equals(SHAMAN) && actor.getAnimation() == 7157) if (actor.getName().equals(SHAMAN) && actor.getAnimation() == 7157 && this.showTimer)
{
if (this.showTimer)
{ {
spawns.put(event.getActor().getLocalLocation(), new LizardmenShamanSpawn(8.4, null)); spawns.put(event.getActor().getLocalLocation(), new LizardmenShamanSpawn(8.4, null));
} }
} }
}
@Subscribe @Subscribe
public void onConfigChanged(ConfigChanged event) 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 long startCountdown = Duration.between(spawn.getStart(), now).getSeconds();
final double certainSec = spawn.getCountdownTimer() - startCountdown; final double certainSec = spawn.getCountdownTimer() - startCountdown;
if (certainSec <= 0) if (certainSec <= 0 && spawn.getEnd() == null)
{
if (spawn.getEnd() == null)
{ {
spawn.setEnd(Instant.now()); spawn.setEnd(Instant.now());
} }
}
final ProgressPieComponent pieComponent = new ProgressPieComponent(); final ProgressPieComponent pieComponent = new ProgressPieComponent();
final Point loc = Perspective.localToCanvas(client, localPoint, client.getPlane()); final Point loc = Perspective.localToCanvas(client, localPoint, client.getPlane());