Merge branch 'refs/heads/dev' into preview

This commit is contained in:
Nassim Jahnke 2024-06-15 16:11:26 +02:00
commit 547041cb62
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
2 changed files with 13 additions and 2 deletions

View File

@ -72,7 +72,7 @@ public class BlockItemPacketRewriter1_13 extends BackwardsItemRewriter<Clientbou
private final String extraNbtTag;
public BlockItemPacketRewriter1_13(Protocol1_13To1_12_2 protocol) {
super(protocol, Types.ITEM1_13, null, Types.ITEM1_8, null);
super(protocol, Types.ITEM1_13, Types.ITEM1_13_SHORT_ARRAY, Types.ITEM1_8, Types.ITEM1_8_SHORT_ARRAY);
extraNbtTag = nbtTagName("2");
}

View File

@ -18,6 +18,7 @@
package com.viaversion.viabackwards.protocol.v1_20_2to1_20.rewriter;
import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.nbt.tag.IntArrayTag;
import com.viaversion.nbt.tag.StringTag;
import com.viaversion.nbt.tag.Tag;
import com.viaversion.viabackwards.api.rewriters.BackwardsItemRewriter;
@ -378,6 +379,11 @@ public final class BlockItemPacketRewriter1_20_2 extends BackwardsItemRewriter<C
}
if (item.tag() != null) {
com.viaversion.viaversion.protocols.v1_20to1_20_2.rewriter.BlockItemPacketRewriter1_20_2.to1_20_1Effects(item);
final CompoundTag skullOwnerTag = item.tag().getCompoundTag("SkullOwner");
if (skullOwnerTag != null && !skullOwnerTag.contains("Id") && skullOwnerTag.contains("Properties")) {
skullOwnerTag.put("Id", new IntArrayTag(new int[]{0, 0, 0, 0}));
}
}
return super.handleItemToClient(connection, item);
@ -411,6 +417,11 @@ public final class BlockItemPacketRewriter1_20_2 extends BackwardsItemRewriter<C
final String effectKey = Key.stripMinecraftNamespace(((StringTag) secondaryEffect).getValue());
tag.putInt("Secondary", PotionEffects1_20_2.keyToId(effectKey) + 1); // Empty effect at 0
}
final CompoundTag skullOwnerTag = tag.getCompoundTag("SkullOwner");
if (skullOwnerTag != null && !skullOwnerTag.contains("Id") && skullOwnerTag.contains("Properties")) {
skullOwnerTag.put("Id", new IntArrayTag(new int[]{0, 0, 0, 0}));
}
return tag;
}
}