From 6c30fae13de3ccab55e0c4ba8355e3622b8f2d31 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 23 Aug 2022 11:34:00 +0200 Subject: [PATCH 1/2] Remove System.out calls --- .../bausystem/utils/FlatteningWrapper15.java | 20 ------------------- .../bausystem/features/gui/BauGUI.java | 1 - 2 files changed, 21 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java index ea349be6..f3790e5e 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java @@ -125,35 +125,22 @@ public class FlatteningWrapper15 implements FlatteningWrapper { private final Map timing = new HashMap<>(); - private void start(String name) { - timing.put(name, System.currentTimeMillis()); - } - - private long stop(String name) { - return System.currentTimeMillis() - timing.getOrDefault(name, System.currentTimeMillis()); - } - @Override public EditSession paste(File file, Point pastePoint, PasteOptions pasteOptions) { - start("clipboardLoad"); Clipboard clipboard; try (ClipboardReader reader = Objects.requireNonNull(ClipboardFormats.findByFile(file)).getReader(new FileInputStream(file))) { clipboard = reader.read(); } catch (NullPointerException | IOException e) { throw new SecurityException("Bausystem schematic not found", e); } - System.out.println("Clipboard Load: " + stop("clipboardLoad")); - start("paste"); EditSession editSession = paste(clipboard, pastePoint, pasteOptions); - System.out.println("Paste: " + stop("paste")); return editSession; } @Override public EditSession paste(Clipboard clipboard, Point pastePoint, PasteOptions pasteOptions) { try (EditSession e = WorldEdit.getInstance().getEditSessionFactory().getEditSession(new BukkitWorld(Bukkit.getWorlds().get(0)), -1)) { - start("changeColor"); if (pasteOptions.getColor() != Color.YELLOW) { changeColor(clipboard, pasteOptions.getColor()); } @@ -187,9 +174,7 @@ public class FlatteningWrapper15 implements FlatteningWrapper { } }); } - System.out.println("ChangeColor: " + stop("changeColor")); - start("transform"); ClipboardHolder ch = new ClipboardHolder(clipboard); BlockVector3 dimensions = clipboard.getDimensions(); BlockVector3 v = BlockVector3.at(pastePoint.getX(), pastePoint.getY(), pastePoint.getZ()); @@ -200,19 +185,14 @@ public class FlatteningWrapper15 implements FlatteningWrapper { } else { v = v.subtract(dimensions.getX() / 2, 0, dimensions.getZ() / 2).subtract(offset); } - System.out.println("Transform: " + stop("transform")); - start("reset"); if (pasteOptions.isReset()) { e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint())), Objects.requireNonNull(BlockTypes.AIR).getDefaultState().toBaseBlock()); if (pasteOptions.getWaterLevel() != 0) { e.setBlocks((Region) new CuboidRegion(toBlockVector3(pasteOptions.getMinPoint()), toBlockVector3(pasteOptions.getMaxPoint()).withY(pasteOptions.getWaterLevel())), Objects.requireNonNull(BlockTypes.WATER).getDefaultState().toBaseBlock()); } } - System.out.println("Reset: " + stop("reset")); - start("operation"); Operations.completeBlindly(ch.createPaste(e).to(v).ignoreAirBlocks(pasteOptions.isIgnoreAir()).build()); - System.out.println("Operation: " + stop("operation")); return e; } catch (WorldEditException e) { throw new SecurityException(e.getMessage(), e); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java index a8978852..72087f9d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java @@ -56,7 +56,6 @@ public class BauGUI { if (ITEMS.containsKey(item.getId())) { throw new IllegalArgumentException("Duplicate Id Key: " + item.getId() + ". From Classes: " + ITEMS.get(item.getId()).getClass().getName() + " and " + item.getClass().getName()); } - System.out.println("Added Item: " + item.getId()); ITEMS.put(item.getId(), item); } -- 2.39.5 From 87c9827d4649382f45a8545c9faf32b64a278c1a Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Tue, 23 Aug 2022 11:35:15 +0200 Subject: [PATCH 2/2] Remove Timing map --- .../src/de/steamwar/bausystem/utils/FlatteningWrapper15.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java index f3790e5e..cadcb72a 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/utils/FlatteningWrapper15.java @@ -123,8 +123,6 @@ public class FlatteningWrapper15 implements FlatteningWrapper { private static final BaseBlock CONCRETE_POWDER = Objects.requireNonNull(BlockTypes.PINK_CONCRETE_POWDER).getDefaultState().toBaseBlock(); private static final BaseBlock CARPET = Objects.requireNonNull(BlockTypes.PINK_CARPET).getDefaultState().toBaseBlock(); - private final Map timing = new HashMap<>(); - @Override public EditSession paste(File file, Point pastePoint, PasteOptions pasteOptions) { Clipboard clipboard; -- 2.39.5