mirror of
https://github.com/BentoBoxWorld/Boxed.git
synced 2024-12-10 14:33:32 +01:00
Debug clean up
This commit is contained in:
parent
3d411d24ff
commit
1fe87fedff
@ -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<Integer, Integer> chunkCoords = new Pair<Integer, Integer>(chunk.getX(), chunk.getZ());
|
||||
if (pending.containsKey(chunkCoords)) {
|
||||
Iterator<StructureRecord> 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()) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user