-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
1.20.6 - EnumWrappers.PlayerDigType null #2917
Comments
Doing some tests, this code works fine: Class clazz = PacketType.Play.Client.BLOCK_DIG.getPacketClass();
int index = 1;
if (clazz == null) {
// not supported in the current version
return null;
}
List<Field> enumFields = FuzzyReflection.fromClass(clazz, true).getFieldListByType(Enum.class);
if (enumFields.size() <= index) {
// also probably not supported
ProtocolLogger.debug("Enum field not found at index {0} of {1}", index, clazz);
return null;
}
Class digTypeClazz = enumFields.get(index).getType();
StructureModifier modifier = e.getPacket().structureModifier.withType(digTypeClazz, new EnumWrappers.AliasedEnumConverter(digTypeClazz, EnumWrappers.PlayerDigType.class));
modifier.read(0); I got it by checking the ProtocoLib repository: So the Enum field is correctly found by the ProtocolLib code, but |
Attaching a debugger, pausing the execution and running this code will fix the issue (dirty fix just to test). EnumWrappers.PLAYER_DIG_TYPE_CLASS = EnumWrappers.getEnum(com.comphenix.protocol.PacketType.Play.Client.BLOCK_DIG.getPacketClass(), 1); So for some reason something is resetting the |
It's probably due to "Failed to find NMS class: world.entity.player.EnumChatVisibility" error which makes the whole initialize method fail and skip the initializations. |
This code returns null.
This is the registered packet listener:
The text was updated successfully, but these errors were encountered: