From ce7790f34139d919ccd3285f3750e7f31a3ec51b Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Sat, 2 May 2020 00:57:27 +0200 Subject: [PATCH] Fix "Removing entity while ticking!" bug --- .../java/de/erethon/dungeonsxl/player/DGamePlayer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java b/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java index 96f0f5ea..5352b894 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java +++ b/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java @@ -55,6 +55,7 @@ import org.bukkit.entity.Wolf; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; +import org.bukkit.scheduler.BukkitRunnable; /** * @author Frank Baumann, Tobias Schmitz, Milan Albrecht, Daniel Saukel @@ -692,7 +693,12 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer { } if ((dGroup.getLives() == 0 || lives == 0) && ready) { - kill(); + new BukkitRunnable() { + @Override + public void run() { + kill(); + } + }.runTaskLater(plugin, 1L); } if (rules.getState(GameRule.GAME_GOAL) == GameGoal.LAST_MAN_STANDING) {