diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java index 8a13f13ff..2ea1385d1 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java @@ -43,6 +43,7 @@ import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.titles.AbstractTitle; import com.intellectualcrafters.plot.titles.DefaultTitle; import com.intellectualcrafters.plot.util.AChunkManager; +import com.intellectualcrafters.plot.util.AbstractSetBlock; import com.intellectualcrafters.plot.util.BlockManager; import com.intellectualcrafters.plot.util.ConsoleColors; import com.intellectualcrafters.plot.util.MainUtil; @@ -294,6 +295,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain { SetBlockManager.setBlockManager = new SetBlockSlow(); } } + AbstractSetBlock.setBlockManager = SetBlockManager.setBlockManager; try { new SendChunk(); MainUtil.canSendChunk = true; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java index 6eef44f93..b95c5aeb0 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java @@ -10,7 +10,6 @@ import com.intellectualcrafters.plot.util.AChunkManager; import com.intellectualcrafters.plot.util.BlockManager; import com.intellectualcrafters.plot.util.SetupUtils; import com.intellectualcrafters.plot.util.TaskManager; -import com.intellectualcrafters.plot.util.bukkit.ChunkManager; import com.intellectualcrafters.plot.uuid.UUIDWrapper; public interface IPlotMain { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index 0b36253f9..19e63bdec 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -54,9 +54,9 @@ import com.intellectualcrafters.plot.util.BlockManager; import com.intellectualcrafters.plot.util.ClusterManager; import com.intellectualcrafters.plot.util.ExpireManager; import com.intellectualcrafters.plot.util.Logger; -import com.intellectualcrafters.plot.util.SetupUtils; import com.intellectualcrafters.plot.util.Logger.LogLevel; import com.intellectualcrafters.plot.util.MainUtil; +import com.intellectualcrafters.plot.util.SetupUtils; import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; import com.sk89q.worldedit.bukkit.WorldEditPlugin; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java index b0e9649a6..de209a6a6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Setup.java @@ -22,6 +22,7 @@ package com.intellectualcrafters.plot.commands; import java.util.Arrays; import java.util.List; + import org.apache.commons.lang.StringUtils; import com.intellectualcrafters.plot.config.C; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index a02289100..fb565466b 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -85,7 +85,6 @@ import org.bukkit.event.world.WorldInitEvent; import org.bukkit.generator.ChunkGenerator; import com.intellectualcrafters.plot.PlotSquared; -import com.intellectualcrafters.plot.commands.Setup; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.database.DBFunc; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/AbstractSetBlock.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/AbstractSetBlock.java index 0f7eb9f1f..21a181532 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/AbstractSetBlock.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/AbstractSetBlock.java @@ -3,11 +3,10 @@ package com.intellectualcrafters.plot.util; import java.util.List; import com.intellectualcrafters.plot.object.ChunkLoc; +import com.intellectualcrafters.plot.util.bukkit.SetBlockManager; public abstract class AbstractSetBlock { - public static AbstractSetBlock setBlockManager = null; + public static SetBlockManager setBlockManager = null; - public abstract boolean set(final org.bukkit.World world, final int x, final int y, final int z, final int blockId, final byte data); - - public abstract void update(String world, List chunks); + public abstract void update(String worldname, List chunkLocs); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java index 500cc2a88..904c106a7 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/BlockManager.java @@ -2,7 +2,6 @@ package com.intellectualcrafters.plot.util; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.PlotBlock; -import com.intellectualcrafters.plot.util.bukkit.BukkitUtil; public abstract class BlockManager { public static BlockManager manager; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetupUtils.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetupUtils.java index 06456b903..b40347e3e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetupUtils.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/SetupUtils.java @@ -5,7 +5,6 @@ import java.util.Map; import com.intellectualcrafters.plot.object.PlotGenerator; import com.intellectualcrafters.plot.object.SetupObject; -import com.intellectualcrafters.plot.util.bukkit.BukkitSetupUtils; public abstract class SetupUtils { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockManager.java index 209b9a59b..10bff0953 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockManager.java @@ -1,13 +1,28 @@ package com.intellectualcrafters.plot.util.bukkit; +import java.util.ArrayList; import java.util.List; import org.bukkit.Chunk; +import org.bukkit.World; -public abstract class SetBlockManager { +import com.intellectualcrafters.plot.object.ChunkLoc; +import com.intellectualcrafters.plot.util.AbstractSetBlock; + +public abstract class SetBlockManager extends AbstractSetBlock { public static SetBlockManager setBlockManager = null; public abstract void set(final org.bukkit.World world, final int x, final int y, final int z, final int blockId, final byte data); public abstract void update(List list); + + @Override + public void update(String worldname, List chunkLocs) { + World world = BukkitUtil.getWorld(worldname); + ArrayList chunks = new ArrayList(); + for (ChunkLoc loc : chunkLocs) { + chunks.add(world.getChunkAt(loc.x, loc.z)); + } + setBlockManager.update(chunks); + } }