3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-24 23:30:17 +01:00

Uncache state ids on inventory close

Dieser Commit ist enthalten in:
KennyTV 2021-06-18 17:26:32 +02:00
Ursprung d62165bf51
Commit edf9ccca8b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -41,6 +41,15 @@ public final class Protocol1_17To1_17_1 extends BackwardsProtocol<ClientboundPac
@Override
protected void registerPackets() {
registerClientbound(ClientboundPackets1_17.CLOSE_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
short containerId = wrapper.passthrough(Type.UNSIGNED_BYTE);
wrapper.user().get(InventoryStateIds.class).removeStateId(containerId);
});
}
});
registerClientbound(ClientboundPackets1_17.SET_SLOT, new PacketRemapper() {
@Override
public void registerMap() {
@ -68,6 +77,15 @@ public final class Protocol1_17To1_17_1 extends BackwardsProtocol<ClientboundPac
}
});
registerServerbound(ServerboundPackets1_17.CLOSE_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
short containerId = wrapper.passthrough(Type.UNSIGNED_BYTE);
wrapper.user().get(InventoryStateIds.class).removeStateId(containerId);
});
}
});
registerServerbound(ServerboundPackets1_17.CLICK_WINDOW, new PacketRemapper() {
@Override
public void registerMap() {