Update TNTSimulator.edit to better reflect interactability
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
c3838138b4
Commit
4dafaab5d9
@ -167,7 +167,30 @@ public class TNTSimulator {
|
|||||||
if (elements.size() == 1) {
|
if (elements.size() == 1) {
|
||||||
TNTElementGUI.open(player, (TNTElement) elements.get(0), null);
|
TNTElementGUI.open(player, (TNTElement) elements.get(0), null);
|
||||||
} else {
|
} else {
|
||||||
TNTSimulatorGui.open(player, null, null, () -> elements, null);
|
List<TNTGroup> tntGroups = tntElementList.stream().filter(TNTGroup.class::isInstance).map(TNTGroup.class::cast).collect(Collectors.toList());
|
||||||
|
List<SimulatorElement> newElementList = new ArrayList<>();
|
||||||
|
for (TNTGroup tntGroup : tntGroups) {
|
||||||
|
if (new HashSet<>(elements).containsAll(tntGroup.getElements())) {
|
||||||
|
newElementList.add(tntGroup);
|
||||||
|
elements.removeAll(tntGroup.getElements());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
newElementList.addAll(elements);
|
||||||
|
if (newElementList.size() == 1) {
|
||||||
|
SimulatorElement element = newElementList.get(0);
|
||||||
|
if (element instanceof TNTGroup) {
|
||||||
|
TNTGroup tntGroup = (TNTGroup) element;
|
||||||
|
TNTSimulatorGui.open(player, null, tntGroup, () -> {
|
||||||
|
List<SimulatorElement> elementList = new ArrayList<>();
|
||||||
|
elementList.addAll(tntGroup.getElements());
|
||||||
|
return elementList;
|
||||||
|
}, null);
|
||||||
|
} else {
|
||||||
|
TNTElementGUI.open(player, (TNTElement) elements.get(0), null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TNTSimulatorGui.open(player, null, null, () -> newElementList, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren