Stop aggroarea from creating a timer if the duration is negative

This commit is contained in:
Lucas
2019-05-01 21:23:39 +02:00
parent c48c85a11e
commit 0305898935

View File

@@ -404,7 +404,7 @@ public class NpcAggroAreaPlugin extends Plugin
lastPlayerLocation = configManager.getConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_LOCATION, WorldPoint.class); lastPlayerLocation = configManager.getConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_LOCATION, WorldPoint.class);
Duration timeLeft = configManager.getConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_DURATION, Duration.class); Duration timeLeft = configManager.getConfiguration(NpcAggroAreaConfig.CONFIG_GROUP, NpcAggroAreaConfig.CONFIG_DURATION, Duration.class);
if (timeLeft != null) if (timeLeft != null && !timeLeft.isNegative())
{ {
createTimer(timeLeft); createTimer(timeLeft);
} }