Fix shift clicking
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-06-15 23:33:44 +02:00
Ursprung 1804dbc27d
Commit cc7cd81abe
2 geänderte Dateien mit 17 neuen und 17 gelöschten Zeilen

Datei anzeigen

@ -114,7 +114,7 @@ public class TNTElementGUI {
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));
// 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, "§a" + BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_NEGATIVE_Z", player), clickType -> { // Z negative
if (tntSimulator != null) tntSimulator.hide(tntElement);
Vector position = tntElement.getPosition();
align(position, new Vector(0, 0, 0.49));
@ -122,7 +122,7 @@ public class TNTElementGUI {
if (tntSimulator != null) tntSimulator.show(tntElement);
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, "§b" + BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_POSITIVE_Z", player), clickType -> { // Z positive
if (tntSimulator != null) tntSimulator.hide(tntElement);
Vector position = tntElement.getPosition();
align(position, new Vector(0, 0, 0.51));
@ -130,7 +130,7 @@ public class TNTElementGUI {
if (tntSimulator != null) tntSimulator.show(tntElement);
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, "§c" + BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_POSITIVE_X", player), clickType -> { // X positive
if (tntSimulator != null) tntSimulator.hide(tntElement);
Vector position = tntElement.getPosition();
align(position, new Vector(0.51, 0, 0));
@ -138,7 +138,7 @@ public class TNTElementGUI {
if (tntSimulator != null) tntSimulator.show(tntElement);
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, "§e" + BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_NEGATIVE_X", player), clickType -> { // X negative
if (tntSimulator != null) tntSimulator.hide(tntElement);
Vector position = tntElement.getPosition();
align(position, new Vector(0.49, 0, 0));
@ -146,7 +146,7 @@ public class TNTElementGUI {
if (tntSimulator != null) tntSimulator.show(tntElement);
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, "§f" + BauSystem.MESSAGE.parse("SIMULATOR_ALIGNMENT_CENTER", player), clickType -> { // CENTER
if (tntSimulator != null) tntSimulator.hide(tntElement);
Vector position = tntElement.getPosition();
align(position, new Vector(0.5, 0, 0.5));
@ -196,7 +196,7 @@ public class TNTElementGUI {
Runnable editObserver = () -> {
// Change Count of spawned TNT
inv.setItem(10, new SWItem(SWItem.getDye(10), plusOneName, plusOneFiveShiftLore, false, clickType -> {
inv.setItem(10, new SWItem(SWItem.getDye(10), "§a" + plusOneName, plusOneFiveShiftLore, false, clickType -> {
tntElement.setCount(tntElement.getCount() + ((clickType.isShiftClick()) ? 5 : 1));
tntElement.change();
}));
@ -207,13 +207,13 @@ public class TNTElementGUI {
}, () -> editProperties(player, tntElement, back)));
countItem.getItemStack().setAmount(tntElement.getCount());
inv.setItem(19, countItem);
inv.setItem(28, new SWItem(SWItem.getDye(1), minusOneName, minusOneFiveShiftLore, false, clickType -> {
inv.setItem(28, new SWItem(SWItem.getDye(1), "§a" + minusOneName, minusOneFiveShiftLore, false, clickType -> {
tntElement.setCount(tntElement.getCount() - ((clickType.isShiftClick()) ? 5 : 1));
tntElement.change();
}));
// Change TickOffset
inv.setItem(11, new SWItem(SWItem.getDye(10), plusOneName, plusOneFiveShiftLore, false, clickType -> {
inv.setItem(11, new SWItem(SWItem.getDye(10), "§b" + plusOneName, plusOneFiveShiftLore, false, clickType -> {
tntElement.setTickOffset(tntElement.getOwnTickOffset() + (clickType.isShiftClick() ? 5 : 1));
tntElement.change();
}));
@ -224,13 +224,13 @@ public class TNTElementGUI {
}, () -> editProperties(player, tntElement, back)));
tickItem.getItemStack().setAmount(Math.max(tntElement.getTickOffset(), 1));
inv.setItem(20, tickItem);
inv.setItem(29, new SWItem(SWItem.getDye(1), minusOneName, minusOneFiveShiftLore, false, clickType -> {
inv.setItem(29, new SWItem(SWItem.getDye(1), "§b" + minusOneName, minusOneFiveShiftLore, false, clickType -> {
tntElement.setTickOffset(tntElement.getOwnTickOffset() - (clickType.isShiftClick() ? 5 : 1));
tntElement.change();
}));
// Change FuseTicks
inv.setItem(12, new SWItem(SWItem.getDye(10), plusOneName, plusOneFiveShiftLore, false, clickType -> {
inv.setItem(12, new SWItem(SWItem.getDye(10), "§c" + plusOneName, plusOneFiveShiftLore, false, clickType -> {
tntElement.setFuseTicks(tntElement.getFuseTicks() + (clickType.isShiftClick() ? 5 : 1));
tntElement.change();
}));
@ -241,7 +241,7 @@ public class TNTElementGUI {
}, () -> editProperties(player, tntElement, back)));
fuseTickItem.getItemStack().setAmount(Math.max(tntElement.getFuseTicks(), 1));
inv.setItem(21, fuseTickItem);
inv.setItem(30, new SWItem(SWItem.getDye(1), minusOneName, minusOneFiveShiftLore, false, clickType -> {
inv.setItem(30, new SWItem(SWItem.getDye(1), "§c" + minusOneName, minusOneFiveShiftLore, false, clickType -> {
tntElement.setFuseTicks(tntElement.getFuseTicks() - (clickType.isShiftClick() ? 5 : 1));
tntElement.change();
}));

Datei anzeigen

@ -56,7 +56,7 @@ public class ChangePosition {
List<String> lore = Arrays.asList(BauSystem.MESSAGE.parse("SIMULATOR_TNT_SPAWN_LORE", player));
// X Position
inv.setItem(10, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
inv.setItem(10, new SWItem(SWItem.getDye(10), "§a" + plusOneName, plusOnePixelShiftLore, false, clickType -> {
if (tntSimulator != null) tntSimulator.hide(simulatorElement);
toChangeVector.get().add(clickType.isShiftClick() ? X_VECTOR : FX_VECTOR);
if (tntSimulator != null) tntSimulator.show(simulatorElement);
@ -71,7 +71,7 @@ public class ChangePosition {
back.run();
}, back);
}));
inv.setItem(28, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
inv.setItem(28, new SWItem(SWItem.getDye(1), "§a" + minusOneName, minusOnePixelShiftLore, false, clickType -> {
if (tntSimulator != null) tntSimulator.hide(simulatorElement);
toChangeVector.get().subtract(clickType.isShiftClick() ? X_VECTOR : FX_VECTOR);
if (tntSimulator != null) tntSimulator.show(simulatorElement);
@ -79,7 +79,7 @@ public class ChangePosition {
}));
// Y Position
inv.setItem(11, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
inv.setItem(11, new SWItem(SWItem.getDye(10), "§b" + plusOneName, plusOnePixelShiftLore, false, clickType -> {
if (tntSimulator != null) tntSimulator.hide(simulatorElement);
toChangeVector.get().add(clickType.isShiftClick() ? Y_VECTOR : FY_VECTOR);
if (tntSimulator != null) tntSimulator.show(simulatorElement);
@ -94,7 +94,7 @@ public class ChangePosition {
back.run();
}, back);
}));
inv.setItem(29, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
inv.setItem(29, new SWItem(SWItem.getDye(1), "§b" + minusOneName, minusOnePixelShiftLore, false, clickType -> {
if (tntSimulator != null) tntSimulator.hide(simulatorElement);
toChangeVector.get().subtract(clickType.isShiftClick() ? Y_VECTOR : FY_VECTOR);
if (tntSimulator != null) tntSimulator.show(simulatorElement);
@ -102,7 +102,7 @@ public class ChangePosition {
}));
// Z Position
inv.setItem(12, new SWItem(SWItem.getDye(10), plusOneName, plusOnePixelShiftLore, false, clickType -> {
inv.setItem(12, new SWItem(SWItem.getDye(10), "§c" + plusOneName, plusOnePixelShiftLore, false, clickType -> {
if (tntSimulator != null) tntSimulator.hide(simulatorElement);
toChangeVector.get().add(clickType.isShiftClick() ? Z_VECTOR : FZ_VECTOR);
if (tntSimulator != null) tntSimulator.show(simulatorElement);
@ -117,7 +117,7 @@ public class ChangePosition {
back.run();
}, back);
}));
inv.setItem(30, new SWItem(SWItem.getDye(1), minusOneName, minusOnePixelShiftLore, false, clickType -> {
inv.setItem(30, new SWItem(SWItem.getDye(1), "§c" + minusOneName, minusOnePixelShiftLore, false, clickType -> {
if (tntSimulator != null) tntSimulator.hide(simulatorElement);
toChangeVector.get().subtract(clickType.isShiftClick() ? Z_VECTOR : FZ_VECTOR);
if (tntSimulator != null) tntSimulator.show(simulatorElement);