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

CustomItem with ModelData not working alongside Custom Blocks. #5124

Closed
OmeWillem opened this issue Nov 5, 2024 · 5 comments
Closed

CustomItem with ModelData not working alongside Custom Blocks. #5124

OmeWillem opened this issue Nov 5, 2024 · 5 comments
Labels
Waiting On Response When an issue or PR is waiting on a response from a [specific] person.

Comments

@OmeWillem
Copy link

OmeWillem commented Nov 5, 2024

Describe the bug

I am converting models from Java to Bedrock using the mappings api provided by Geyser but there's a problem.
I am trying to get a block to show on a specific CustomModelData like this:

        CustomItemOptions itemOptions = CustomItemOptions.builder()
                .customModelData(data.getCustomModelData())
                .build();
        CustomItemData itemData = CustomItemData.builder()
                .name(key)
                .icon("_iainternal_icon_cancel")
                .customItemOptions(itemOptions)
                .build();
        DefineCustomItemListener.itemData(itemData, data);

        CustomBlockComponents components = CustomBlockComponents.builder()
                .geometry(GeometryComponent.builder().identifier("geometry.geyser_custom." + key).build())
                .materialInstance("*", MaterialInstance.builder().renderMethod("alpha_test").build())
                .placementFilter(List.of())
                .build();
        CustomBlockData blockData = CustomBlockData.builder()
                .name(key)
                .components(components)
                .build();
        DefineCustomBlockListener.blockData(blockData, data);

This works, but it's very random. Sometimes the whole item gets ignored and seen as AIR, also allowing for dupes because you can then literally overwrite it in chests. And sometimes the item works just fine.
The item always shows in item frames, but nowhere else (unless the item works fine ofcourse).

I've checked the packet listener and it does accurately send them to the client.

To Reproduce

  1. Create mappings for items like shown before.
  2. Create mappings for blocks life shown before.
  3. Restart the server.
  4. Join the server.
  5. Check the items and see if they are visible. (this is completely random, sometimes 1 item works and sometimes the other one does).

To test with accuracy you should test with atleast 25+ models, I am using a 174 models.

Expected behaviour

All items should show like normal.

Screenshots / Videos

gkURpxXfBz.mp4

Server Version and Plugins

Current Purpur Version: 1.21.1-2312-d7a7c91
Current Geyser Version: 2.4.4-Snapshot
Current Floodgate Version: 2.2.3-SNAPSHOT (b113-06f2ed9)
Current Minecraft Java Client version: 1.21
Current Minecraft Bedrock Client version: 1.21.44

Geyser Dump

https://dump.geysermc.org/77nexYY4m4bWhajXq2mkDDjSsNkFErWT

Geyser Version

2.4.4-Snapshot

Minecraft: Bedrock Edition Device/Version

1.21.44, PC / Windows 11

Additional Context

Pack is not required to test, aslong as you make mappings you can use one of the built-in geometries like 'geometry.bee'

@OmeWillem
Copy link
Author

OmeWillem commented Nov 5, 2024

#4326 seems to be the same problem!
#4090 seems to be somewhat related.

@Kas-tle
Copy link
Member

Kas-tle commented Nov 5, 2024

Please provide the java resource pack, converted bedrock resource pack, and either the source of extension you are using to register the mappings, or the mappings file(s).

@OmeWillem
Copy link
Author

Please provide the java resource pack, converted bedrock resource pack, and either the source of extension you are using to register the mappings, or the mappings file(s).

As said, the resource packs actually do not play a role in this bug. What do you mean with source of extension? I'm using a Paper plugin with the Geyser API. The way I register mappings has also been sent before.

@Kas-tle
Copy link
Member

Kas-tle commented Nov 6, 2024

What you have provided is a single snippet of registering a single item and single block. For all predicates including custom model data, the order of registration/mappings matters just as the order of predicate entries in a Java resource pack matters. Therefore, the resource pack, and the full source of the Geyser extension/plugin you are using to register the items are needed. We cannot simply guess as to what you are registering and in what order.

@onebeastchris onebeastchris added the Waiting On Response When an issue or PR is waiting on a response from a [specific] person. label Nov 9, 2024
@OmeWillem
Copy link
Author

Actually got it fixed. Use the NonVanilla version and it'll work fine.

@Kas-tle Kas-tle closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting On Response When an issue or PR is waiting on a response from a [specific] person.
Projects
None yet
Development

No branches or pull requests

3 participants