oddlama / vane

Immersive and lore friendly enhancements for vanilla Minecraft
MIT License
250 stars 31 forks source link

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

Closed thatfulvioguy closed 7 months ago

thatfulvioguy commented 7 months ago

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.

oddlama commented 7 months ago

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 :)