From 1819ed4dbdb328f559ed87361f5f7326028ed94e Mon Sep 17 00:00:00 2001 From: Eclipse <116838833+eclipseisoffline@users.noreply.github.com> Date: Thu, 4 Apr 2024 18:55:00 +0000 Subject: [PATCH] Remove Java custom armor trims when translating item to Bedrock to prevent visual issues (#4548) * Fix (or workaround) armor items with custom armor trims having no texture on bedrock * Fix armor items with custom trims causing issues on entity models by removing the Trim tag entirely * Refer to minecraft namespace inline for consistency --- .../java/org/geysermc/geyser/item/type/ArmorItem.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/item/type/ArmorItem.java b/core/src/main/java/org/geysermc/geyser/item/type/ArmorItem.java index 38144f318..b58f760d1 100644 --- a/core/src/main/java/org/geysermc/geyser/item/type/ArmorItem.java +++ b/core/src/main/java/org/geysermc/geyser/item/type/ArmorItem.java @@ -47,6 +47,14 @@ public class ArmorItem extends Item { if (tag.get("Trim") instanceof CompoundTag trim) { StringTag material = trim.remove("material"); StringTag pattern = trim.remove("pattern"); + + // discard custom trim patterns/materials to prevent visual glitches on bedrock + if (!material.getValue().startsWith("minecraft:") + || !pattern.getValue().startsWith("minecraft:")) { + tag.remove("Trim"); + return; + } + // bedrock has an uppercase first letter key, and the value is not namespaced trim.put(new StringTag("Material", stripNamespace(material.getValue()))); trim.put(new StringTag("Pattern", stripNamespace(pattern.getValue())));