From eb336fd89e52f97dbeca00754e95205e96efd047 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 24 Apr 2022 20:20:41 +0200 Subject: [PATCH] Hotfix: Schematic ist Komisch --- .../src/de/steamwar/schematicsystem/commands/GUI.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java index 8fb1f87..3bef589 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/GUI.java @@ -73,15 +73,8 @@ public class GUI { if(node.getOwner() == user.getId()){ if(!node.isDir() && node.getSchemtype().writeable()){ - List checkedSchematics = CheckedSchematic.getLastDeclined(player.getUniqueId()); - ListIterator i = checkedSchematics.listIterator(checkedSchematics.size()); - while(i.hasPrevious()) { - CheckedSchematic checkedSchematic = i.previous(); - if(checkedSchematic.getNode() == node.getId()) { - inv.setItem(1, SWItem.getDye(10), (byte) 10, "§eStatus " + node.getSchemtype().name(), Collections.singletonList("§7" + checkedSchematic.getDeclineReason()), false, click -> {}); - break; - } - } + CheckedSchematic.getLastDeclinedOfNode(node).stream().findFirst().ifPresent(checkedSchematic -> + inv.setItem(1, SWItem.getDye(10), (byte) 10, "§eStatus " + node.getSchemtype().name(), Collections.singletonList("§7" + checkedSchematic.getDeclineReason()), false, click -> {})); } Material mat = SWItem.getMaterial(node.getItem());