mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 07:15:43 +00:00
Fix "Attempt to get java.util.List field 'PacketOpcodes.BANNED_PACKETS' with illegal data type conversion to int"
This commit is contained in:
parent
c147ebda8f
commit
fffa5a9c47
@ -17,6 +17,7 @@ public class PacketOpcodesUtil {
|
|||||||
Field[] fields = PacketOpcodes.class.getFields();
|
Field[] fields = PacketOpcodes.class.getFields();
|
||||||
|
|
||||||
for (Field f : fields) {
|
for (Field f : fields) {
|
||||||
|
if(f.getType().equals(int.class)) {
|
||||||
try {
|
try {
|
||||||
opcodeMap.put(f.getInt(null), f.getName());
|
opcodeMap.put(f.getInt(null), f.getName());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -24,6 +25,7 @@ public class PacketOpcodesUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String getOpcodeName(int opcode) {
|
public static String getOpcodeName(int opcode) {
|
||||||
if (opcode <= 0) return "UNKNOWN";
|
if (opcode <= 0) return "UNKNOWN";
|
||||||
|
Loading…
Reference in New Issue
Block a user