Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-16 04:50:08 +01:00
Fix set equipment body slot in 1.20.3->.5 if value is not the last (#4149)
Dieser Commit ist enthalten in:
Ursprung
ae1838d78a
Commit
050a1dbacb
@ -83,13 +83,16 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
|||||||
byte slot;
|
byte slot;
|
||||||
do {
|
do {
|
||||||
slot = wrapper.read(Types.BYTE);
|
slot = wrapper.read(Types.BYTE);
|
||||||
if (type != null && type.isOrHasParent(EntityTypes1_20_5.ABSTRACT_HORSE) && slot == 4) {
|
|
||||||
slot = 6; // Map chest slot index to body slot index for horses
|
final int rawSlot = slot & 0x7F;
|
||||||
|
if (type != null && type.isOrHasParent(EntityTypes1_20_5.ABSTRACT_HORSE) && rawSlot == 4) {
|
||||||
|
final boolean lastSlot = (slot & 0xFFFFFF80) == 0;
|
||||||
|
slot = (byte) (lastSlot ? 6 : 6 | 0xFFFFFF80); // Map chest slot index to body slot index for horses
|
||||||
}
|
}
|
||||||
wrapper.write(Types.BYTE, slot);
|
wrapper.write(Types.BYTE, slot);
|
||||||
Item item = protocol.getItemRewriter().handleItemToClient(wrapper.user(), wrapper.read(Types.ITEM1_20_2));
|
Item item = protocol.getItemRewriter().handleItemToClient(wrapper.user(), wrapper.read(Types.ITEM1_20_2));
|
||||||
wrapper.write(Types1_20_5.ITEM, item);
|
wrapper.write(Types1_20_5.ITEM, item);
|
||||||
} while (slot < 0);
|
} while ((slot & 0xFFFFFF80) != 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
protocol.registerClientbound(ClientboundConfigurationPackets1_20_3.REGISTRY_DATA, wrapper -> {
|
protocol.registerClientbound(ClientboundConfigurationPackets1_20_3.REGISTRY_DATA, wrapper -> {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren