From 9c90928d0779d281275ff76dbd2e315da2269e42 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 2 Feb 2019 16:13:55 +0000 Subject: [PATCH] Remove the debug and don't created a new BloxkBucket for every air block. --- .../plotsquared/bukkit/util/BukkitHybridUtils.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java index 68b845e58..452d04c35 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java @@ -66,6 +66,7 @@ public class BukkitHybridUtils extends HybridUtils { System.gc(); final BlockBucket[][][] oldBlocks = new BlockBucket[256][width][length]; final PlotBlock[][][] newBlocks = new PlotBlock[256][width][length]; + final BlockBucket airBucket = BlockBucket.withSingle(StringPlotBlock.EVERYTHING); PlotArea area = PlotSquared.get().getPlotArea(world, null); @@ -146,8 +147,8 @@ public class BukkitHybridUtils extends HybridUtils { continue; } int y = MainUtil.y_loc[i][j]; - oldBlocks[y][x][z] = - BlockBucket.withSingle(StringPlotBlock.EVERYTHING); + oldBlocks[y][x][z] = airBucket; + } continue; } @@ -163,7 +164,7 @@ public class BukkitHybridUtils extends HybridUtils { int y = MainUtil.y_loc[i][j]; oldBlocks[y][x][z] = result[i][j] != null ? result[i][j] : - BlockBucket.withSingle(StringPlotBlock.EVERYTHING); + airBucket; } } @@ -183,7 +184,7 @@ public class BukkitHybridUtils extends HybridUtils { BlockBucket old = oldBlocks[y][x][z]; try { if (old == null) { - old = BlockBucket.withSingle(StringPlotBlock.EVERYTHING); + old = airBucket; } PlotBlock now = newBlocks[y][x][z]; if (!old.getBlocks().contains(now)) { @@ -228,10 +229,6 @@ public class BukkitHybridUtils extends HybridUtils { types.add(now); } } catch (NullPointerException e) { - PlotSquared.log(old != null ? old.toString() : "old null"); - PlotSquared.log(x); - PlotSquared.log(y); - PlotSquared.log(z); e.printStackTrace(); } }