Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Java custom armor trims when translating item to Bedrock to prevent visual issues #4548

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Conversation

eclipseisoffline
Copy link
Member

Hello, I've implemented a small fix regarding custom armor trims created using Java datapacks. Armor pieces with custom trims render on Bedrock as though they have a missing model/texture, and additionally, the item looks blank when in inventory.

As far as I know, Bedrock doesn't have the ability to add custom armor trims yet, so my fix was to entirely discard the armor trim NBT tag when translating a Java item to a Bedrock item.

Without fix:
Screenshot_20240404_170829
With fix:
Screenshot_20240404_171221

@Kas-tle
Copy link
Member

Kas-tle commented Apr 4, 2024

Thanks! I think the recent betas introduced some degree of support for custom trims, but happy to add this is a stopgap until we do something with that assuming no one has any objections.

@@ -33,6 +33,7 @@
import org.geysermc.geyser.session.GeyserSession;

public class ArmorItem extends Item {
private static final String MINECRAFT_NAMESPACE = "minecraft:";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use the string inline as that seems to be what we've done in the rest of the codebase.

@onebeastchris
Copy link
Member

onebeastchris commented Apr 4, 2024

Custom trims are already possible, but they would need to be defined via resource packs - but yeah this is a good enough solution for now

@eclipseisoffline
Copy link
Member Author

I have tried to research a bit as to whether or not custom armor trims are a thing on Bedrock but didn't find much - if you've got anything documenting it I'd be interested!

@Kas-tle Kas-tle merged commit 1819ed4 into GeyserMC:master Apr 4, 2024
1 check passed
XingLingQAQ pushed a commit to XingLingQAQ/Geyser that referenced this pull request Sep 25, 2024
…event visual issues (GeyserMC#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants