Dieser Commit ist enthalten in:
Ursprung
f1f783f0ec
Commit
be0f15891b
@ -20,7 +20,6 @@
|
||||
package de.steamwar.bausystem.features.simulator;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
|
||||
import de.steamwar.bausystem.features.simulator.show.SimulatorEntityShowMode;
|
||||
import de.steamwar.bausystem.features.simulator.tnt.SimulatorElement;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
@ -72,6 +72,12 @@ public class SimulatorStorage implements Enable, Disable {
|
||||
return tntSimulators.get(name);
|
||||
}
|
||||
|
||||
public static TNTSimulator getSimulator(Player player) {
|
||||
TNTSimulator current = getSimulator(player.getInventory().getItemInMainHand());
|
||||
if (current != null) return current;
|
||||
return getSimulator(player.getInventory().getItemInOffHand());
|
||||
}
|
||||
|
||||
public static TNTSimulator getSimulator(ItemStack itemStack) {
|
||||
if (itemStack == null) {
|
||||
return null;
|
||||
|
@ -109,7 +109,7 @@ public class TNTElementGUI {
|
||||
}
|
||||
|
||||
Runnable editObserver = () -> {
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player.getInventory().getItemInMainHand());
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player);
|
||||
|
||||
ChangePosition.show(inv, player, tntSimulator, tntElement, tntElement::getOwnPosition, x -> x - tntElement.getParentPosition().getX(), y -> y - tntElement.getParentPosition().getY(), z -> z - tntElement.getParentPosition().getZ(), () -> editLocation(player, tntElement, back));
|
||||
|
||||
@ -286,7 +286,7 @@ public class TNTElementGUI {
|
||||
}
|
||||
|
||||
Runnable editObserver = () -> {
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player.getInventory().getItemInMainHand());
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player);
|
||||
|
||||
inv.setItem(19, new SWItem(tntElement.getOrder(), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ACTIVATED_NAME", player), OrderUtils.orderList(tntElement.getOrder(), player), false, clickType -> {
|
||||
if (clickType.isShiftClick()) {
|
||||
|
@ -60,7 +60,7 @@ public class TNTGroupEditGUI {
|
||||
List<String> lore = Arrays.asList(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_LORE", player));
|
||||
|
||||
Runnable editObserver = () -> {
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player.getInventory().getItemInMainHand());
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player);
|
||||
|
||||
ChangePosition.show(inv, player, tntSimulator, tntGroup, tntGroup::getPosition, UnaryOperator.identity(), UnaryOperator.identity(), UnaryOperator.identity(), () -> open(player, tntGroup, back));
|
||||
ChangeMaterial.show(inv, player, 14, tntGroup, Material.BARREL, () -> open(player, tntGroup, back));
|
||||
|
@ -121,7 +121,7 @@ public class TNTSimulatorGui {
|
||||
currentTntSimulator.getTntElementList().clear();
|
||||
player.closeInventory();
|
||||
} else {
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player.getInventory().getItemInMainHand());
|
||||
TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player);
|
||||
tntSimulator.remove(currentTntGroup);
|
||||
}
|
||||
}));
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren