diff --git a/src/com/wimbli/WorldBorder/BorderCheckTask.java b/src/com/wimbli/WorldBorder/BorderCheckTask.java index 34cd5df..7529768 100644 --- a/src/com/wimbli/WorldBorder/BorderCheckTask.java +++ b/src/com/wimbli/WorldBorder/BorderCheckTask.java @@ -10,7 +10,7 @@ import org.bukkit.World; public class BorderCheckTask implements Runnable { - Server server = null; + private transient Server server = null; public BorderCheckTask(Server theServer) { @@ -57,7 +57,7 @@ public class BorderCheckTask implements Runnable ride.teleport(newLoc); } else - { // when riding a pig, player.getVehicle() returns null; so, we unfortunately need to eject player in this rare case + { // when riding a pig, player.getVehicle() returns null on older Bukkit releases; in that case an eject is required players[i].leaveVehicle(); players[i].teleport(newLoc); } diff --git a/src/com/wimbli/WorldBorder/BorderData.java b/src/com/wimbli/WorldBorder/BorderData.java index a146d53..ddbab4b 100644 --- a/src/com/wimbli/WorldBorder/BorderData.java +++ b/src/com/wimbli/WorldBorder/BorderData.java @@ -178,23 +178,23 @@ public class BorderData } //these material IDs are acceptable for places to teleport player; breathable blocks and water - private static LinkedHashSet acceptableBlocks = new LinkedHashSet(Arrays.asList( - new Integer[] {0, 6, 8, 9, 37, 38, 39, 40, 50, 55, 59, 63, 64, 65, 66, 68, 69, 70, 71, 72, 75, 76, 77, 78, 83, 93, 94} + private static LinkedHashSet safeOpenBlocks = new LinkedHashSet(Arrays.asList( + new Integer[] {0, 6, 8, 9, 27, 28, 31, 32, 37, 38, 39, 40, 50, 55, 59, 63, 64, 65, 66, 68, 69, 70, 71, 72, 75, 76, 77, 78, 83, 90, 93, 94} )); - //these material IDs are ones we don't want to drop the player onto, like cactus or lava + //these material IDs are ones we don't want to drop the player onto, like cactus or lava or fire private static LinkedHashSet painfulBlocks = new LinkedHashSet(Arrays.asList( - new Integer[] {10, 11, 81} + new Integer[] {10, 11, 51, 81} )); // check if a particular spot consists of 2 breathable blocks over something relatively solid private boolean isSafeSpot(World world, int X, int Y, int Z) { Integer below = (Integer)world.getBlockTypeIdAt(X, Y - 1, Z); - return (acceptableBlocks.contains((Integer)world.getBlockTypeIdAt(X, Y, Z)) // target block breathable, or is water - && acceptableBlocks.contains((Integer)world.getBlockTypeIdAt(X, Y + 1, Z)) // above target block breathable, or is water - && (!acceptableBlocks.contains(below) || below == 8 || below == 9) // below target block not breathable (probably solid), or is water - && !painfulBlocks.contains(below) // below target block not something painful + return (safeOpenBlocks.contains((Integer)world.getBlockTypeIdAt(X, Y, Z)) // target block open and safe + && safeOpenBlocks.contains((Integer)world.getBlockTypeIdAt(X, Y + 1, Z)) // above target block open and safe + && (!safeOpenBlocks.contains(below) || below == 8 || below == 9) // below target block not open and safe (probably solid), or is water + && !painfulBlocks.contains(below) // below target block not painful ); } diff --git a/src/com/wimbli/WorldBorder/Config.java b/src/com/wimbli/WorldBorder/Config.java index 834c5f1..da25f0b 100644 --- a/src/com/wimbli/WorldBorder/Config.java +++ b/src/com/wimbli/WorldBorder/Config.java @@ -201,9 +201,6 @@ public class Config if (test != null) { - if (!test.isEnabled()) { - plugin.getServer().getPluginManager().enablePlugin(test); - } GroupPlugin = (GroupManager) test; LogConfig("Will use plugin for permissions: "+((GroupManager)test).getDescription().getFullName()); return;