From 63888827aa6f47f3d5666a7297d3cb0f8682b941 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Thu, 26 Feb 2015 15:43:01 +1100 Subject: [PATCH] Fixed debugclear --- .../com/intellectualcrafters/plot/util/ChunkManager.java | 5 +++-- .../plot/util/bukkit/BukkitChunkManager.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java index 6e139e6e4..abe0ca771 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ChunkManager.java @@ -7,13 +7,14 @@ import com.intellectualcrafters.plot.object.ChunkLoc; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotId; +import com.intellectualcrafters.plot.object.PlotLoc; import com.intellectualcrafters.plot.object.RegionWrapper; public abstract class ChunkManager { public static ChunkManager manager = null; public static RegionWrapper CURRENT_PLOT_CLEAR = null; - public static HashMap> GENERATE_BLOCKS = new HashMap<>(); - public static HashMap> GENERATE_DATA = new HashMap<>(); + public static HashMap> GENERATE_BLOCKS = new HashMap<>(); + public static HashMap> GENERATE_DATA = new HashMap<>(); public static ChunkLoc getChunkChunk(final Location loc) { final int x = loc.getX() >> 9; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java index 5c556aabf..7c5297c57 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitChunkManager.java @@ -49,6 +49,7 @@ import com.intellectualcrafters.plot.object.ChunkLoc; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotId; +import com.intellectualcrafters.plot.object.PlotLoc; import com.intellectualcrafters.plot.object.RegionWrapper; import com.intellectualcrafters.plot.object.entity.EntityWrapper; import com.intellectualcrafters.plot.util.ChunkManager; @@ -616,7 +617,7 @@ public class BukkitChunkManager extends ChunkManager { public static void saveBlocks(final World world, final int maxY, int x, int z, int offset_x, int offset_z) { final HashMap ids = new HashMap<>(); final HashMap datas = new HashMap<>(); - for (short y = 1; y < maxY; y++) { + for (short y = 0; y < maxY; y++) { final Block block = world.getBlockAt(x, y, z); final short id = (short) block.getTypeId(); if (id != 0) { @@ -741,7 +742,7 @@ public class BukkitChunkManager extends ChunkManager { } } } - final ChunkLoc loc = new ChunkLoc(x, z); + final PlotLoc loc = new PlotLoc((short) x, (short) z); GENERATE_BLOCKS.put(loc, ids); GENERATE_DATA.put(loc, datas); }