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 entity location when going through end portal #270

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Conversation

benwoo1110
Copy link
Member

According to a minecraft wiki and my testing:

Players who enter the End spawn at coordinates (100, 49, 0), facing west toward the main island;
other entities that enter the End spawn at coordinates (100.5, 50, 0.5), in the middle of and 1 block higher than the platform.

[15:27:56 INFO]: [Multiverse-NetherPortals] Entity Jungle Planks is teleporting from Location{world=CraftWorld{name=world},x=-11.78125,y=70.6005859375,z=10.139892578125,pitch=0.0,yaw=95.308624} to Location{world=CraftWorld{name=world_the_end},x=100.5,y=50.0,z=0.5,pitch=0.0,yaw=90.0}
[15:28:43 INFO]: [Multiverse-NetherPortals] Entity Villager is teleporting from Location{world=CraftWorld{name=world},x=-11.5,y=70.0,z=10.5,pitch=0.0,yaw=165.47754} to Location{world=CraftWorld{name=world_the_end},x=100.5,y=50.0,z=0.5,pitch=0.0,yaw=90.0}

event.setTo(event.getTo());
}
} else if (toWorld.getEnvironment() == World.Environment.THE_END && type == PortalType.ENDER) {
Location spawnLocation = EndPlatformCreator.getVanillaLocation(event.getTo().getWorld());
Location spawnLocation = EndPlatformCreator.getVanillaLocation(player, event.getTo().getWorld());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the main change, just refracted to not keep needing the player getter

Location fromLocation = this.locationManipulation.getBlockLocation(event.getFrom());
Location originalToLocation = this.locationManipulation.getBlockLocation(event.getTo());
Location fromLocation = event.getFrom();
Location originalToLocation = event.getTo();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bcu the location can be decimal like 0.5. There isn't any reason for us to round it.

@benwoo1110 benwoo1110 merged commit 13086f4 into main Sep 12, 2024
2 checks passed
@benwoo1110 benwoo1110 deleted the ben/entity-end branch September 12, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants