mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
replace remaining debug calls
This commit is contained in:
@ -25,7 +25,6 @@
|
||||
*/
|
||||
package com.plotsquared.bukkit.entity;
|
||||
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import org.bukkit.Art;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
@ -55,11 +54,15 @@ import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ReplicatingEntityWrapper.class);
|
||||
|
||||
private final short depth;
|
||||
private final int hash;
|
||||
private final EntityBaseStats base = new EntityBaseStats();
|
||||
@ -331,7 +334,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
return;
|
||||
// END LIVING //
|
||||
default:
|
||||
PlotSquared.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
logger.debug("Could not identify entity: {}", entity.getType());
|
||||
}
|
||||
}
|
||||
|
||||
@ -387,7 +390,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
try {
|
||||
entity.getInventory().setContents(this.inventory);
|
||||
} catch (IllegalArgumentException e) {
|
||||
PlotSquared.debug("&c[WARN] Failed to restore inventory.\n Reason: " + e.getMessage());
|
||||
logger.error("Failed to restore inventory", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -730,7 +733,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
restoreLiving((LivingEntity) entity);
|
||||
return entity;
|
||||
default:
|
||||
PlotSquared.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
logger.debug("Could not identify entity: {}", entity.getType());
|
||||
return entity;
|
||||
// END LIVING
|
||||
}
|
||||
|
@ -51,6 +51,8 @@ import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
@ -60,6 +62,8 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||
@SuppressWarnings("unused")
|
||||
public class ChunkListener implements Listener {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ChunkListener.class);
|
||||
|
||||
private RefMethod methodGetHandleChunk;
|
||||
private RefField mustSave;
|
||||
private Chunk lastChunk;
|
||||
@ -73,9 +77,6 @@ public class ChunkListener implements Listener {
|
||||
this.mustSave = classChunk.getField("mustSave");
|
||||
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle");
|
||||
} catch (Throwable ignored) {
|
||||
PlotSquared.debug(PlotSquared.get().IMP.getPluginName()
|
||||
+ "/Server not compatible for chunk processor trim/gc");
|
||||
|
||||
Settings.Chunk_Processor.AUTO_TRIM = false;
|
||||
}
|
||||
}
|
||||
@ -251,7 +252,6 @@ public class ChunkListener implements Listener {
|
||||
if (!chunk.isLoaded()) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PlotSquared.debug("Successfully processed and unloaded chunk!");
|
||||
chunk.unload(true);
|
||||
return;
|
||||
}
|
||||
@ -259,7 +259,6 @@ public class ChunkListener implements Listener {
|
||||
if (tiles.length == 0) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PlotSquared.debug("Successfully processed and unloaded chunk!");
|
||||
chunk.unload(true);
|
||||
return;
|
||||
}
|
||||
@ -269,7 +268,6 @@ public class ChunkListener implements Listener {
|
||||
if (i >= tiles.length - Settings.Chunk_Processor.MAX_TILES) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PlotSquared.debug("Successfully processed and unloaded chunk!");
|
||||
chunk.unload(true);
|
||||
return;
|
||||
}
|
||||
@ -297,15 +295,11 @@ public class ChunkListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
PlotSquared.debug(
|
||||
"PlotSquared detected unsafe chunk and processed: " + (chunk.getX() << 4) + "," + (
|
||||
chunk.getX() << 4));
|
||||
logger.debug("PlotSquared detected chunk and processed it: {},{}", chunk.getX() << 4, chunk.getZ() << 4);
|
||||
}
|
||||
if (tiles.length > Settings.Chunk_Processor.MAX_TILES) {
|
||||
if (unload) {
|
||||
PlotSquared.debug(
|
||||
"PlotSquared detected unsafe chunk: " + (chunk.getX() << 4) + "," + (
|
||||
chunk.getX() << 4));
|
||||
logger.debug("PlotSquared detected chunk: {},{}", chunk.getX() << 4, chunk.getZ() << 4);
|
||||
cleanChunk(chunk);
|
||||
return true;
|
||||
}
|
||||
|
@ -987,7 +987,8 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
player.sendMessage(spyMessage);
|
||||
}
|
||||
}
|
||||
PlotSquared.debug(full);
|
||||
// TODO: Re-implement
|
||||
// PlotSquared.debug(full);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST) public void blockDestroy(BlockBreakEvent event) {
|
||||
@ -2435,7 +2436,6 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
Player p = event.getPlayer();
|
||||
if (p == null) {
|
||||
PlotSquared.debug("PlotSquared does not support HangingPlaceEvent for non-players.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -27,11 +27,9 @@ package com.plotsquared.bukkit.queue;
|
||||
|
||||
import com.plotsquared.bukkit.schematic.StateWrapper;
|
||||
import com.plotsquared.bukkit.util.BukkitBlockUtil;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.queue.BasicLocalBlockQueue;
|
||||
import com.plotsquared.core.util.BlockUtil;
|
||||
import com.plotsquared.core.util.MainUtil;
|
||||
import com.plotsquared.core.util.task.TaskManager;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -85,8 +83,6 @@ public class BukkitLocalQueue extends BasicLocalBlockQueue {
|
||||
World worldObj = Bukkit.getWorld(getWorld());
|
||||
if (worldObj != null) {
|
||||
worldObj.refreshChunk(x, z);
|
||||
} else {
|
||||
PlotSquared.debug("Error Refreshing Chunk");
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,8 +105,6 @@ public class BukkitLocalQueue extends BasicLocalBlockQueue {
|
||||
world.regenerate(region, editSession);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
PlotSquared.debug("Error Regenerating Chunk");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
package com.plotsquared.bukkit.util;
|
||||
|
||||
import com.plotsquared.bukkit.BukkitMain;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.generator.AugmentedUtils;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.location.PlotLoc;
|
||||
@ -55,6 +54,8 @@ import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
@ -75,6 +76,8 @@ import static com.plotsquared.core.util.entity.EntityCategories.CAP_VEHICLE;
|
||||
|
||||
public class BukkitRegionManager extends RegionManager {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BukkitRegionManager.class);
|
||||
|
||||
public static boolean isIn(CuboidRegion region, int x, int z) {
|
||||
return x >= region.getMinimumPoint().getX() && x <= region.getMaximumPoint().getX()
|
||||
&& z >= region.getMinimumPoint().getZ() && z <= region.getMaximumPoint().getZ();
|
||||
@ -90,7 +93,7 @@ public class BukkitRegionManager extends RegionManager {
|
||||
} else {
|
||||
final Semaphore semaphore = new Semaphore(1);
|
||||
try {
|
||||
PlotSquared.debug("Attempting to make an asynchronous call to getLoadedChunks."
|
||||
logger.debug("Attempting to make an asynchronous call to getLoadedChunks."
|
||||
+ " Will halt the calling thread until completed.");
|
||||
semaphore.acquire();
|
||||
Bukkit.getScheduler().runTask(BukkitMain.getPlugin(BukkitMain.class), () -> {
|
||||
|
@ -468,7 +468,6 @@ public class BukkitUtil extends WorldUtil {
|
||||
block.setType(Material.valueOf("OAK_WALL_SIGN"), false);
|
||||
}
|
||||
if (!(block.getBlockData() instanceof WallSign)) {
|
||||
PlotSquared.debug(block.getBlockData().getAsString());
|
||||
throw new RuntimeException("Something went wrong generating a sign");
|
||||
}
|
||||
final Directional sign = (Directional) block.getBlockData();
|
||||
|
@ -27,7 +27,6 @@ package com.plotsquared.bukkit.util;
|
||||
|
||||
import com.plotsquared.bukkit.entity.EntityWrapper;
|
||||
import com.plotsquared.bukkit.entity.ReplicatingEntityWrapper;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.location.Location;
|
||||
import com.plotsquared.core.location.PlotLoc;
|
||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||
@ -38,6 +37,8 @@ import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -46,6 +47,8 @@ import java.util.Set;
|
||||
|
||||
public class ContentMap {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ContentMap.class);
|
||||
|
||||
final Set<EntityWrapper> entities;
|
||||
final Map<PlotLoc, BaseBlock[]> allBlocks;
|
||||
|
||||
@ -123,8 +126,7 @@ public class ContentMap {
|
||||
try {
|
||||
entity.spawn(world, xOffset, zOffset);
|
||||
} catch (Exception e) {
|
||||
PlotSquared.debug("Failed to restore entity (e): " + e.toString());
|
||||
e.printStackTrace();
|
||||
logger.error("Failed to restore entity", e);
|
||||
}
|
||||
}
|
||||
this.entities.clear();
|
||||
|
Reference in New Issue
Block a user