--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -32,11 +_,11 @@
     private static final int ATTENTION_INTERVAL = 2400;
     private static final int EVENT_COOLDOWN = 1;
     private static final int GATEWAY_HEIGHT_ABOVE_SURFACE = 10;
-    private long age;
+    public long age;
     private int teleportCooldown;
     @Nullable
-    private BlockPos exitPortal;
-    private boolean exactTeleport;
+    public BlockPos exitPortal;
+    public boolean exactTeleport;
 
     public TheEndGatewayBlockEntity(BlockPos pos, BlockState blockState) {
         super(BlockEntityType.END_GATEWAY, pos, blockState);
@@ -131,7 +_,7 @@
 
     @Nullable
     public Vec3 getPortalPosition(ServerLevel level, BlockPos pos) {
-        if (this.exitPortal == null && level.dimension() == Level.END) {
+        if (this.exitPortal == null && level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.END) { // CraftBukkit - work in alternate worlds
             BlockPos blockPos = findOrCreateValidTeleportPos(level, pos);
             blockPos = blockPos.above(10);
             LOGGER.debug("Creating portal at {}", blockPos);
