Skip to content

Commit

Permalink
Removal of all debug from plugin due to LOGGER causing lag
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul19988 committed Jan 14, 2021
1 parent 787d46e commit 82d4a8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void save(IProgressUpdate progressUpdate, boolean forceSave, boolean flag
try {
slimeWorld.getLoader().unlockWorld(slimeWorld.getName());
} catch (IOException ex) {
LOGGER.error("Failed to unlock the world " + slimeWorld.getName() + ". Please unlock it manually by using the command /swm manualunlock. Stack trace:");
// LOGGER.error("Failed to unlock the world " + slimeWorld.getName() + ". Please unlock it manually by using the command /swm manualunlock. Stack trace:");

ex.printStackTrace();
} catch (UnknownWorldException ignored) {
Expand All @@ -106,11 +106,11 @@ public void save(IProgressUpdate progressUpdate, boolean forceSave, boolean flag
private void save() {
synchronized (saveLock) { // Don't want to save the SlimeWorld from multiple threads simultaneously
try {
LOGGER.info("Saving world " + slimeWorld.getName() + "...");
// LOGGER.info("Saving world " + slimeWorld.getName() + "...");
long start = System.currentTimeMillis();
byte[] serializedWorld = slimeWorld.serialize();
slimeWorld.getLoader().saveWorld(slimeWorld.getName(), serializedWorld, false);
LOGGER.info("World " + slimeWorld.getName() + " saved in " + (System.currentTimeMillis() - start) + "ms.");
// LOGGER.info("World " + slimeWorld.getName() + " saved in " + (System.currentTimeMillis() - start) + "ms.");
} catch (IOException ex) {
ex.printStackTrace();
}
Expand Down Expand Up @@ -157,7 +157,7 @@ private Chunk createChunk(SlimeChunk chunk) {
int x = chunk.getX();
int z = chunk.getZ();

LOGGER.debug("Loading chunk (" + x + ", " + z + ") on world " + slimeWorld.getName());
// LOGGER.debug("Loading chunk (" + x + ", " + z + ") on world " + slimeWorld.getName());

ChunkCoordIntPair pos = new ChunkCoordIntPair(x, z);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class v1_16_R3SlimeNMS implements SlimeNMS {
try {
path = Files.createTempDirectory("swm-" + UUID.randomUUID().toString().substring(0, 5) + "-");
} catch (IOException ex) {
LOGGER.log(Level.FATAL, "Failed to create temp directory", ex);
// LOGGER.log(Level.FATAL, "Failed to create temp directory", ex);
path = null;
System.exit(1);
}
Expand All @@ -59,7 +59,7 @@ public class v1_16_R3SlimeNMS implements SlimeNMS {
try {
FileUtils.deleteDirectory(UNIVERSE_DIR);
} catch (IOException ex) {
LOGGER.log(Level.FATAL, "Failed to delete temp directory", ex);
// LOGGER.log(Level.FATAL, "Failed to delete temp directory", ex);
}

}));
Expand All @@ -78,7 +78,7 @@ public v1_16_R3SlimeNMS(boolean isPaper) {
isPaperMC = isPaper;
CraftCLSMBridge.initialize(this);
} catch (NoClassDefFoundError ex) {
LOGGER.error("Failed to find ClassModifier classes. Are you sure you installed it correctly?");
// LOGGER.error("Failed to find ClassModifier classes. Are you sure you installed it correctly?");
System.exit(1); // No ClassModifier, no party
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ private CustomWorldServer createDefaultWorld(SlimeWorld world, ResourceKey<World
World.Environment environment = getEnvironment(world);

if (dimensionKey == WorldDimension.OVERWORLD && environment != World.Environment.NORMAL) {
LOGGER.warn("The environment for the default world should always be 'NORMAL'.");
// LOGGER.warn("The environment for the default world should always be 'NORMAL'.");
}

try {
Expand Down Expand Up @@ -181,7 +181,7 @@ public void generateWorld(SlimeWorld world) {
}
}

LOGGER.info("Loading world " + worldName);
// LOGGER.info("Loading world " + worldName);
long startTime = System.currentTimeMillis();

server.setReady(true);
Expand Down Expand Up @@ -234,7 +234,7 @@ public void generateWorld(SlimeWorld world) {

Bukkit.getPluginManager().callEvent(new WorldLoadEvent(server.getWorld()));

LOGGER.info("World " + worldName + " loaded in " + (System.currentTimeMillis() - startTime) + "ms.");
// LOGGER.info("World " + worldName + " loaded in " + (System.currentTimeMillis() - startTime) + "ms.");
}

private World.Environment getEnvironment(SlimeWorld world) {
Expand Down

0 comments on commit 82d4a8a

Please sign in to comment.