mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-08-17 17:15:47 +00:00
max/min y pushed to location verification
This commit is contained in:
parent
7c46c8c31f
commit
91ef3ff3c8
@ -96,28 +96,26 @@ public class RTPPlayer {
|
|||||||
b = world.getBlockAt(x, b.getY() - 1, z);
|
b = world.getBlockAt(x, b.getY() - 1, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//System.out.println(b.getType().name());
|
//Between max and min y
|
||||||
if (b.getY() > pWorld.getMinY() && !badBlock(b.getType().name(), x, z, pWorld.getWorld(), pWorld.getBiomes())) {
|
if ( b.getY() >= pWorld.getMinY()
|
||||||
|
&& b.getY() <= pWorld.getMaxY()
|
||||||
|
&& !badBlock(b.getType().name(), x, z, pWorld.getWorld(), pWorld.getBiomes())) {
|
||||||
return new Location(world, (x + 0.5), b.getY() + 1, (z + 0.5), yaw, pitch);
|
return new Location(world, (x + 0.5), b.getY() + 1, (z + 0.5), yaw, pitch);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Location getLocAtNether(int x, int z, World world, Float yaw, Float pitch, WorldPlayer pWorld) {
|
private Location getLocAtNether(int x, int z, World world, Float yaw, Float pitch, WorldPlayer pWorld) {
|
||||||
//System.out.println("-----------");
|
//Max and Min Y
|
||||||
for (int y = 1; y < world.getMaxHeight(); y++) {
|
for (int y = pWorld.getMinY() + 1; y < pWorld.getMaxY()/*world.getMaxHeight()*/; y++) {
|
||||||
// System.out.println("--");
|
|
||||||
Block block_current = world.getBlockAt(x, y, z);
|
Block block_current = world.getBlockAt(x, y, z);
|
||||||
//System.out.println(block_current.getType().name());
|
|
||||||
if (block_current.getType().name().endsWith("AIR") || !block_current.getType().isSolid()) {
|
if (block_current.getType().name().endsWith("AIR") || !block_current.getType().isSolid()) {
|
||||||
//System.out.println(block_current.getType().name());
|
|
||||||
if (!block_current.getType().name().endsWith("AIR") &&
|
if (!block_current.getType().name().endsWith("AIR") &&
|
||||||
!block_current.getType().isSolid()) { //Block is not a solid (ex: lava, water...)
|
!block_current.getType().isSolid()) { //Block is not a solid (ex: lava, water...)
|
||||||
String block_in = block_current.getType().name();
|
String block_in = block_current.getType().name();
|
||||||
if (badBlock(block_in, x, z, pWorld.getWorld(), null))
|
if (badBlock(block_in, x, z, pWorld.getWorld(), null))
|
||||||
continue;//return null;
|
continue;
|
||||||
}
|
}
|
||||||
//System.out.println(block_current.getType().name());
|
|
||||||
String block = world.getBlockAt(x, y - 1, z).getType().name();
|
String block = world.getBlockAt(x, y - 1, z).getType().name();
|
||||||
if (block.endsWith("AIR")) //Block below is air, skip
|
if (block.endsWith("AIR")) //Block below is air, skip
|
||||||
continue;
|
continue;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
Enabled: false #enable the locations feature
|
Enabled: false #enable the locations feature
|
||||||
RequirePermission: false #Require players to have `betterrtp.location.<world_name>`
|
RequirePermission: false #Require players to have `betterrtp.location.<world_name>`
|
||||||
UseLocationIfAvailable: true #Will choose a location upon `/rtp` if location(s) is available in the world
|
UseLocationIfAvailable: true #Will choose a location upon `/rtp` if location(s) is available in the world
|
||||||
#OnlyAllowInWorld: true #Only allow players to use locations that correspond to the world they are standing in
|
#OnlyAllowInWorld: true #Only allow players to use locations that correspond to the world they are standing in #coming soon
|
||||||
|
|
||||||
Locations:
|
Locations:
|
||||||
- main_loc:
|
- main_loc:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user