Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
73bdfe28f1
Commit
7ab25a6ddb
@ -112,13 +112,20 @@ public class TNTSimulator {
|
||||
public void remove(SimulatorElement element) {
|
||||
if (element instanceof TNTElement) {
|
||||
TNTElement tntElement = (TNTElement) element;
|
||||
element.remove(tntElement);
|
||||
if (tntElement.hasParent()) {
|
||||
tntElement.getParent().remove(tntElement);
|
||||
if (tntElement.getParent().getElements().isEmpty()) {
|
||||
remove(tntElement.getParent());
|
||||
}
|
||||
} else {
|
||||
element.remove(tntElement);
|
||||
}
|
||||
} else if (element instanceof TNTGroup) {
|
||||
TNTGroup tntGroup = (TNTGroup) element;
|
||||
tntGroup.getElements().forEach(tntElement -> {
|
||||
tntElement.remove(tntElement);
|
||||
});
|
||||
tntGroup.getElements().clear();
|
||||
}
|
||||
element.close();
|
||||
tntElementList.remove(element);
|
||||
|
@ -32,7 +32,6 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.util.RayTraceResult;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@ -89,9 +88,6 @@ public class TNTSimulatorListener implements Listener {
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
SimulatorCursor.hide(event.getPlayer(), null);
|
||||
SimulatorStorage.getSimulatorNames().forEach(s -> {
|
||||
SimulatorStorage.getSimulator(s).hide(event.getPlayer());
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren