Merge pull request #1122 from Gerrygames/1.14

fix book signing and opening in 18w50a
This commit is contained in:
Myles 2018-12-15 20:16:30 +00:00 committed by GitHub
commit 3a4aed0b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -85,6 +85,11 @@ public class InventoryPackets {
wrapper.passthrough(Type.INT); // Number of tools uses wrapper.passthrough(Type.INT); // Number of tools uses
wrapper.passthrough(Type.INT); // Maximum number of trade uses wrapper.passthrough(Type.INT); // Maximum number of trade uses
} }
} else if (channel.equals("minecraft:book_open") || channel.equals("book_open")) {
int hand = wrapper.read(Type.VAR_INT);
wrapper.clearPacket();
wrapper.setId(0x2C);
wrapper.write(Type.VAR_INT, hand);
} }
} }
}); });

View File

@ -28,6 +28,19 @@ public class PlayerPackets {
} }
}); });
// Edit Book
protocol.registerIncoming(State.PLAY, 0x0B, 0x0B, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
InventoryPackets.toServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM));
}
});
}
});
// Player Digging // Player Digging
protocol.registerIncoming(State.PLAY, 0x18, 0x18, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x18, 0x18, new PacketRemapper() {
@Override @Override