Some logging operations to check for tps loss.

This commit is contained in:
MattBDev 2019-12-15 13:08:02 -05:00
parent 478c761750
commit 9fd29b264e
3 changed files with 10 additions and 6 deletions

View File

@ -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) { @Override public Location getSpawn(@NonNull final String world) {
final org.bukkit.Location temp = getWorld(world).getSpawnLocation(); final org.bukkit.Location temp = getWorld(world).getSpawnLocation();
return new Location(world, temp.getBlockX(), temp.getBlockY(), temp.getBlockZ(), return new Location(world, temp.getBlockX(), temp.getBlockY(), temp.getBlockZ(),

View File

@ -1,5 +1,8 @@
package com.github.intellectualsites.plotsquared.plot.object; 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.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.config.Configuration; 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.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
import java.util.concurrent.TimeUnit;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -946,10 +950,16 @@ public class Plot {
ChunkManager.chunkTask(pos1, pos2, new RunnableVal<int[]>() { ChunkManager.chunkTask(pos1, pos2, new RunnableVal<int[]>() {
@Override public void run(int[] value) { @Override public void run(int[] value) {
BlockVector2 loc = BlockVector2.at(value[0], value[1]); BlockVector2 loc = BlockVector2.at(value[0], value[1]);
long start = System.currentTimeMillis();
ChunkManager.manager.loadChunk(getWorldName(), loc, false); 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], MainUtil.setBiome(getWorldName(), value[2], value[3], value[4], value[5],
biome); biome);
start = System.currentTimeMillis();
ChunkManager.manager.unloadChunk(getWorldName(), loc, true); ChunkManager.manager.unloadChunk(getWorldName(), loc, true);
end = System.currentTimeMillis();
PlotSquared.debug("[Biome Operation] Unloading chunk took: " + TimeUnit.MILLISECONDS.toSeconds(end - start));
} }
}, this, 5); }, this, 5);

View File

@ -41,8 +41,6 @@ public abstract class WorldUtil {
public abstract Location getSpawn(String world); public abstract Location getSpawn(String world);
public abstract Location getSpawn(PlotPlayer pp);
public abstract void setSpawn(Location location); public abstract void setSpawn(Location location);
public abstract void saveWorld(String world); public abstract void saveWorld(String world);