ProtocolLib

3M Downloads

1.16 - WrapperPlayServerLogin and WrapperPlayServerRespawn setLevelType error

gamerover98 opened this issue ยท 0 comments

commented

Describe the bug

ProtocolLib version: dev-build 482 for spigot 1.16
It works with ProtocolLib for 1.8 until 1.15.2

When you try to set the level type for PlayServerLogin and PlayServerRespawn (wrapper classes) it doesn't work and it throws an error. The console logs: https://pastebin.com/ywVhfxEE

My source to reproduce the bug: https://github.com/gamerover98/NoBlackSky/blob/master/src/main/java/it/gamerover/nbs/packet/NoBlackSkyAdapter.java

The error is thrown at line 62 and 67 (setLevelType() method)

To Reproduce

  1. Setup a 1.16 spigot/paper server
  2. Create a plugin, write a PacketAdapter class, handle WrapperPlayServerLogin or WrapperPlayServerRespawn packet classes and sets the level type as WorldType.FLAT.
  3. Join into the server (change world or suicide)
  4. See console for the error

Expected behaviour
The player will see the world type as FLAT to fix black sky under height 61.

Version Info
https://pastebin.com/nHYaa0HC