From 994ca12102dde2dd19c7edf3857264583d57f94c Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 11 Aug 2015 22:05:44 +1000 Subject: [PATCH] Sponge fixes --- pom.xml | 2 +- .../com/intellectualcrafters/plot/commands/DebugExec.java | 2 +- .../com/intellectualcrafters/plot/commands/MainCommand.java | 2 +- .../java/com/intellectualcrafters/plot/util/StringMan.java | 2 +- .../com/plotsquared/bukkit/object/entity/EntityWrapper.java | 2 -- .../com/plotsquared/bukkit/util/BukkitChunkManager.java | 1 - .../java/com/plotsquared/bukkit/util/BukkitSetupUtils.java | 1 - .../com/plotsquared/sponge/util/SpongeBlockManager.java | 6 +++++- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index d9e249d62..18ddd747a 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 3.0.11 + 3.0.13 PlotSquared jar diff --git a/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java b/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java index 7bad6d7c5..342579678 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java @@ -95,7 +95,7 @@ public class DebugExec extends SubCommand { TaskManager.runTaskLater(new Runnable() { @Override public void run() { - onCommand(ConsolePlayer.getConsole(), new String[] {"runasync", "start.js"}); + onCommand(ConsolePlayer.getConsole(), new String[] {"run", "start.js"}); } }, 1); } diff --git a/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index 6907358ab..3577401dc 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -337,7 +337,7 @@ public class MainCommand extends CommandManager { MainUtil.sendMessage(plr, C.NOT_VALID_SUBCOMMAND); { List> cmds = getCommands(null, plr); - if (label == null || (cmd = new StringComparison<>(label, cmds).getMatchObject()) == null) { + if (label == null || cmds.size() == 0 || (cmd = new StringComparison<>(label, cmds).getMatchObject()) == null) { MainUtil.sendMessage(plr, C.DID_YOU_MEAN, "/plot help"); } else { diff --git a/src/main/java/com/intellectualcrafters/plot/util/StringMan.java b/src/main/java/com/intellectualcrafters/plot/util/StringMan.java index fd1bda24a..5e2d9116b 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/StringMan.java +++ b/src/main/java/com/intellectualcrafters/plot/util/StringMan.java @@ -50,7 +50,7 @@ public class StringMan { else if (obj instanceof Collection) { String result = ""; String prefix = ""; - for (Object element : (List) obj) { + for (Object element : (Collection) obj) { result += prefix + getString(element); prefix = ","; } diff --git a/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java b/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java index 413f02f4d..b6a259824 100644 --- a/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java +++ b/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java @@ -178,8 +178,6 @@ public class EntityWrapper { this.x = loc.getX(); this.y = loc.getY(); this.z = loc.getZ(); - System.out.print("ENTITY: " + entity.getType()); - System.out.print("ENTITY: " + entity.getType().getTypeId()); this.id = entity.getType().getTypeId(); if (depth == 0) { return; diff --git a/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java b/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java index f25cfae5d..2451224ac 100644 --- a/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java +++ b/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java @@ -494,7 +494,6 @@ public class BukkitChunkManager extends ChunkManager { public static void restoreEntities(final World world, final int x_offset, final int z_offset) { for (final EntityWrapper entity : entities) { try { - System.out.print("RESTORING ENTITIE!: " + EntityType.fromId(entity.id)); entity.spawn(world, x_offset, z_offset); } catch (final Exception e) { PS.debug("Failed to restore entity (e): " + entity.x + "," + entity.y + "," + entity.z + " : " + entity.id + " : " + EntityType.fromId(entity.id)); diff --git a/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java b/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java index 7690c0210..ac52e40e0 100644 --- a/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java +++ b/src/main/java/com/plotsquared/bukkit/util/BukkitSetupUtils.java @@ -103,7 +103,6 @@ public class BukkitSetupUtils extends SetupUtils { return; } File file = new File("bukkit.yml").getAbsoluteFile(); - System.out.print(file.getAbsolutePath()); YamlConfiguration yml = YamlConfiguration.loadConfiguration(file); yml.set("worlds." + world + ".generator", generator); try { diff --git a/src/main/java/com/plotsquared/sponge/util/SpongeBlockManager.java b/src/main/java/com/plotsquared/sponge/util/SpongeBlockManager.java index dff62fdc6..bfdfe4c87 100644 --- a/src/main/java/com/plotsquared/sponge/util/SpongeBlockManager.java +++ b/src/main/java/com/plotsquared/sponge/util/SpongeBlockManager.java @@ -131,7 +131,11 @@ public class SpongeBlockManager extends BlockManager { @Override public Location getSpawn(String world) { - return SpongeUtil.getLocation(world, SpongeUtil.getWorld(world).getSpawnLocation()); + World worldObj = SpongeUtil.getWorld(world); + org.spongepowered.api.world.Location loc = worldObj.getSpawnLocation(); + Location result = SpongeUtil.getLocation(world, SpongeUtil.getWorld(world).getSpawnLocation()); + result.setY(getHeighestBlock(world, result.getX(), result.getZ())); + return result; } @Override