Added snow to the breathable blocks list, so you're not teleported 1 block above snow; slightly improved the efficiency of the function which finds a safe spot to teleport escapees back inside the border; 1.2.2 release

This commit is contained in:
Brettflan 2011-06-10 17:14:24 -05:00
parent 331d5bae59
commit 302bc28d93
2 changed files with 7 additions and 7 deletions

View File

@ -179,7 +179,7 @@ public class BorderData
//these material IDs are acceptable for places to teleport player; breathable blocks and water
private static LinkedHashSet<Integer> acceptableBlocks = new LinkedHashSet<Integer>(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, 83, 93, 94}
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}
));
//these material IDs are ones we don't want to drop the player onto, like cactus or lava
@ -190,11 +190,11 @@ public class BorderData
// 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.getBlockAt(X, Y - 1, Z).getTypeId();
return (acceptableBlocks.contains((Integer)world.getBlockAt(X, Y, Z).getTypeId()) // target block breathable, or is water
&& acceptableBlocks.contains((Integer)world.getBlockAt(X, Y + 1, Z).getTypeId()) // 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
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
);
}

View File

@ -1,7 +1,7 @@
name: WorldBorder
author: Brettflan
description: Efficient, feature-rich plugin for limiting the size of your worlds.
version: 1.2.1
version: 1.2.2
main: com.wimbli.WorldBorder.WorldBorder
commands:
wborder: