Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Stop portals in The End generating end gateway strucutres when used #222

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

thatfulvioguy
Copy link
Contributor

@thatfulvioguy thatfulvioguy commented Nov 11, 2023

If an entity touches an end gateway block in The End (or a world like it) which has no exit location set, the game will generate a new end gateway structure at the same angle relative to and 1024 or so blocks away from the origin (i.e. around the inner edge of the outer islands). Using a vane portal in an End world therefore creates a tower of gateways that grows each time the portal is used. This happens before Paper/Bukkit Entity/PlayerTeleportEndGatewayEvents are fired, so the existing cancelling of them doesn't prevent this. All the relevant logic is in net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity.teleportEntity.

Setting an exit location for end gateway blocks in vane portals is enough to prevent this behaviour. Any location will do (I picked the portal's spawn since it was handy, and means at least one fewer allocation), since the teleport events being cancelled will prevent anything going there anyway.

If an entity touches an end gateway block in The End (or a world like it) which
has no exit location set, the game will generate a new end gateway structure at
the same angle relative to and 1024 or so blocks away from the origin (i.e.
around the inner edge of the outer islands). Using a vane portal in an End world
therefore creates a tower of gateways that grows each time the portal is used.
This happens before Entity/PlayerTeleportEndGatewayEvents are fired, so the
existing cancelling of them doesn't prevent this.

Setting an exit location for end gateway blocks in vane portals is enough to
prevent this behaviour. Any location will do, since the teleport events being
cancelled will prevent anything going there anyway.
@thatfulvioguy thatfulvioguy changed the title Fix portals in The End generating end gateway strucutres when used fix: stop portals in The End generating end gateway strucutres when used Nov 11, 2023
@thatfulvioguy thatfulvioguy changed the title fix: stop portals in The End generating end gateway strucutres when used fix: Stop portals in The End generating end gateway strucutres when used Nov 11, 2023
@oddlama
Copy link
Owner

oddlama commented Nov 13, 2023

Thanks!

I recall not doing this because I was having problems with players being randomly teleported to the specified coordinates when we initially built this feature, but I can't reproduce this right now. This was a long time ago though and gateways were pretty new, so quite possibly that was a bug in paper back then.

I guess I'll just merge this and just see if there's going to be any trouble. Thanks again :)

@oddlama oddlama merged commit 1b174d0 into oddlama:develop Nov 13, 2023
1 of 12 checks passed
@thatfulvioguy thatfulvioguy deleted the fix-end-gateway-stacks branch November 13, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants