Fix bots not being removed properly

This commit is contained in:
ThisTestUser
2022-09-25 17:59:46 -04:00
parent a44913aed6
commit 4e4cab3ecc
2 changed files with 2 additions and 2 deletions

View File

@@ -609,7 +609,7 @@ public class Bot extends ServerPlayer implements Terminator {
// this should fix the concurrentmodificationexception mentioned above, I used the ConcurrentHashMap.newKeySet to make a "ConcurrentHashSet" // this should fix the concurrentmodificationexception mentioned above, I used the ConcurrentHashMap.newKeySet to make a "ConcurrentHashSet"
plugin.getManager().remove(this); plugin.getManager().remove(this);
scheduler.runTaskLater(plugin, this::setDead, 30); scheduler.runTaskLater(plugin, this::removeBot, 30);
this.removeTab(); this.removeTab();
} }

View File

@@ -164,7 +164,7 @@ public class BotManagerImpl implements BotManager, Listener {
@Override @Override
public void reset() { public void reset() {
if (!bots.isEmpty()) { if (!bots.isEmpty()) {
bots.forEach(Terminator::removeVisually); bots.forEach(Terminator::removeBot);
bots.clear(); // Not always necessary, but a good security measure bots.clear(); // Not always necessary, but a good security measure
} }