diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java index d8aa5f5f..d299b0e4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java @@ -36,19 +36,14 @@ public class BauGuiImportExport { append(st, Integer.toBinaryString(mapping.getSize() / 9), 3); // Menu Size Map map = new HashMap<>(); - mapping.getMapping().forEach((integer, integer2) -> { - map.put(integer2, integer); - }); + mapping.getMapping().forEach((integer, integer2) -> map.put(integer2, integer)); List integerList = map.keySet().stream().sorted().collect(Collectors.toList()); for (int i = 0; i < integerList.size(); i++) { int current = integerList.get(i); - int last = 0; - if (i != 0) { - last = integerList.get(i - 1); - } + int last = i == 0 ? 0 : integerList.get(i - 1); if (current - last > 1) { - binaryConvert(st, Integer.toBinaryString(current - last), 3, '0'); + binaryConvert(st, Integer.toBinaryString(current - last - 1), 3, '0'); } binaryConvert(st, Integer.toBinaryString(map.get(current)), 4, '1'); }