Skip to content

Fix return portal position calculation for dragon respawn#346

Open
OpenBagTwo wants to merge 2 commits into
quiqueck:1.20.3from
OpenBagTwo:dragon-respawn-fix
Open

Fix return portal position calculation for dragon respawn#346
OpenBagTwo wants to merge 2 commits into
quiqueck:1.20.3from
OpenBagTwo:dragon-respawn-fix

Conversation

@OpenBagTwo

@OpenBagTwo OpenBagTwo commented Feb 5, 2024

Copy link
Copy Markdown

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
Copy Markdown
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