Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-16 04:50:10 +01:00
Fix body set equipment in 1.20.5->.3 if value is not the last (#886)
Dieser Commit ist enthalten in:
Ursprung
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.viabackwards.protocol.v1_20_2to1_20.provider.AdvancementCriteriaProvider;
|
||||||
import com.viaversion.viaversion.api.Via;
|
import com.viaversion.viaversion.api.Via;
|
||||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
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.data.entity.EntityTracker;
|
||||||
import com.viaversion.viaversion.api.minecraft.ChunkPosition;
|
import com.viaversion.viaversion.api.minecraft.ChunkPosition;
|
||||||
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
|
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
|
||||||
|
@ -77,9 +77,12 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
|||||||
do {
|
do {
|
||||||
slot = wrapper.read(Types.BYTE);
|
slot = wrapper.read(Types.BYTE);
|
||||||
final Item item = protocol.getItemRewriter().handleItemToClient(wrapper.user(), wrapper.read(Types1_20_5.ITEM));
|
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)) {
|
if (type != null && type.isOrHasParent(EntityTypes1_20_5.LLAMA)) {
|
||||||
// Cancel equipment and set correct entity data instead
|
// Cancel equipment and set correct entity data instead
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
@ -89,7 +92,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
|||||||
|
|
||||||
wrapper.write(Types.BYTE, slot);
|
wrapper.write(Types.BYTE, slot);
|
||||||
wrapper.write(Types.ITEM1_20_2, item);
|
wrapper.write(Types.ITEM1_20_2, item);
|
||||||
} while (slot < 0);
|
} while ((slot & 0xFFFFFF80) != 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
protocol.registerClientbound(ClientboundPackets1_20_5.HORSE_SCREEN_OPEN, wrapper -> {
|
protocol.registerClientbound(ClientboundPackets1_20_5.HORSE_SCREEN_OPEN, wrapper -> {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren