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) {
|
public void remove(SimulatorElement element) {
|
||||||
if (element instanceof TNTElement) {
|
if (element instanceof TNTElement) {
|
||||||
TNTElement tntElement = (TNTElement) element;
|
TNTElement tntElement = (TNTElement) element;
|
||||||
element.remove(tntElement);
|
|
||||||
if (tntElement.hasParent()) {
|
if (tntElement.hasParent()) {
|
||||||
tntElement.getParent().remove(tntElement);
|
tntElement.getParent().remove(tntElement);
|
||||||
if (tntElement.getParent().getElements().isEmpty()) {
|
if (tntElement.getParent().getElements().isEmpty()) {
|
||||||
remove(tntElement.getParent());
|
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();
|
element.close();
|
||||||
tntElementList.remove(element);
|
tntElementList.remove(element);
|
||||||
|
@ -32,7 +32,6 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
import org.bukkit.util.RayTraceResult;
|
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
@ -89,9 +88,6 @@ public class TNTSimulatorListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
SimulatorCursor.hide(event.getPlayer(), null);
|
SimulatorCursor.hide(event.getPlayer(), null);
|
||||||
SimulatorStorage.getSimulatorNames().forEach(s -> {
|
|
||||||
SimulatorStorage.getSimulator(s).hide(event.getPlayer());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren