From 5d766d6a171af778f6365ce03dda6ac8b48ea1e7 Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Wed, 19 Oct 2022 15:35:03 -0400 Subject: [PATCH] Fix regen after death on block damages --- .../src/main/java/net/nuggetmc/tplus/bot/Bot.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/Bot.java b/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/Bot.java index 85aa40f..68b0b02 100644 --- a/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/Bot.java +++ b/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/Bot.java @@ -293,6 +293,8 @@ public class Bot extends ServerPlayer implements Terminator { } updateLocation(); + + if (!isAlive()) return; float health = getHealth(); float maxHealth = getMaxHealth(); @@ -704,7 +706,7 @@ public class Bot extends ServerPlayer implements Terminator { // this should fix the concurrentmodificationexception mentioned above, I used the ConcurrentHashMap.newKeySet to make a "ConcurrentHashSet" plugin.getManager().remove(this); - scheduler.runTaskLater(plugin, this::removeBot, 30); + scheduler.runTaskLater(plugin, this::removeBot, 20); this.removeTab(); }