mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-29 18:07:40 +01:00
Fix player head in 1.20.2->1.20 (#786)
This commit is contained in:
parent
eceda8ac58
commit
b7af3b7d8e
@ -18,6 +18,7 @@
|
|||||||
package com.viaversion.viabackwards.protocol.v1_20_2to1_20.rewriter;
|
package com.viaversion.viabackwards.protocol.v1_20_2to1_20.rewriter;
|
||||||
|
|
||||||
import com.viaversion.nbt.tag.CompoundTag;
|
import com.viaversion.nbt.tag.CompoundTag;
|
||||||
|
import com.viaversion.nbt.tag.IntArrayTag;
|
||||||
import com.viaversion.nbt.tag.StringTag;
|
import com.viaversion.nbt.tag.StringTag;
|
||||||
import com.viaversion.nbt.tag.Tag;
|
import com.viaversion.nbt.tag.Tag;
|
||||||
import com.viaversion.viabackwards.api.rewriters.BackwardsItemRewriter;
|
import com.viaversion.viabackwards.api.rewriters.BackwardsItemRewriter;
|
||||||
@ -378,6 +379,11 @@ public final class BlockItemPacketRewriter1_20_2 extends BackwardsItemRewriter<C
|
|||||||
}
|
}
|
||||||
if (item.tag() != null) {
|
if (item.tag() != null) {
|
||||||
com.viaversion.viaversion.protocols.v1_20to1_20_2.rewriter.BlockItemPacketRewriter1_20_2.to1_20_1Effects(item);
|
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);
|
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());
|
final String effectKey = Key.stripMinecraftNamespace(((StringTag) secondaryEffect).getValue());
|
||||||
tag.putInt("Secondary", PotionEffects1_20_2.keyToId(effectKey) + 1); // Empty effect at 0
|
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;
|
return tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user