SteamWar/BauSystem2.0
Archiviert
12
0

Fixed #226
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Added text input for simulator group
Dieser Commit ist enthalten in:
D4rkr34lm 2024-04-02 22:59:40 +02:00
Ursprung c369662a28
Commit eefe92309d
2 geänderte Dateien mit 42 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -69,6 +69,24 @@ public final class SimulatorGroup {
});
}
public void moveToX(double x) {
elements.forEach(simulatorElement -> {
simulatorElement.getPosition().setX(x);
});
}
public void moveToY(double y) {
elements.forEach(simulatorElement -> {
simulatorElement.getPosition().setX(y);
});
}
public void moveToZ(double z) {
elements.forEach(simulatorElement -> {
simulatorElement.getPosition().setX(z);
});
}
public SWItem toItem(Player player, InvCallback groupCallback, InvCallback itemCallback) {
if (elements.size() == 1) {
return elements.get(0).toItem(player, itemCallback);

Datei anzeigen

@ -168,6 +168,14 @@ public class SimulatorGroupSettingsGui extends SimulatorBaseGui {
SimulatorWatcher.update(simulator);
});
inventory.setItem(24, new SWItem(Material.PAPER, "§eX", clickType -> {
new SimulatorAnvilGui<>(player, "X", "", Double::parseDouble, number -> {
if(!allTNT){
number = (double) Math.round(number);
}
simulatorGroup.moveToX(number);
SimulatorWatcher.update(simulator);
return true;
}, this).setItem(Material.PAPER).open();
}));
inventory.setItem(33, SWItem.getDye(1), "§e-1", Arrays.asList(allTNT ? "§7Shift§8: §e-0.0625" : "§7Shift§8: §e-5"), false, clickType -> {
simulatorGroup.move(clickType.isShiftClick() ? (allTNT ? -0.0625 : -5) : -1, 0, 0);
@ -180,6 +188,14 @@ public class SimulatorGroupSettingsGui extends SimulatorBaseGui {
SimulatorWatcher.update(simulator);
});
inventory.setItem(25, new SWItem(Material.PAPER, "§eY", clickType -> {
new SimulatorAnvilGui<>(player, "Y", "", Double::parseDouble, number -> {
if(!allTNT){
number = (double) Math.round(number);
}
simulatorGroup.moveToY(number);
SimulatorWatcher.update(simulator);
return true;
}, this).setItem(Material.PAPER).open();
}));
inventory.setItem(34, SWItem.getDye(1), "§e-1", Arrays.asList(allTNT ? "§7Shift§8: §e-0.0625" : "§7Shift§8: §e-5"), false, clickType -> {
simulatorGroup.move(0, clickType.isShiftClick() ? (allTNT ? -0.0625 : -5) : -1, 0);
@ -192,6 +208,14 @@ public class SimulatorGroupSettingsGui extends SimulatorBaseGui {
SimulatorWatcher.update(simulator);
});
inventory.setItem(26, new SWItem(Material.PAPER, "§eZ", clickType -> {
new SimulatorAnvilGui<>(player, "Z", "", Double::parseDouble, number -> {
if(!allTNT){
number = (double) Math.round(number);
}
simulatorGroup.moveToZ(number);
SimulatorWatcher.update(simulator);
return true;
}, this).setItem(Material.PAPER).open();
}));
inventory.setItem(35, SWItem.getDye(1), "§e-1", Arrays.asList(allTNT ? "§7Shift§8: §e-0.0625" : "§7Shift§8: §e-5"), false, clickType -> {
simulatorGroup.move(0, 0, clickType.isShiftClick() ? (allTNT ? -0.0625 : -5) : -1);