mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-24 12:35:43 +01:00
Fix body set equipment in 1.20.5->.3 if value is not the last (#886)
This commit is contained in:
parent
733bd9aa9b
commit
36baf6ed24
@ -26,7 +26,6 @@ import com.viaversion.viabackwards.protocol.v1_20_2to1_20.Protocol1_20_2To1_20;
|
||||
import com.viaversion.viabackwards.protocol.v1_20_2to1_20.provider.AdvancementCriteriaProvider;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.data.ParticleMappings;
|
||||
import com.viaversion.viaversion.api.data.entity.EntityTracker;
|
||||
import com.viaversion.viaversion.api.minecraft.ChunkPosition;
|
||||
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
|
||||
|
@ -77,9 +77,12 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
||||
do {
|
||||
slot = wrapper.read(Types.BYTE);
|
||||
final Item item = protocol.getItemRewriter().handleItemToClient(wrapper.user(), wrapper.read(Types1_20_5.ITEM));
|
||||
final int rawSlot = slot & 0x7F;
|
||||
|
||||
if (rawSlot == 6) {
|
||||
final boolean lastSlot = (slot & 0xFFFFFF80) == 0;
|
||||
slot = (byte) (lastSlot ? 4 : 4 | 0xFFFFFF80); // Map body slot index to chest slot index for horses, also wolves
|
||||
|
||||
if (slot == 6) {
|
||||
slot = 4; // Map body slot index to chest slot index for horses, also wolves
|
||||
if (type != null && type.isOrHasParent(EntityTypes1_20_5.LLAMA)) {
|
||||
// Cancel equipment and set correct entity data instead
|
||||
wrapper.cancel();
|
||||
@ -89,7 +92,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
||||
|
||||
wrapper.write(Types.BYTE, slot);
|
||||
wrapper.write(Types.ITEM1_20_2, item);
|
||||
} while (slot < 0);
|
||||
} while ((slot & 0xFFFFFF80) != 0);
|
||||
});
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_20_5.HORSE_SCREEN_OPEN, wrapper -> {
|
||||
|
Loading…
Reference in New Issue
Block a user