Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
974b12a1fd
Commit
ad4e5bbb26
@ -74,6 +74,7 @@ public class TNTElementGUI {
|
|||||||
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Y", player, tntElement.getPosition().getY()));
|
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Y", player, tntElement.getPosition().getY()));
|
||||||
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Z", player, tntElement.getPosition().getZ()));
|
locationLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_POSITION_Z", player, tntElement.getPosition().getZ()));
|
||||||
inv.setItem(20, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_LOCATION", player), locationLore, false, clickType -> {
|
inv.setItem(20, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_LOCATION", player), locationLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
editLocation(player, tntElement, () -> open(player, tntElement, back));
|
editLocation(player, tntElement, () -> open(player, tntElement, back));
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
}));
|
}));
|
||||||
@ -88,6 +89,7 @@ public class TNTElementGUI {
|
|||||||
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Y", player, active(player, tntElement.isYVelocity())));
|
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Y", player, active(player, tntElement.isYVelocity())));
|
||||||
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Z", player, active(player, tntElement.isZVelocity())));
|
propertiesLore.add(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Z", player, active(player, tntElement.isZVelocity())));
|
||||||
inv.setItem(22, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_PROPERTIES", player), propertiesLore, false, clickType -> {
|
inv.setItem(22, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_PROPERTIES", player), propertiesLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
editProperties(player, tntElement, () -> open(player, tntElement, back));
|
editProperties(player, tntElement, () -> open(player, tntElement, back));
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
}));
|
}));
|
||||||
@ -101,12 +103,14 @@ public class TNTElementGUI {
|
|||||||
otherLore.add(BauSystem.MESSAGE.parse("SIMULATOR_GUI_TNT_DISABLED", player));
|
otherLore.add(BauSystem.MESSAGE.parse("SIMULATOR_GUI_TNT_DISABLED", player));
|
||||||
}
|
}
|
||||||
inv.setItem(24, new SWItem(Material.ANVIL, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_OTHER", player), otherLore, false, clickType -> {
|
inv.setItem(24, new SWItem(Material.ANVIL, BauSystem.MESSAGE.parse("SIMULATOR_EDIT_OTHER", player), otherLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
editOther(player, tntElement, () -> open(player, tntElement, back));
|
editOther(player, tntElement, () -> open(player, tntElement, back));
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Delete tnt
|
// Delete tnt
|
||||||
inv.setItem(44, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_REMOVE_TNT", player), clickType -> {
|
inv.setItem(44, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_REMOVE_TNT", player), clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntSimulator.remove(tntElement);
|
tntSimulator.remove(tntElement);
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
@ -137,6 +141,7 @@ public class TNTElementGUI {
|
|||||||
|
|
||||||
// Alignment
|
// Alignment
|
||||||
inv.setItem(23, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_NEGATIVE_Z", player), clickType -> { // Z negative
|
inv.setItem(23, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_NEGATIVE_Z", player), clickType -> { // Z negative
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntSimulator.hide(tntElement);
|
tntSimulator.hide(tntElement);
|
||||||
Vector position = tntElement.getPosition();
|
Vector position = tntElement.getPosition();
|
||||||
@ -146,6 +151,7 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
}));
|
}));
|
||||||
inv.setItem(25, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_POSITIVE_Z", player), clickType -> { // Z positive
|
inv.setItem(25, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_POSITIVE_Z", player), clickType -> { // Z positive
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntSimulator.hide(tntElement);
|
tntSimulator.hide(tntElement);
|
||||||
Vector position = tntElement.getPosition();
|
Vector position = tntElement.getPosition();
|
||||||
@ -155,6 +161,7 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
}));
|
}));
|
||||||
inv.setItem(15, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_POSITIVE_X", player), clickType -> { // X positive
|
inv.setItem(15, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_POSITIVE_X", player), clickType -> { // X positive
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntSimulator.hide(tntElement);
|
tntSimulator.hide(tntElement);
|
||||||
Vector position = tntElement.getPosition();
|
Vector position = tntElement.getPosition();
|
||||||
@ -164,6 +171,7 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
}));
|
}));
|
||||||
inv.setItem(33, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_NEGATIVE_X", player), clickType -> { // X negative
|
inv.setItem(33, new SWItem(Material.OAK_BUTTON, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_NEGATIVE_X", player), clickType -> { // X negative
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntSimulator.hide(tntElement);
|
tntSimulator.hide(tntElement);
|
||||||
Vector position = tntElement.getPosition();
|
Vector position = tntElement.getPosition();
|
||||||
@ -173,6 +181,7 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
}));
|
}));
|
||||||
inv.setItem(24, new SWItem(Material.SUNFLOWER, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_CENTER", player), clickType -> { // CENTER
|
inv.setItem(24, new SWItem(Material.SUNFLOWER, BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_CENTER", player), clickType -> { // CENTER
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntSimulator.hide(tntElement);
|
tntSimulator.hide(tntElement);
|
||||||
Vector position = tntElement.getPosition();
|
Vector position = tntElement.getPosition();
|
||||||
@ -237,6 +246,7 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
})));
|
})));
|
||||||
SWItem countItem = new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_COUNT", player, tntElement.getCount()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_COUNT_ANVIL_GUI_NAME", player), tntElement.getCount(), c -> {
|
SWItem countItem = new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_COUNT", player, tntElement.getCount()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_COUNT_ANVIL_GUI_NAME", player), tntElement.getCount(), c -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntElement.setCount(c);
|
tntElement.setCount(c);
|
||||||
tntElement.change();
|
tntElement.change();
|
||||||
@ -259,6 +269,7 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
})));
|
})));
|
||||||
SWItem tickItem = new SWItem(SWItem.getMaterial("DIODE"), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK", player, tntElement.getTickOffset()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK_ANVIL_GUI_NAME", player), tntElement.getTickOffset(), tick -> {
|
SWItem tickItem = new SWItem(SWItem.getMaterial("DIODE"), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK", player, tntElement.getTickOffset()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK_ANVIL_GUI_NAME", player), tntElement.getTickOffset(), tick -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntElement.setTickOffset(tick - tntElement.getParentTickOffset());
|
tntElement.setTickOffset(tick - tntElement.getParentTickOffset());
|
||||||
tntElement.change();
|
tntElement.change();
|
||||||
@ -281,6 +292,7 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
})));
|
})));
|
||||||
SWItem fuseTickItem = new SWItem(Material.CLOCK, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_FUSE", player, tntElement.getFuseTicks()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_FUSE_ANVIL_GUI_NAME", player), tntElement.getFuseTicks(), tick -> {
|
SWItem fuseTickItem = new SWItem(Material.CLOCK, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_FUSE", player, tntElement.getFuseTicks()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_FUSE_ANVIL_GUI_NAME", player), tntElement.getFuseTicks(), tick -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntElement.setFuseTicks(tick);
|
tntElement.setFuseTicks(tick);
|
||||||
tntElement.change();
|
tntElement.change();
|
||||||
@ -297,6 +309,7 @@ public class TNTElementGUI {
|
|||||||
|
|
||||||
// Velocity Settings
|
// Velocity Settings
|
||||||
inv.setItem(24, Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_NAME", player), clickType -> {
|
inv.setItem(24, Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_NAME", player), clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
if (tntElement.isXVelocity() || tntElement.isYVelocity() || tntElement.isZVelocity()) {
|
if (tntElement.isXVelocity() || tntElement.isYVelocity() || tntElement.isZVelocity()) {
|
||||||
tntElement.setXVelocity(false);
|
tntElement.setXVelocity(false);
|
||||||
@ -310,16 +323,19 @@ public class TNTElementGUI {
|
|||||||
tntElement.change();
|
tntElement.change();
|
||||||
});
|
});
|
||||||
inv.setItem(32, new SWItem(getWool(tntElement.isXVelocity()), getColor(tntElement.isXVelocity()), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_X", player, active(player, tntElement.isXVelocity())), clickType -> {
|
inv.setItem(32, new SWItem(getWool(tntElement.isXVelocity()), getColor(tntElement.isXVelocity()), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_X", player, active(player, tntElement.isXVelocity())), clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntElement.setXVelocity(!tntElement.isXVelocity());
|
tntElement.setXVelocity(!tntElement.isXVelocity());
|
||||||
tntElement.change();
|
tntElement.change();
|
||||||
}));
|
}));
|
||||||
inv.setItem(15, new SWItem(getWool(tntElement.isYVelocity()), getColor(tntElement.isYVelocity()), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Y", player, active(player, tntElement.isYVelocity())), clickType -> {
|
inv.setItem(15, new SWItem(getWool(tntElement.isYVelocity()), getColor(tntElement.isYVelocity()), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Y", player, active(player, tntElement.isYVelocity())), clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntElement.setYVelocity(!tntElement.isYVelocity());
|
tntElement.setYVelocity(!tntElement.isYVelocity());
|
||||||
tntElement.change();
|
tntElement.change();
|
||||||
}));
|
}));
|
||||||
inv.setItem(34, new SWItem(getWool(tntElement.isZVelocity()), getColor(tntElement.isZVelocity()), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Z", player, active(player, tntElement.isZVelocity())), clickType -> {
|
inv.setItem(34, new SWItem(getWool(tntElement.isZVelocity()), getColor(tntElement.isZVelocity()), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_VELOCITY_Z", player, active(player, tntElement.isZVelocity())), clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntElement.setZVelocity(!tntElement.isZVelocity());
|
tntElement.setZVelocity(!tntElement.isZVelocity());
|
||||||
tntElement.change();
|
tntElement.change();
|
||||||
@ -347,6 +363,7 @@ public class TNTElementGUI {
|
|||||||
AtomicBoolean recalculate = new AtomicBoolean(false);
|
AtomicBoolean recalculate = new AtomicBoolean(false);
|
||||||
Runnable editObserver = () -> {
|
Runnable editObserver = () -> {
|
||||||
inv.setItem(19, new SWItem(tntElement.getOrder(), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ACTIVATED_NAME", player), OrderUtils.orderList(tntElement.getOrder(), player), false, clickType -> {
|
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 == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
if (clickType.isShiftClick()) {
|
if (clickType.isShiftClick()) {
|
||||||
tntElement.setOrder(OrderUtils.previous(tntElement.getOrder()));
|
tntElement.setOrder(OrderUtils.previous(tntElement.getOrder()));
|
||||||
@ -361,6 +378,7 @@ public class TNTElementGUI {
|
|||||||
|
|
||||||
if (!tntElement.hasParent()) {
|
if (!tntElement.hasParent()) {
|
||||||
inv.setItem(24, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ADD_IGNITION_PHASE", player), Arrays.asList(), false, clickType -> {
|
inv.setItem(24, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ADD_IGNITION_PHASE", player), Arrays.asList(), false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
// Create TNTGroup
|
// Create TNTGroup
|
||||||
tntSimulator.getTntElementList().remove(tntElement);
|
tntSimulator.getTntElementList().remove(tntElement);
|
||||||
@ -390,6 +408,7 @@ public class TNTElementGUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inv.setItem(25, new SWItem(Material.DISPENSER, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ADD_TNT", player), clickType -> {
|
inv.setItem(25, new SWItem(Material.DISPENSER, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_ADD_TNT", player), clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
Vector vector = tntElement.getOwnPosition().clone();
|
Vector vector = tntElement.getOwnPosition().clone();
|
||||||
TNTElement newElement = new TNTElement(vector);
|
TNTElement newElement = new TNTElement(vector);
|
||||||
@ -407,6 +426,7 @@ public class TNTElementGUI {
|
|||||||
|
|
||||||
// Delete tnt
|
// Delete tnt
|
||||||
inv.setItem(44, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_REMOVE_TNT", player), clickType -> {
|
inv.setItem(44, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_REMOVE_TNT", player), clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntSimulator.remove(tntElement);
|
tntSimulator.remove(tntElement);
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
|
@ -33,6 +33,7 @@ import de.steamwar.inventory.SWItem;
|
|||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.util.Consumer;
|
import org.bukkit.util.Consumer;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -70,11 +71,13 @@ public class TNTGroupEditGUI {
|
|||||||
|
|
||||||
// Change TickOffset
|
// Change TickOffset
|
||||||
inv.setItem(16, new SWItem(SWItem.getDye(10), plusOneName, plusOneFiveShiftLore, false, clickType -> {
|
inv.setItem(16, new SWItem(SWItem.getDye(10), plusOneName, plusOneFiveShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntGroup.setTickOffset(tntGroup.getTickOffset() + (clickType.isShiftClick() ? 5 : 1));
|
tntGroup.setTickOffset(tntGroup.getTickOffset() + (clickType.isShiftClick() ? 5 : 1));
|
||||||
tntGroup.change();
|
tntGroup.change();
|
||||||
}));
|
}));
|
||||||
SWItem tickItem = new SWItem(SWItem.getMaterial("DIODE"), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK", player, tntGroup.getTickOffset()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK_ANVIL_GUI_NAME", player), tntGroup.getTickOffset(), tick -> {
|
SWItem tickItem = new SWItem(SWItem.getMaterial("DIODE"), BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK", player, tntGroup.getTickOffset()), lore, false, clickType -> changeCount(player, BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_TICK_ANVIL_GUI_NAME", player), tntGroup.getTickOffset(), tick -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntGroup.setTickOffset(tick);
|
tntGroup.setTickOffset(tick);
|
||||||
tntGroup.change();
|
tntGroup.change();
|
||||||
@ -83,6 +86,7 @@ public class TNTGroupEditGUI {
|
|||||||
tickItem.getItemStack().setAmount(Math.max(tntGroup.getTickOffset(), 1));
|
tickItem.getItemStack().setAmount(Math.max(tntGroup.getTickOffset(), 1));
|
||||||
inv.setItem(25, tickItem);
|
inv.setItem(25, tickItem);
|
||||||
inv.setItem(34, new SWItem(SWItem.getDye(1), minusOneName, minusOneFiveShiftLore, false, clickType -> {
|
inv.setItem(34, new SWItem(SWItem.getDye(1), minusOneName, minusOneFiveShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
recalculate.set(true);
|
recalculate.set(true);
|
||||||
tntGroup.setTickOffset(tntGroup.getTickOffset() - (clickType.isShiftClick() ? 5 : 1));
|
tntGroup.setTickOffset(tntGroup.getTickOffset() - (clickType.isShiftClick() ? 5 : 1));
|
||||||
tntGroup.change();
|
tntGroup.change();
|
||||||
|
@ -33,6 +33,7 @@ import de.steamwar.inventory.SWListInv;
|
|||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -158,6 +159,7 @@ public class TNTSimulatorGui {
|
|||||||
|
|
||||||
// X Position
|
// X Position
|
||||||
inv.setItem(12, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
|
inv.setItem(12, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
tntSimulator.hide();
|
tntSimulator.hide();
|
||||||
moveAll(tntSimulator, clickType.isShiftClick() ? X_VECTOR : FX_VECTOR);
|
moveAll(tntSimulator, clickType.isShiftClick() ? X_VECTOR : FX_VECTOR);
|
||||||
tntSimulator.show();
|
tntSimulator.show();
|
||||||
@ -165,6 +167,7 @@ public class TNTSimulatorGui {
|
|||||||
}));
|
}));
|
||||||
inv.setItem(21, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_POSITION_X", player), lore, false, clickType -> {}));
|
inv.setItem(21, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_POSITION_X", player), lore, false, clickType -> {}));
|
||||||
inv.setItem(30, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
|
inv.setItem(30, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
tntSimulator.hide();
|
tntSimulator.hide();
|
||||||
moveAll(tntSimulator, (clickType.isShiftClick() ? X_VECTOR : FX_VECTOR).clone().multiply(-1));
|
moveAll(tntSimulator, (clickType.isShiftClick() ? X_VECTOR : FX_VECTOR).clone().multiply(-1));
|
||||||
tntSimulator.show();
|
tntSimulator.show();
|
||||||
@ -173,6 +176,7 @@ public class TNTSimulatorGui {
|
|||||||
|
|
||||||
// Y Position
|
// Y Position
|
||||||
inv.setItem(13, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
|
inv.setItem(13, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
tntSimulator.hide();
|
tntSimulator.hide();
|
||||||
moveAll(tntSimulator, clickType.isShiftClick() ? Y_VECTOR : FY_VECTOR);
|
moveAll(tntSimulator, clickType.isShiftClick() ? Y_VECTOR : FY_VECTOR);
|
||||||
tntSimulator.show();
|
tntSimulator.show();
|
||||||
@ -180,6 +184,7 @@ public class TNTSimulatorGui {
|
|||||||
}));
|
}));
|
||||||
inv.setItem(22, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_POSITION_Y", player), lore, false, clickType -> {}));
|
inv.setItem(22, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_POSITION_Y", player), lore, false, clickType -> {}));
|
||||||
inv.setItem(31, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
|
inv.setItem(31, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
tntSimulator.hide();
|
tntSimulator.hide();
|
||||||
moveAll(tntSimulator, (clickType.isShiftClick() ? Y_VECTOR : FY_VECTOR).clone().multiply(-1));
|
moveAll(tntSimulator, (clickType.isShiftClick() ? Y_VECTOR : FY_VECTOR).clone().multiply(-1));
|
||||||
tntSimulator.show();
|
tntSimulator.show();
|
||||||
@ -188,6 +193,7 @@ public class TNTSimulatorGui {
|
|||||||
|
|
||||||
// Z Position
|
// Z Position
|
||||||
inv.setItem(14, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
|
inv.setItem(14, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
tntSimulator.hide();
|
tntSimulator.hide();
|
||||||
moveAll(tntSimulator, clickType.isShiftClick() ? Z_VECTOR : FZ_VECTOR);
|
moveAll(tntSimulator, clickType.isShiftClick() ? Z_VECTOR : FZ_VECTOR);
|
||||||
tntSimulator.show();
|
tntSimulator.show();
|
||||||
@ -195,6 +201,7 @@ public class TNTSimulatorGui {
|
|||||||
}));
|
}));
|
||||||
inv.setItem(23, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_POSITION_Z", player), lore, false, clickType -> {}));
|
inv.setItem(23, new SWItem(Material.PAPER, BauSystem.MESSAGE.parse("SIMULATOR_POSITION_Z", player), lore, false, clickType -> {}));
|
||||||
inv.setItem(32, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
|
inv.setItem(32, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
|
||||||
|
if (clickType == ClickType.DOUBLE_CLICK) return;
|
||||||
tntSimulator.hide();
|
tntSimulator.hide();
|
||||||
moveAll(tntSimulator, (clickType.isShiftClick() ? Z_VECTOR : FZ_VECTOR).clone().multiply(-1));
|
moveAll(tntSimulator, (clickType.isShiftClick() ? Z_VECTOR : FZ_VECTOR).clone().multiply(-1));
|
||||||
tntSimulator.show();
|
tntSimulator.show();
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren