Add Phase order upper limit
Dieser Commit ist enthalten in:
Ursprung
420cf4a5b8
Commit
273fba879e
@ -25,6 +25,7 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public abstract class SimulatorSetting {
|
public abstract class SimulatorSetting {
|
||||||
|
public static final int ORDER_LIMIT = 64;
|
||||||
protected int tickOffset;
|
protected int tickOffset;
|
||||||
protected int lifetime = 80;
|
protected int lifetime = 80;
|
||||||
protected int order = 1;
|
protected int order = 1;
|
||||||
|
@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.simulator2.gui;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.features.simulator2.SimulatorWatcher;
|
import de.steamwar.bausystem.features.simulator2.SimulatorWatcher;
|
||||||
import de.steamwar.bausystem.features.simulator2.data.Simulator;
|
import de.steamwar.bausystem.features.simulator2.data.Simulator;
|
||||||
|
import de.steamwar.bausystem.features.simulator2.data.SimulatorSetting;
|
||||||
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneElement;
|
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneElement;
|
||||||
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneSetting;
|
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneSetting;
|
||||||
import de.steamwar.bausystem.features.simulator2.gui.base.SimulatorBaseGui;
|
import de.steamwar.bausystem.features.simulator2.gui.base.SimulatorBaseGui;
|
||||||
@ -32,7 +33,6 @@ import org.bukkit.entity.Player;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class SimulatorRedstonePhaseGui extends SimulatorBaseGui {
|
public class SimulatorRedstonePhaseGui extends SimulatorBaseGui {
|
||||||
|
|
||||||
private final RedstoneElement redstoneElement;
|
private final RedstoneElement redstoneElement;
|
||||||
private final RedstoneSetting redstone;
|
private final RedstoneSetting redstone;
|
||||||
private final SimulatorBaseGui back;
|
private final SimulatorBaseGui back;
|
||||||
@ -115,7 +115,7 @@ public class SimulatorRedstonePhaseGui extends SimulatorBaseGui {
|
|||||||
//Order
|
//Order
|
||||||
int order = redstone.getOrder();
|
int order = redstone.getOrder();
|
||||||
inventory.setItem(14, SWItem.getDye(10), "§e+1", Arrays.asList("§7Shift§8: §e+5"), false, clickType -> {
|
inventory.setItem(14, SWItem.getDye(10), "§e+1", Arrays.asList("§7Shift§8: §e+5"), false, clickType -> {
|
||||||
redstone.changeOrder(clickType.isShiftClick() ? 5 : 1);
|
redstone.setOrder(Math.min(SimulatorSetting.ORDER_LIMIT, order + (clickType.isShiftClick() ? 5 : 1)));
|
||||||
SimulatorWatcher.update(simulator);
|
SimulatorWatcher.update(simulator);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.simulator2.gui;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.features.simulator2.SimulatorWatcher;
|
import de.steamwar.bausystem.features.simulator2.SimulatorWatcher;
|
||||||
import de.steamwar.bausystem.features.simulator2.data.Simulator;
|
import de.steamwar.bausystem.features.simulator2.data.Simulator;
|
||||||
|
import de.steamwar.bausystem.features.simulator2.data.SimulatorSetting;
|
||||||
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneElement;
|
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneElement;
|
||||||
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneSetting;
|
import de.steamwar.bausystem.features.simulator2.data.redstone.RedstoneSetting;
|
||||||
import de.steamwar.bausystem.features.simulator2.data.tnt.TNTElement;
|
import de.steamwar.bausystem.features.simulator2.data.tnt.TNTElement;
|
||||||
@ -136,7 +137,7 @@ public class SimulatorTntPhaseGui extends SimulatorBaseGui{
|
|||||||
//Order
|
//Order
|
||||||
int order = tnt.getOrder();
|
int order = tnt.getOrder();
|
||||||
inventory.setItem(13, SWItem.getDye(10), "§e+1", Arrays.asList("§7Shift§8: §e+5"), false, clickType -> {
|
inventory.setItem(13, SWItem.getDye(10), "§e+1", Arrays.asList("§7Shift§8: §e+5"), false, clickType -> {
|
||||||
tnt.changeOrder(clickType.isShiftClick() ? 5 : 1);
|
tnt.setOrder(Math.min(SimulatorSetting.ORDER_LIMIT, order + (clickType.isShiftClick() ? 5 : 1)));
|
||||||
SimulatorWatcher.update(simulator);
|
SimulatorWatcher.update(simulator);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren