CaffeineMC / hydrogen-fabric

Things of which are too dangerous to put in Lithium.
GNU Lesser General Public License v3.0
511 stars 66 forks source link

Updates for 1.18.x #60

Open MeeniMc opened 2 years ago

MeeniMc commented 2 years ago

Update Hydrogen for 1.18.x

The game loads a world and I could play for several hours without a hitch (singleplayer survival, some scicraft machines, etc); I have used it on my own server for several weeks, all lights are green.

What has been done and what needs double checks:

  1. mixin ChunkSerializer::private static void loadEntities(ServerWorld world, NbtCompound nbt, WorldChunk chunk) does not exist anymore, need to have Jelly validate that this optimization is now indeed unecessary. The idea of the optimization is to make sure we don't keep around Lambdas with plenty of NBT data in them, a similar idea appears to have been implemented in Minecraft, see ChunkSerializer::getEntityLoadingCallback. The whole mixin has been removed in 920301c. (safe to git revert)

  2. mixin WorldChunk::init optimization of sectionArray (formerly sections) has changed significantly in MC. I updated the code (6cfa544578), but the assumption that WorldChunk will create an air block for missing sections does not hold anymore: multiple places do sectionArray[i].empty() without first testing for null. I am afraid that this is hard to repair without rewriting a lot of WorldChunk as there is no clear way to mixin into the uses of sectionArray. The whole mixin has been removed in b3c72f07. (safe to git revert)

  3. Someone with better Java skills need to validate what I did with the ImmutableMap.

  4. No bugs have been found by normal playing. Maybe requires some rigorous targeted testing.

MeeniMc commented 2 years ago

Ready for review when you have time @jellysquid3

the-potatocouch commented 2 years ago

@MeeniMc do you have a build for 1.18?

MeeniMc commented 2 years ago

The github actions have built one right here. Look into the action tab. Remember that this is not official or supported.

Boobies commented 2 years ago

Have there been any issues found with the PR or did no one have the time to review it yet? Asking so I know whether it's safe to use.

srnyx commented 2 years ago

Have there been any issues found with the PR or did no one have the time to review it yet? Asking so I know whether it's safe to use.

I've been using it and it's fine for me