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 return portal position calculation for dragon respawn #346

Open
wants to merge 2 commits into
base: 1.20.3
Choose a base branch
from

Conversation

OpenBagTwo
Copy link

@OpenBagTwo OpenBagTwo commented Feb 5, 2024

Fixes #327 by explicitly flooring removing the (now)-unnecessary translations applied to the X and Z coordinates of this.portalLocation

Validation Performed

  • Successfully respawned the dragon in an existing BetterX world (that I think was originally created in Minecraft 1.18)
  • Successfully respawned the dragon in a brand new BetterX world created in Minecraft 1.20.4 with BCLib 3.30.1 and a build of this branch of BetterEnd

In both cases, the log message read:

Assuming portal is centered at (0.0, 0.0, 0.0)

though, so if there are scenarios where the portal could be elsewhere, I haven't confirmed that to be working.

Also note that I'm only checking from y=0 to y=255 (rather than -255 to 255) because I don't think there's any scenario in which the portal will generate at a negative y level (if I'm wrong, feel free to change back!)


Stepping back, I realize that this actually could have been a two-line change to just remove the +/- 1 from

new Vec3(central.getX() - 1, central.getY() - 255, central.getZ() + 1),
new Vec3(central.getX() - 1, central.getY() + 255, central.getZ() + 1)

so feel free to just do that instead and close this PR.

@OpenBagTwo
Copy link
Author

Looks like this is fixed on 1.21, but I would still highly recommend you merge this into the 1.20.3 branch.

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.

[Bug] resummoning ender dragon doesnt work
1 participant