From 9fd29b264ee80c2f1032f63ce6311562215b08c1 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Sun, 15 Dec 2019 13:08:02 -0500 Subject: [PATCH] Some logging operations to check for tps loss. --- .../plotsquared/bukkit/util/BukkitUtil.java | 4 ---- .../plotsquared/plot/object/Plot.java | 10 ++++++++++ .../plotsquared/plot/util/WorldUtil.java | 2 -- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java index b4e74b74d..23ed71550 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitUtil.java @@ -317,10 +317,6 @@ import java.util.Set; }); } - @Override public Location getSpawn(@NonNull final PlotPlayer player) { - return getLocation(((BukkitPlayer) player).player.getBedSpawnLocation()); - } - @Override public Location getSpawn(@NonNull final String world) { final org.bukkit.Location temp = getWorld(world).getSpawnLocation(); return new Location(world, temp.getBlockX(), temp.getBlockY(), temp.getBlockZ(), diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 0441c2baa..5308e620a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -1,5 +1,8 @@ package com.github.intellectualsites.plotsquared.plot.object; +import static java.util.concurrent.TimeUnit.SECONDS; + + import com.github.intellectualsites.plotsquared.plot.PlotSquared; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Configuration; @@ -36,6 +39,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockTypes; +import java.util.concurrent.TimeUnit; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -946,10 +950,16 @@ public class Plot { ChunkManager.chunkTask(pos1, pos2, new RunnableVal() { @Override public void run(int[] value) { BlockVector2 loc = BlockVector2.at(value[0], value[1]); + long start = System.currentTimeMillis(); ChunkManager.manager.loadChunk(getWorldName(), loc, false); + long end = System.currentTimeMillis(); + PlotSquared.debug("[Biome Operation] Loading chunk took: " + TimeUnit.MILLISECONDS.toSeconds(end - start)); MainUtil.setBiome(getWorldName(), value[2], value[3], value[4], value[5], biome); + start = System.currentTimeMillis(); ChunkManager.manager.unloadChunk(getWorldName(), loc, true); + end = System.currentTimeMillis(); + PlotSquared.debug("[Biome Operation] Unloading chunk took: " + TimeUnit.MILLISECONDS.toSeconds(end - start)); } }, this, 5); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java index 099b9ea34..f2a37512f 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java @@ -41,8 +41,6 @@ public abstract class WorldUtil { public abstract Location getSpawn(String world); - public abstract Location getSpawn(PlotPlayer pp); - public abstract void setSpawn(Location location); public abstract void saveWorld(String world);