Fix bots not being removed properly
This commit is contained in:
@@ -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"
|
||||
plugin.getManager().remove(this);
|
||||
|
||||
scheduler.runTaskLater(plugin, this::setDead, 30);
|
||||
scheduler.runTaskLater(plugin, this::removeBot, 30);
|
||||
|
||||
this.removeTab();
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class BotManagerImpl implements BotManager, Listener {
|
||||
@Override
|
||||
public void reset() {
|
||||
if (!bots.isEmpty()) {
|
||||
bots.forEach(Terminator::removeVisually);
|
||||
bots.forEach(Terminator::removeBot);
|
||||
bots.clear(); // Not always necessary, but a good security measure
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user