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

World height is wrong on join #962

Closed
SamB440 opened this issue Aug 22, 2024 · 7 comments · Fixed by #1003
Closed

World height is wrong on join #962

SamB440 opened this issue Aug 22, 2024 · 7 comments · Fixed by #1003
Labels
bug Something isn't working

Comments

@SamB440
Copy link
Contributor

SamB440 commented Aug 22, 2024

Describe the bug
GrimAnticheat/Grim@1238555

User#getTotalWorldHeight seems to return the overworld value on join. Switching dimensions works as expected, it just seems to be on join.

Software brand
Paper 1.21

Plugins
Grim

How To Reproduce
Enter the nether, disconnect, join again, the world height will be wrong

Expected behavior
World height to return the correct values

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@SamB440 SamB440 added the bug Something isn't working label Aug 22, 2024
@SamB440
Copy link
Contributor Author

SamB440 commented Aug 22, 2024

Odd, considering InternalPacketListener listens to these

@booky10
Copy link
Collaborator

booky10 commented Aug 29, 2024

[18:33:42 INFO]: UUID of player booky10 is d20c8b3b-9f9e-48da-94c4-2c614dd76e29
[18:33:42 INFO]: [packetevents] [STDOUT] {JOIN} CHANGED DIMENSION TO minecraft:the_end / TYPE: minecraft:the_end [FROM 0 TO 256]
[18:36:20 INFO]: UUID of player booky10 is d20c8b3b-9f9e-48da-94c4-2c614dd76e29
[18:36:20 INFO]: [packetevents] [STDOUT] {JOIN} CHANGED DIMENSION TO minecraft:the_nether / TYPE: minecraft:the_nether [FROM 0 TO 256]

works for me in both the nether and the end, when adding some log messages and also listening to chunk packets

paper version

This server is running Paper version 1.21.1-52-master@e08e667 (2024-08-26T18:02:06Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.1-26-52ae4ad (MC: 1.21.1)


is there some reproduction step or some grim-specific feature missing?
the listeners priorities shouldn't be an issue, grim tracks the dimension type at priority HIGH, while packetevents sets them at priority LOWEST

@SamB440
Copy link
Contributor Author

SamB440 commented Aug 29, 2024

Have you tried installing the terralith datapack?

@booky10
Copy link
Collaborator

booky10 commented Aug 29, 2024

Installing Terralith doesn't change anything in neither the nether nor the end
The datapack also only modifies the overworld, at least the one I downloaded from here

booky10 added a commit to booky10/packetevents that referenced this issue Aug 30, 2024
Could potentially solve retrooper#962, although I can't reproduce that issue

This may be caused by two different changes to packetevents:
1. We did a little memory optimization so only elements different to the vanilly registry get stored
2. We fixed an issue where some elements would not equal the "same" vanilla element

This could cause every custom element to just never be registered, so we now do explicit deep-equals checks before saving the vanilla element instead
@booky10
Copy link
Collaborator

booky10 commented Aug 30, 2024

See commit description of booky10@c9d42f8 for a possible cause to this issue
This may be reproducible when modifying world height of the overworld, nether or end, but I didn't test this yet

@booky10 booky10 mentioned this issue Aug 30, 2024
22 tasks
@SamB440
Copy link
Contributor Author

SamB440 commented Aug 31, 2024

It seems to still be happening, I should have mentioned also that I used Paper 1.19.4 to test (idk why I put 1.21)

You should see an error like

[15:44:12 WARN]: [ac.grim.grimac.shaded.com.github.retrooper.packetevents.PacketEventsAPI] PacketEvents caught an unhandled exception while calling your listener.
java.lang.IllegalStateException: null
        at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.stream.NetStreamInput.readUnsignedByte(NetStreamInput.java:62) ~[grimac-2.3.67.jar:?]
        at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.stream.NetStreamInput.readUnsignedShort(NetStreamInput.java:75) ~[grimac-2.3.67.jar:?]
        at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.stream.NetStreamInput.readShort(NetStreamInput.java:70) ~[grimac-2.3.67.jar:?]
        at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.world.chunk.impl.v_1_18.Chunk_v1_18.read(Chunk_v1_18.java:50) ~[grimac-2.3.67.jar:?]
        at ac.grim.grimac.shaded.com.github.retrooper.packetevents.protocol.world.chunk.reader.impl.ChunkReader_v1_18.read(ChunkReader_v1_18.java:35) ~[grimac-2.3.67.jar:?]
        at ac.grim.grimac.events.packets.worldreader.PacketWorldReaderEighteen.handleMapChunk(PacketWorldReaderEighteen.java:27) ~[grimac-2.3.67.jar:?]

When logging into the nether due to the world height being wrong

@SamB440
Copy link
Contributor Author

SamB440 commented Sep 4, 2024

Someone reported having world height issues in the nether on 1.21 with this datapack
NWMQXch.zip

booky10 added a commit to booky10/packetevents that referenced this issue Sep 21, 2024
Could potentially solve retrooper#962, although I can't reproduce that issue

This may be caused by two different changes to packetevents:
1. We did a little memory optimization so only elements different to the vanilly registry get stored
2. We fixed an issue where some elements would not equal the "same" vanilla element

This could cause every custom element to just never be registered, so we now do explicit deep-equals checks before saving the vanilla element instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants