--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -33,11 +_,11 @@
     private static final int GATEWAY_HEIGHT_ABOVE_SURFACE = 10;
     private static final long DEFAULT_AGE = 0L;
     private static final boolean DEFAULT_EXACT_TELEPORT = false;
-    private long age = 0L;
+    public long age = 0L;
     private int teleportCooldown;
     @Nullable
-    private BlockPos exitPortal;
-    private boolean exactTeleport = false;
+    public BlockPos exitPortal;
+    public boolean exactTeleport = false;
 
     public TheEndGatewayBlockEntity(BlockPos pos, BlockState blockState) {
         super(BlockEntityType.END_GATEWAY, pos, blockState);
@@ -129,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);
