From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: kickash32 Date: Fri, 15 May 2020 01:10:03 -0400 Subject: [PATCH] Ensure safe gateway teleport diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java index 223550eccdf0a5596b8595a30f02ad891ffd91ea..b7a0d8ffd1823a1d1edee6baaa62c15f69e6af3d 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java @@ -105,7 +105,14 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { List list = world.getEntitiesOfClass(Entity.class, new AABB(pos), TheEndGatewayBlockEntity::canEntityTeleport); if (!list.isEmpty()) { - TheEndGatewayBlockEntity.teleportEntity(world, pos, state, (Entity) list.get(world.random.nextInt(list.size())), blockEntity); + // Paper start + for (Entity entity : list) { + if (entity.canChangeDimensions()) { + TheEndGatewayBlockEntity.teleportEntity(world, pos, state, entity, blockEntity); + break; + } + } + // Paper end } if (blockEntity.age % 2400L == 0L) {