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

Make old worlds have min Y 0 #1396

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft

Make old worlds have min Y 0 #1396

wants to merge 4 commits into from

Conversation

Pablete1234
Copy link
Member

@Pablete1234 Pablete1234 commented Sep 9, 2024

Makes it so old maps on modern servers will have a min y = 0, meaning you can't build under y=0, so it behaves as they used to.

To make this happen a bunch of horrible hacks were employed:

  • Had to copy-in CraftServer#createWorld to allow a dimension that isn't one of the defaults
  • Had to register the custom dimension type via unspeakable means
  • Turned pgm into a paper plugin, to have access to bootstrap-time code
    • This resulted in bytecode remapping no longer applying
      • Had to account InventoryView being an interface instead of a class now
      • Replaced all usages manually with a platform-dependant impl.
  • Had to implement my own support for modifying dimension type, jumping thru alot of hoops, including the use of unsafe

This would've been alot easier of paper supported modifying the dimensionType as part of world creator, and supported dimension type as a modifiable registry.

It can still be cleaned up now that i got it to a stage that works, but i don't think there's a work-around for the use of unsafe to access unmodifiable fields.

Ontop of this all, it seems that if the world is created with a different dimensions some world conversion doesn't run, leaving fences or glass panes unconnected. Opened PaperMC/DataConverter#22 to see if we can get any help for this, in the form of a fix, or a workaround of some sorts

@Pablete1234 Pablete1234 added the bug Something isn't working label Sep 9, 2024
@Pablete1234 Pablete1234 changed the title Make old worlds have min Y 0, WIP. Make old worlds have min Y 0 Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

1 participant