-
-
Notifications
You must be signed in to change notification settings - Fork 66
Updates for 1.18.x #60
base: 1.17.x
Are you sure you want to change the base?
Conversation
Signed-off-by: MeeniMc <[email protected]>
src/main/java/com/google/common/collect/HydrogenImmutableReferenceHashMap.java
Show resolved
Hide resolved
this.sections[i] = null; | ||
for (int i = 0; i < sectionArray.length; i++) { | ||
if (sectionArray[i].isEmpty()) { | ||
sectionArray[i] = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This optimization is currently not applicable anymore because in WorldChunk we find multiple uses of sectionArray.empty()
without a prior check for null
. It's not immediately clear to me how we could mixin our way into intercepting the individual uses without rewritting the whole class.
f7cf8d4
to
e5c1e8f
Compare
6f51736
to
593eeac
Compare
Mappings are compatible between pre4..rc1 Signed-off-by: MeeniMc <[email protected]>
Signed-off-by: MeeniMc <[email protected]>
Signed-off-by: MeeniMc <[email protected]>
…mmit 0fd8b03) A similar idea has been implemented in Minecraft in ChunkSerializer::getEntityLoadingCallback Signed-off-by: MeeniMc <[email protected]>
Change the way we access protected sectionArray from the mixinWorldChunk Signed-off-by: MeeniMc <[email protected]>
… broken This is done by deleting mixinWorldChunk altogether Signed-off-by: MeeniMc <[email protected]>
Ready for review when you have time @jellysquid3 |
Signed-off-by: MeeniMc <[email protected]>
Signed-off-by: MeeniMc <[email protected]>
@MeeniMc do you have a build for 1.18? |
The github actions have built one right here. Look into the action tab. Remember that this is not official or supported. |
Signed-off-by: MeeniMc <[email protected]>
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 |
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:
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 in920301c. (safe to git revert)
mixin
WorldChunk::init
optimization ofsectionArray
(formerlysections
) has changed significantly in MC. I updated the code (6cfa544), but the assumption thatWorldChunk
will create an air block for missing sections does not hold anymore: multiple places dosectionArray[i].empty()
without first testing fornull
. 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 b3c72f0. (safe to git revert)Someone with better Java skills need to validate what I did with the ImmutableMap.
No bugs have been found by normal playing. Maybe requires some rigorous targeted testing.