No enum constant PlayerDigType.SWAP_ITEM_WITH_OFFHAND
Th0rgal opened this issue ยท 3 comments
Describe the bug
Some of my users have reported this error in their console.
https://gist.github.com/Th0rgal/014755acf13d11e062e109d52cb46a43
To Reproduce
Unfortunately I don't know how to trigger this error.
Expected behavior
No error. It is likely to be a mistake on my part but I have no idea what caused it.
Screenshots
Not applicable.
Version Info
https://hastebin.com/ahijojusos.properties
Additional context
This is the only place where I play with the BlockDig packet: https://github.com/oraxen/oraxen/blob/master/src/main/java/io/th0rgal/oraxen/utils/breaker/BreakerSystem.java
It is necessary to fix this urgently!, Since MMOCORE uses the Swap mechanic, and many users press SWAP multiple times, so it causes chaos in the console.
here is my /protocol dump: https://gist.github.com/Th0rgal/dd5182c998f1506b689f1c65b4faae86
This seems to be related to:
final StructureModifier<EnumWrappers.PlayerDigType> data = packet
.getEnumModifier(EnumWrappers.PlayerDigType.class, 2);
final EnumWrappers.PlayerDigType type = data.getValues().get(0);
It seems the EnumWrappers uses a .valueOf that doesn't handle the aliase. What do you suggest @dmulloy2 ?