mirror of
https://github.com/YouHaveTrouble/NotJustNameplates.git
synced 2026-05-12 06:26:58 +00:00
add end gateway to portal check
This commit is contained in:
+8
-4
@@ -80,14 +80,18 @@ public class TeamManagementListener implements Listener {
|
|||||||
AABB playerBox = craftPlayer.getHandle().getBoundingBox();
|
AABB playerBox = craftPlayer.getHandle().getBoundingBox();
|
||||||
World world = player.getWorld();
|
World world = player.getWorld();
|
||||||
Location loc1 = new Location(world, playerBox.maxX, playerBox.maxY, playerBox.maxZ);
|
Location loc1 = new Location(world, playerBox.maxX, playerBox.maxY, playerBox.maxZ);
|
||||||
Location loc2 = loc1.clone().subtract(0, 1 , 0);
|
Location loc2 = loc1.clone().subtract(0, 1, 0);
|
||||||
Location loc3 = new Location(world, playerBox.minX, playerBox.minY, playerBox.minZ);
|
Location loc3 = new Location(world, playerBox.minX, playerBox.minY, playerBox.minZ);
|
||||||
Location loc4 = loc3.clone().add(0, 1 , 0);
|
Location loc4 = loc3.clone().add(0, 1, 0);
|
||||||
|
|
||||||
boolean inPortal = false;
|
boolean inPortal = false;
|
||||||
for (Location loc : new Location[] {loc1, loc2, loc3, loc4}) {
|
for (Location loc : new Location[]{loc1, loc2, loc3, loc4}) {
|
||||||
Block block = loc.getBlock();
|
Block block = loc.getBlock();
|
||||||
if (block.getType() == Material.NETHER_PORTAL || block.getType() == Material.END_PORTAL) {
|
if (
|
||||||
|
block.getType() == Material.NETHER_PORTAL
|
||||||
|
|| block.getType() == Material.END_PORTAL
|
||||||
|
|| block.getType() == Material.END_GATEWAY
|
||||||
|
) {
|
||||||
inPortal = true;
|
inPortal = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user