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

LevelDB support & other updates #2175

Merged
merged 32 commits into from
Nov 7, 2024
Merged

LevelDB support & other updates #2175

merged 32 commits into from
Nov 7, 2024

Conversation

PetteriM1
Copy link
Member

@PetteriM1 PetteriM1 commented Mar 26, 2024

This PR adds support for LevelDB (version 1.21.30) worlds together with various other stuff from Nukkit PM1E (changelog) including but not limited to:

  • lots of new blocks and items
  • waterlogging
  • increased world height
  • dimension changes
  • nether and the end generator from Cloudburst
  • fixes for overworld generator
  • fixes for lagging and crashing exploits
  • asynchronous chunk and packet sending
  • new movement mechanics
  • new APIs including custom items and entities
  • new version of RakNet library
  • performance improvements

Jenkins downloads: https://ci.opencollab.dev/job/NukkitX/job/Nukkit/job/leveldb/

For server owners:

  • Lots of new blocks, items and game mechanics were added. Test and update your plugins. Make sure land protection etc. plugins are configured to handle new blocks, items and mechanics.

  • World height was increased and void was moved below the new world height bottom limit.

  • Support for MCRegion and legacy LevelDB worlds was removed. New worlds are using LevelDB by default.

  • Timings were removed, use spark instead

  • Some commands had changes in their functionality:

    • All player args require either full player name or a selector
    • Give has a default item count of 1 instead of a stack
    • save-all is now an alias of save while save-off was replaced by save off and save-on by save on
  • Attacking entities now resets sprinting (player.attack-stop-sprint: false to disable)

  • Convert worlds using 'convert' command in console to enable new features. Multiple worlds can be converted at once but don't play on the server while converting.

  • To back up a running server with LevelDB worlds safely, use 'save hold' -> backup -> 'save resume' (Note: This disables unloading of modified chunks which increases memory usage temporarily.)

For plugin developers:

  • Check your plugins for fixed size arrays of block IDs and data values, use Block.MAX_BLOCK_ID and Block.DATA_BITS
  • Due to increased block data bits, full block IDs have changed. Recompile plugins which shift block ID by 4 and use Block.DATA_BITS (6). Or better, don't have your plugin depend on full IDs at all!
  • Notice increased world height (from 0-255 to -64-319, negative y coordinates!)
  • Block hash values changed due to increased world height
  • Notice separation of block and item ID for blocks with ID over 255 (itemId = 255 - blockId, negative item block IDs!)
  • Always use Block.get and Item.get instead of creating new Block and Item instances and do not compare them using 'instanceof'
  • Prefer Block.isBlockTransparentById(id) instead of Block.transparent[id] (same for solid[], light[], etc.)
  • Get and set Block methods now have BlockLayer (NORMAL/WATERLOGGED) as optional argument
  • Timings API was removed
  • Added API for custom items
  • Added API for custom entities
  • Added API for material types and material tags
  • Added API for persistent containers
  • Added entity/blockEntity.canSaveToStorage/setSaveToStorage to allow disabling saving of certain entites/block entities
  • Added level.isSaveOnUnloadEnabled/setSaveOnUnloadEnabled to allow disabling saving of unloaded chunks (remember to also disable auto save)
  • Added level.setLightUpdatesEnabled to allow disabling block light updates on block placement for better performance when light is not used
  • Some protected/internal APIs were removed/changed
  • Use API version 1.1.0 to require latest Nukkit

Contains (at least partially) or should make following pull requests obsolete:
#417, #786, #879, #914 , #1819, #1280, #1493, #1511, #1873, #1908, #1967, #2117, #2197

Contains parts of code from other projects: Cloudburst Server, PowerNukkit

Should resolve following issues:
#2178, #2160, #2036, #2001, #2000, #1885, #1706, #1605, #1604, #1593, #1573, #1563, #1540, #1482, #1456, #1383, #1378, #1367, #1340, #1324, #1320, #1200, #864, #846, #839, #785, #733, #702, #698, #660, #497, #444, #418, #398, #325, #272, #116

Co-author: @Alemiz112

Copy link
Member

@SupremeMortal SupremeMortal left a comment

Choose a reason for hiding this comment

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

Just had a skim over a few of the core classes. This definitely requires bumping the API to 2.0.

gradle/libs.versions.toml Outdated Show resolved Hide resolved
build.gradle.kts Outdated Show resolved Hide resolved
build.gradle.kts Outdated Show resolved Hide resolved
gradle/libs.versions.toml Outdated Show resolved Hide resolved
src/main/java/cn/nukkit/Nukkit.java Outdated Show resolved Hide resolved
src/main/java/cn/nukkit/Player.java Outdated Show resolved Hide resolved
src/main/java/cn/nukkit/Player.java Outdated Show resolved Hide resolved
src/main/java/cn/nukkit/block/BlockBone.java Outdated Show resolved Hide resolved
@PetteriM1
Copy link
Member Author

Just had a skim over a few of the core classes. This definitely requires bumping the API to 2.0.

I my opinion, we shouldn't break all plugins just because a part of the API (which most of them don't even depend on) was changed. You know how many plugin devs are inactive and how much people depend on public plugins. The whole point of releasing this at its current stage is trying to Keep Nukkit alive, avoid having all plugins needed to be rewritten until Nukkit has gained active users and plugin devs again. If we break all plugins, most people are just going to use forks and other software that have already finished their rewrite. If 1.0.20 isn't good, maybe we can do 1.5?

@PetteriM1 PetteriM1 mentioned this pull request May 16, 2024
@PetteriM1 PetteriM1 changed the title Merge Nukkit PM1E (LevelDB support) LevelDB support & other updates May 16, 2024
@PetteriM1 PetteriM1 marked this pull request as ready for review October 3, 2024 15:26
@PetteriM1 PetteriM1 merged commit bfb30cd into master Nov 7, 2024
2 checks passed
@PetteriM1 PetteriM1 deleted the leveldb branch November 7, 2024 18:59
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.

4 participants