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,12 +102,9 @@ public class LizardmenShamanPlugin extends Plugin
@Subscribe
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);
}
}
@@ -120,12 +117,9 @@ public class LizardmenShamanPlugin extends Plugin
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));
}
}

View File

@@ -63,12 +63,9 @@ class ShamanSpawnOverlay extends Overlay
final long startCountdown = Duration.between(spawn.getStart(), now).getSeconds();
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();