Read set slot inv id as unsigned byte for consistency

This commit is contained in:
KennyTV 2021-06-18 16:59:34 +02:00
parent 5cdaabeaec
commit 48f1300908
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
4 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ public class InventoryPackets {
protocol.registerClientbound(ClientboundPackets1_13.SET_SLOT, new PacketRemapper() { protocol.registerClientbound(ClientboundPackets1_13.SET_SLOT, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
map(Type.SHORT); // 1 - Slot ID map(Type.SHORT); // 1 - Slot ID
map(Type.FLAT_ITEM, Type.FLAT_VAR_INT_ITEM); // 2 - Slot Value map(Type.FLAT_ITEM, Type.FLAT_VAR_INT_ITEM); // 2 - Slot Value
} }

View File

@ -61,7 +61,7 @@ public class InventoryPackets extends ItemRewriter<Protocol1_13To1_12_2> {
protocol.registerClientbound(ClientboundPackets1_12_1.SET_SLOT, new PacketRemapper() { protocol.registerClientbound(ClientboundPackets1_12_1.SET_SLOT, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
map(Type.SHORT); // 1 - Slot ID map(Type.SHORT); // 1 - Slot ID
map(Type.ITEM, Type.FLAT_ITEM); // 2 - Slot Value map(Type.ITEM, Type.FLAT_ITEM); // 2 - Slot Value

View File

@ -106,7 +106,7 @@ public class InventoryPackets {
protocol.registerClientbound(ClientboundPackets1_8.SET_SLOT, new PacketRemapper() { protocol.registerClientbound(ClientboundPackets1_8.SET_SLOT, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
map(Type.SHORT); // 1 - Slot ID map(Type.SHORT); // 1 - Slot ID
map(Type.ITEM); // 2 - Slot Value map(Type.ITEM); // 2 - Slot Value
handler(new PacketHandler() { handler(new PacketHandler() {
@ -123,7 +123,7 @@ public class InventoryPackets {
EntityTracker1_9 entityTracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); EntityTracker1_9 entityTracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class);
short slotID = wrapper.get(Type.SHORT, 0); short slotID = wrapper.get(Type.SHORT, 0);
short windowId = wrapper.get(Type.BYTE, 0); short windowId = wrapper.get(Type.UNSIGNED_BYTE, 0);
// Store item in slot // Store item in slot
inventoryTracker.setItemId(windowId, slotID, stack == null ? 0 : stack.identifier()); inventoryTracker.setItemId(windowId, slotID, stack == null ? 0 : stack.identifier());

View File

@ -70,7 +70,7 @@ public abstract class ItemRewriter<T extends Protocol> extends RewriterBase<T> i
protocol.registerClientbound(packetType, new PacketRemapper() { protocol.registerClientbound(packetType, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
map(Type.SHORT); // 1 - Slot ID map(Type.SHORT); // 1 - Slot ID
map(type); // 2 - Slot Value map(type); // 2 - Slot Value