Correct a bug that would lead to IllegalStateException in plugins.
This was caused by the fact that "requireInputBuffer" used findLegacy(int) to get the correct PacketType, instead of findLegacy(int, Sender.CLIENT). The latter is justified by the fact that only client-side packets require an input buffer.
Dieser Commit ist enthalten in:
Ursprung
d415bd7643
Commit
818ac5cbde
@ -591,7 +591,7 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requireInputBuffer(int packetId) {
|
public boolean requireInputBuffer(int packetId) {
|
||||||
return inputBufferedPackets.contains(PacketType.findLegacy(packetId));
|
return inputBufferedPackets.contains(PacketType.findLegacy(packetId, Sender.CLIENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -361,7 +361,8 @@ class ProxyPacketInjector implements PacketInjector {
|
|||||||
|
|
||||||
// Remove every packet handler
|
// Remove every packet handler
|
||||||
for (Integer id : previous.keySet().toArray(new Integer[0])) {
|
for (Integer id : previous.keySet().toArray(new Integer[0])) {
|
||||||
removePacketHandler(PacketType.findLegacy(id));
|
removePacketHandler(PacketType.findLegacy(id, Sender.CLIENT));
|
||||||
|
removePacketHandler(PacketType.findLegacy(id, Sender.SERVER));
|
||||||
}
|
}
|
||||||
|
|
||||||
overwritten.clear();
|
overwritten.clear();
|
||||||
|
@ -697,8 +697,10 @@ class ProxyPlayerInjectionHandler implements PlayerInjectionHandler {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// These are illegal
|
// These are illegal
|
||||||
for (int packetID : result.getPackets())
|
for (int packetID : result.getPackets()) {
|
||||||
removePacketHandler(PacketType.findLegacy(packetID));
|
removePacketHandler(PacketType.findLegacy(packetID, Sender.CLIENT));
|
||||||
|
removePacketHandler(PacketType.findLegacy(packetID, Sender.SERVER));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren