SteamWar/BauSystem2.0
Archiviert
12
0

Add auto trace back to the gui
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-06-11 20:54:26 +02:00
Ursprung 9ee33e8dcb
Commit 2e86324544

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bausystem.features.simulator.gui;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.configplayer.Config;
import de.steamwar.bausystem.features.simulator.TNTSimulator;
import de.steamwar.bausystem.features.simulator.tnt.SimulatorElement;
import de.steamwar.bausystem.features.simulator.tnt.TNTElement;
@ -67,9 +68,15 @@ public class TNTSimulatorGui {
inv.setItem(47, new SWItem(Material.ARROW, BauSystem.MESSAGE.parse("SIMULATOR_BACK", player), clickType -> back.run()));
}
if (currentTntSimulator != null) {
inv.setItem(49, new SWItem(Material.MAGENTA_GLAZED_TERRACOTTA, BauSystem.MESSAGE.parse("SIMULATOR_GUI_MOVE_ALL", player), clickType -> {
inv.setItem(50, new SWItem(Material.MAGENTA_GLAZED_TERRACOTTA, BauSystem.MESSAGE.parse("SIMULATOR_GUI_MOVE_ALL", player), clickType -> {
moveAll(player, currentTntSimulator, () -> open(player, currentTntSimulator, currentTntGroup, simulatorElements, back));
}));
boolean simulatorAutoTrace = Config.getInstance().get(player).getPlainValueOrDefault("simulatorAutoTrace", false);
inv.setItem(48, new SWItem(simulatorAutoTrace ? Material.CHAIN_COMMAND_BLOCK : Material.COMMAND_BLOCK, BauSystem.MESSAGE.parse("SIMULATOR_GUI_AUTO_TRACE", player, simulatorAutoTrace), clickType -> {
Config.getInstance().get(player).put("simulatorAutoTrace", !simulatorAutoTrace);
open(player, currentTntSimulator, currentTntGroup, simulatorElements, back);
}));
}
if (currentTntGroup != null) {
Runnable editObserver = () -> {