SteamWar/BauSystem2.0
Archiviert
12
0

Add rmoval of empty group

Dieser Commit ist enthalten in:
D4rkr34lm 2023-10-12 10:25:40 +02:00 committet von yoyosource
Ursprung 6e39f3e92a
Commit b5a81eb6db

Datei anzeigen

@ -31,6 +31,7 @@ import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
public class SimulatorGui extends SimulatorPageGui<SimulatorGroup> { public class SimulatorGui extends SimulatorPageGui<SimulatorGroup> {
@ -46,7 +47,12 @@ public class SimulatorGui extends SimulatorPageGui<SimulatorGroup> {
@Override @Override
public void headerAndFooter() { public void headerAndFooter() {
// TODO: Remove empty Groups for(Iterator<SimulatorGroup> i = simulator.getElements().iterator(); i.hasNext();){
if(i.next().getElements().isEmpty()){
i.remove();
}
}
inventory.setItem(4, new SWItem(simulator.getMaterial(), "§e" + simulator.getName(), clickType -> { inventory.setItem(4, new SWItem(simulator.getMaterial(), "§e" + simulator.getName(), clickType -> {
new SimulatorMaterialGui(player, simulator, simulator::getMaterial, simulator::setMaterial, this).open(); new SimulatorMaterialGui(player, simulator, simulator::getMaterial, simulator::setMaterial, this).open();
})); }));