Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
9bfa4282b5
Commit
1804dbc27d
@ -36,6 +36,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@ -58,6 +59,7 @@ public class TNTSimulatorGui {
|
||||
swListEntryList.add(new SWListInv.SWListEntry<>(element.menu(player), element));
|
||||
totalTNTCount += element.tntCount();
|
||||
}
|
||||
swListEntryList.sort(Comparator.comparing(o -> o.getObject().tick()));
|
||||
|
||||
SWListInv<SimulatorElement> inv = new SWListInv<>(player, BauSystem.MESSAGE.parse("SIMULATOR_GUI_NAME", player), false, swListEntryList, (clickType, simulatorElement) -> {
|
||||
if (simulatorElement instanceof TNTGroup) {
|
||||
|
@ -51,6 +51,7 @@ public interface SimulatorElement {
|
||||
SWItem menu(Player p);
|
||||
boolean locations(Map<Integer, Map<Integer, Set<Pair<Runnable, Integer>>>> result, Region region, Location location); // Ticks to subtick order to spawning runnable to count of activations
|
||||
int tntCount();
|
||||
int tick();
|
||||
|
||||
// Observer
|
||||
default void change() {
|
||||
|
@ -203,6 +203,11 @@ public class TNTElement implements SimulatorElement {
|
||||
return disabled ? 0 : count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tick() {
|
||||
return getTickOffset();
|
||||
}
|
||||
|
||||
public void setCount(int count) {
|
||||
if (count < 0) count = 1;
|
||||
if (count > 400) count = 400;
|
||||
|
@ -157,6 +157,11 @@ public class TNTGroup implements SimulatorElement {
|
||||
return elements.stream().mapToInt(TNTElement::tntCount).sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tick() {
|
||||
return getTickOffset();
|
||||
}
|
||||
|
||||
public void setTickOffset(int tickOffset) {
|
||||
if (tickOffset < 0) tickOffset = 0;
|
||||
if (tickOffset > 400) tickOffset = 400;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren