Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Check the right type
Dieser Commit ist enthalten in:
Ursprung
358267d6e3
Commit
ce219e208c
@ -149,10 +149,11 @@ public class PacketWrapper {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Pair<Type, Object> read = readableObjects.poll();
|
Pair<Type, Object> read = readableObjects.poll();
|
||||||
if (read.getKey().equals(type) || (type.getBaseClass().equals(read.getKey().getBaseClass()) && type.getOutputClass().equals(read.getKey().getOutputClass()))) {
|
Type rtype = read.getKey();
|
||||||
|
if (rtype.equals(type) || (type.getBaseClass().equals(rtype.getBaseClass()) && type.getOutputClass().equals(rtype.getOutputClass()))) {
|
||||||
return (T) read.getValue();
|
return (T) read.getValue();
|
||||||
} else {
|
} else {
|
||||||
if (type == Type.NOTHING) {
|
if (rtype == Type.NOTHING) {
|
||||||
return read(type); // retry
|
return read(type); // retry
|
||||||
} else {
|
} else {
|
||||||
Exception e = new IOException("Unable to read type " + type.getTypeName() + ", found " + read.getKey().getTypeName());
|
Exception e = new IOException("Unable to read type " + type.getTypeName() + ", found " + read.getKey().getTypeName());
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren