diff --git a/pom.xml b/pom.xml index 6065b38f1..ccf04d47b 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 3.1.7 + 3.1.8 PlotSquared jar diff --git a/src/main/java/com/intellectualcrafters/plot/config/Settings.java b/src/main/java/com/intellectualcrafters/plot/config/Settings.java index d252b7fbf..619f03057 100644 --- a/src/main/java/com/intellectualcrafters/plot/config/Settings.java +++ b/src/main/java/com/intellectualcrafters/plot/config/Settings.java @@ -120,7 +120,7 @@ public class Settings { /** * Schematic Save Path */ - public static String SCHEMATIC_SAVE_PATH = "/var/www/schematics"; + public static String SCHEMATIC_SAVE_PATH = "plugins/PlotSquared/schematics"; /** * BO3 Save Path */ diff --git a/src/main/java/com/intellectualcrafters/plot/util/SetBlockQueue.java b/src/main/java/com/intellectualcrafters/plot/util/SetBlockQueue.java index 431abe66e..23a2fa988 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/SetBlockQueue.java +++ b/src/main/java/com/intellectualcrafters/plot/util/SetBlockQueue.java @@ -49,7 +49,7 @@ public class SetBlockQueue { init(); runnables.add(whenDone); } - if (blocks == null || blocks.size() == 0) { + if (blocks == null || blocks.size() == 0 || !blocks.entrySet().iterator().hasNext()) { ArrayDeque tasks = runnables; lastInt = -1; lastBlock = null; @@ -81,7 +81,6 @@ public class SetBlockQueue { @Override public void run() { if (locked) { - System.out.print("LOCKED!"); return; } if (blocks == null || blocks.size() == 0) { @@ -205,7 +204,10 @@ public class SetBlockQueue { result = new PlotBlock[16][]; blocks.put(wrap, result); } - + if ((y > 255) || (y < 0)) { + locked = false; + return; + } if (result[y >> 4] == null) { result[y >> 4] = new PlotBlock[4096]; } @@ -232,6 +234,10 @@ public class SetBlockQueue { result = new PlotBlock[16][]; blocks.put(wrap, result); } + if ((y > 255) || (y < 0)) { + locked = false; + return; + } if (result[y >> 4] == null) { result[y >> 4] = new PlotBlock[4096]; } @@ -258,6 +264,10 @@ public class SetBlockQueue { result = new PlotBlock[16][]; blocks.put(wrap, result); } + if ((y > 255) || (y < 0)) { + locked = false; + return; + } if (result[y >> 4] == null) { result[y >> 4] = new PlotBlock[4096]; } diff --git a/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java b/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java index 9699ba4ec..3a55ec3f1 100644 --- a/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java +++ b/src/main/java/com/plotsquared/bukkit/database/plotme/ClassicPlotMeConnector.java @@ -57,7 +57,15 @@ public class ClassicPlotMeConnector extends APlotMeConnector { final HashMap> merges = new HashMap<>(); stmt = connection.prepareStatement("SELECT * FROM `" + plugin + "Plots`"); r = stmt.executeQuery(); + String column = null; boolean checkUUID = DBFunc.hasColumn(r, "ownerid"); + boolean checkUUID2 = DBFunc.hasColumn(r, "ownerId"); + if (checkUUID) { + column = "ownerid"; + } + else if (checkUUID2) { + column = "ownerId"; + } boolean merge = !plugin.equals("plotme") && Settings.CONVERT_PLOTME; while (r.next()) { final PlotId id = new PlotId(r.getInt("idX"), r.getInt("idZ")); @@ -103,7 +111,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector { else { if (checkUUID){ try { - byte[] bytes = r.getBytes("ownerid"); + byte[] bytes = r.getBytes(column); if (bytes != null) { try { ByteBuffer bb = ByteBuffer.wrap(bytes); diff --git a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEListener.java b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEListener.java index b4919ab5d..42f6990b9 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEListener.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WEListener.java @@ -10,6 +10,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerCommandPreprocessEvent; @@ -26,6 +27,8 @@ import com.plotsquared.bukkit.BukkitMain; import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.SetBlockFast; import com.sk89q.worldedit.BlockVector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.bukkit.selections.Selection; public class WEListener implements Listener { @@ -171,6 +174,11 @@ public class WEListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public boolean onPlayerCommand(final PlayerCommandPreprocessEvent e) { + WorldEditPlugin worldedit = BukkitMain.worldEdit; + if (worldedit == null) { + HandlerList.unregisterAll(this); + return true; + } final Player p = e.getPlayer(); final PlotPlayer pp = BukkitUtil.getPlayer(p); if (!PS.get().isPlotWorld(p.getWorld().getName())) { diff --git a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java index 8316c249c..70db49bee 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java @@ -17,8 +17,10 @@ import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.bukkit.BukkitMain; import com.plotsquared.bukkit.object.BukkitPlayer; import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.EditSession.Stage; import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extension.platform.Actor; @@ -43,6 +45,11 @@ public class WESubscriber { @Subscribe(priority=Priority.VERY_EARLY) public void onEditSession(EditSessionEvent event) { + WorldEditPlugin worldedit = BukkitMain.worldEdit; + if (worldedit == null) { + WorldEdit.getInstance().getEventBus().unregister(this); + return; + } World worldObj = event.getWorld(); String world = worldObj.getName(); Actor actor = event.getActor(); @@ -67,7 +74,7 @@ public class WESubscriber { if (Settings.CHUNK_PROCESSOR) { if (Settings.EXPERIMENTAL_FAST_ASYNC_WORLDEDIT) { try { - LocalSession session = ((BukkitMain) PS.get().IMP).worldEdit.getWorldEdit().getSession(name); + LocalSession session = worldedit.getWorldEdit().getSession(name); boolean hasMask = session.getMask() != null; Player objPlayer = ((BukkitPlayer) player).player; ItemStack item = objPlayer.getItemInHand(); diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index bba74a540..cba999c17 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ diff --git a/target/PlotSquared-Sponge.jar b/target/PlotSquared-Sponge.jar index e63ca81dc..cd610095e 100644 Binary files a/target/PlotSquared-Sponge.jar and b/target/PlotSquared-Sponge.jar differ