Skip to content

Commit

Permalink
Merge pull request #222 from thatfulvioguy/fix-end-gateway-stacks
Browse files Browse the repository at this point in the history
fix: Stop portals in The End generating end gateway strucutres when used
  • Loading branch information
oddlama authored Nov 13, 2023
2 parents 0425840 + 68b05ad commit 1b174d0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ public void update_blocks(final Portals portals) {
final var end_gateway = (EndGateway) portal_block.block().getState(false);
end_gateway.setAge(200l);
end_gateway.update(true, false);

// If there's no exit location then the game will generate a natural gateway when the portal is used.
// Setting any location will do, since the teleports are cancelled via their events anyway.
if (spawn.location().getWorld().getEnvironment() == World.Environment.THE_END){
end_gateway.setExitLocation(spawn.location());
end_gateway.setExactTeleport(true);
}
}
if (portal_block.type() == PortalBlock.Type.CONSOLE) {
portals.update_console_item(this, portal_block.block());
Expand Down

0 comments on commit 1b174d0

Please sign in to comment.