mirror of
https://github.com/PryPurity/WorldBorder.git
synced 2024-09-29 04:07:28 +02:00
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:
parent
331d5bae59
commit
302bc28d93
@ -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,9 +190,9 @@ 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
|
||||
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
|
||||
);
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user