3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Merge pull request #1768 from Gerrygames/abstraction

Handle new window type in 1.16
Dieser Commit ist enthalten in:
Myles 2020-05-08 08:32:33 +01:00 committet von GitHub
Commit 045c35243f
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -21,7 +21,24 @@ public class InventoryPackets {
public static void register(Protocol protocol) { public static void register(Protocol protocol) {
ItemRewriter itemRewriter = new ItemRewriter(protocol, InventoryPackets::toClient, InventoryPackets::toServer); ItemRewriter itemRewriter = new ItemRewriter(protocol, InventoryPackets::toClient, InventoryPackets::toServer);
//Window Property // Open Window
protocol.registerOutgoing(State.PLAY, 0x2F, 0x2F, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
map(Type.VAR_INT);
map(Type.STRING);
handler(wrapper -> {
int windowType = wrapper.get(Type.VAR_INT, 1);
if (windowType >= 20) { // smithing added with id 20
wrapper.set(Type.VAR_INT, 1, ++windowType);
}
});
}
});
// Window Property
protocol.registerOutgoing(State.PLAY, 0x16, 0x16, new PacketRemapper() { protocol.registerOutgoing(State.PLAY, 0x16, 0x16, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {