3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 13:52:50 +02:00

Read set slot inv id as unsigned byte for consistency

Dieser Commit ist enthalten in:
KennyTV 2021-06-18 16:59:34 +02:00
Ursprung 5cdaabeaec
Commit 48f1300908
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
4 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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