mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2024-11-26 03:55:57 +01:00
Added artificial height limit for Nether worlds, to work around CraftBukkit bug which reports a max height of 255 for them, leading to players being teleported on top of the "roof" of the Nether at height 127
This commit is contained in:
parent
79bc2f46c0
commit
28e76340ea
@ -211,7 +211,8 @@ public class BorderData
|
||||
// find closest safe Y position from the starting position
|
||||
private double getSafeY(World world, int X, int Y, int Z)
|
||||
{
|
||||
final int limTop = world.getMaxHeight() - 2;
|
||||
// artificial height limit of 127 added for Nether worlds since CraftBukkit still incorrectly returns 255 for their max height, leading to players sent to the "roof" of the Nether
|
||||
final int limTop = (world.getEnvironment() == World.Environment.NETHER) ? 125 : world.getMaxHeight() - 2;
|
||||
// Expanding Y search method adapted from Acru's code in the Nether plugin
|
||||
|
||||
for(int y1 = Y, y2 = Y; (y1 > limBot) || (y2 < limTop); y1--, y2++){
|
||||
|
Loading…
Reference in New Issue
Block a user