Fix "Removing entity while ticking!" bug

This commit is contained in:
Daniel Saukel 2020-05-02 00:57:27 +02:00
parent 2b1c09d0d7
commit ce7790f341

View File

@ -55,6 +55,7 @@ import org.bukkit.entity.Wolf;
import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import org.bukkit.scheduler.BukkitRunnable;
/** /**
* @author Frank Baumann, Tobias Schmitz, Milan Albrecht, Daniel Saukel * @author Frank Baumann, Tobias Schmitz, Milan Albrecht, Daniel Saukel
@ -692,8 +693,13 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
} }
if ((dGroup.getLives() == 0 || lives == 0) && ready) { if ((dGroup.getLives() == 0 || lives == 0) && ready) {
new BukkitRunnable() {
@Override
public void run() {
kill(); kill();
} }
}.runTaskLater(plugin, 1L);
}
if (rules.getState(GameRule.GAME_GOAL) == GameGoal.LAST_MAN_STANDING) { if (rules.getState(GameRule.GAME_GOAL) == GameGoal.LAST_MAN_STANDING) {
if (game.getGroups().size() == 1) { if (game.getGroups().size() == 1) {