From 1fe87fedff18cfa89e08f08da86ef0533b678edf Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 23 Nov 2024 09:46:10 -0800 Subject: [PATCH] Debug clean up --- .../boxed/listeners/NewAreaListener.java | 22 ++----------------- .../bentobox/boxed/nms/AbstractMetaData.java | 7 ------ 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/main/java/world/bentobox/boxed/listeners/NewAreaListener.java b/src/main/java/world/bentobox/boxed/listeners/NewAreaListener.java index 28f9675..2ac8399 100644 --- a/src/main/java/world/bentobox/boxed/listeners/NewAreaListener.java +++ b/src/main/java/world/bentobox/boxed/listeners/NewAreaListener.java @@ -153,21 +153,16 @@ public class NewAreaListener implements Listener { * Build something in the queue. Structures are built one by one */ private void buildStructure() { - //BentoBox.getInstance().logDebug("buildStructure"); // Only kick off a build if there is something to build and something isn't // already being built if (!pasting && !itemsToBuild.isEmpty()) { // Build item - //BentoBox.getInstance().logDebug("Build item"); StructureRecord item = itemsToBuild.poll(); placeStructure(item); - } else { - //BentoBox.getInstance().logDebug("Nothing to do"); } } private void placeStructure(StructureRecord item) { - //BentoBox.getInstance().logDebug("Placing structure"); // Set the semaphore - only paste one at a time pasting = true; // Place the structure - this cannot be done async @@ -231,14 +226,13 @@ public class NewAreaListener implements Listener { if (!(addon.inWorld(chunk.getWorld()))) { return; } - //BentoBox.getInstance().logDebug(e.getEventName()); Pair chunkCoords = new Pair(chunk.getX(), chunk.getZ()); if (pending.containsKey(chunkCoords)) { Iterator it = pending.get(chunkCoords).iterator(); while (it.hasNext()) { StructureRecord item = it.next(); if (item.location().getWorld().equals(e.getWorld())) { - //BentoBox.getInstance().logDebug("Placing structure in itemsToBuild " + item); + // Placing structure in itemsToBuild this.itemsToBuild.add(item); it.remove(); } @@ -247,8 +241,6 @@ public class NewAreaListener implements Listener { ToBePlacedStructures tbd = new ToBePlacedStructures(); tbd.setReadyToBuild(pending); toPlace.saveObjectAsync(tbd); - } else { - //BentoBox.getInstance().logDebug("Nothing to build in this chunk"); } } @@ -394,7 +386,7 @@ public class NewAreaListener implements Listener { int y = Integer.parseInt(coords[1].strip()); int z = Integer.parseInt(coords[2].strip()) + center.getBlockZ(); Location location = new Location(world, x, y, z); - //BentoBox.getInstance().logDebug("Structure " + name + " will be placed at " + location); + // Structure will be placed at location readyToBuild.computeIfAbsent(new Pair<>(x >> 4, z >> 4), k -> new ArrayList<>()) .add(new StructureRecord(name, "minecraft:" + name, location, rotation, mirror, noMobs)); this.itemsToBuild @@ -411,8 +403,6 @@ public class NewAreaListener implements Listener { return list1; })); - //BentoBox.getInstance().logDebug("mergedMap size = " + mergedMap.size()); - //BentoBox.getInstance().logDebug("readyToBuild size = " + readyToBuild.size()); // Save the list tbd.setReadyToBuild(mergedMap); toPlace.saveObjectAsync(tbd); @@ -520,7 +510,6 @@ public class NewAreaListener implements Listener { spawnMob(b, bjb); } } catch (Exception e) { - BentoBox.getInstance().logDebug("We have an error"); e.printStackTrace(); } } @@ -553,17 +542,12 @@ public class NewAreaListener implements Listener { } else if (bjb.getPool().contains("villagers")) { type = EntityType.VILLAGER; } - // if (type == null) { - // BentoBox.getInstance().logDebug(bjb.getPool()); - // } // Spawn it if (type != null) { Entity e = b.getWorld().spawnEntity(b.getRelative(BlockFace.UP).getLocation(), type); if (e != null) { e.setPersistent(true); } - // BentoBox.getInstance().logDebug("Spawned a " + type + " at " + - // b.getRelative(BlockFace.UP).getLocation()); } } @@ -650,12 +634,10 @@ public class NewAreaListener implements Listener { private ToBePlacedStructures loadToDos() { if (!toPlace.objectExists(TODO)) { - //BentoBox.getInstance().logDebug("No TODO list"); return new ToBePlacedStructures(); } ToBePlacedStructures list = toPlace.loadObject(TODO); if (list == null) { - //BentoBox.getInstance().logDebug("TODO list is null"); return new ToBePlacedStructures(); } if (!list.getReadyToBuild().isEmpty()) { diff --git a/src/main/java/world/bentobox/boxed/nms/AbstractMetaData.java b/src/main/java/world/bentobox/boxed/nms/AbstractMetaData.java index 5657ff9..81906cb 100644 --- a/src/main/java/world/bentobox/boxed/nms/AbstractMetaData.java +++ b/src/main/java/world/bentobox/boxed/nms/AbstractMetaData.java @@ -15,13 +15,6 @@ public abstract class AbstractMetaData { public abstract String nmsData(Block block); protected String getData(TileEntity te, String method, String field) { - /* - for (Method m : te.getClass().getMethods()) { - BentoBox.getInstance().logDebug(m.getName() + " returns " + m.getReturnType() + " and has these parameters " - + m.getParameterTypes()); - } - te.getUpdateTag(); - */ try { // Check if the method 'j' exists Method updatePacketMethod = te.getClass().getDeclaredMethod(method);