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

Update hardcoded Block Ids in ClientboundBlockEventPacket #729

Merged
merged 1 commit into from
Mar 19, 2023

Conversation

davchoo
Copy link
Member

@davchoo davchoo commented Mar 19, 2023

Needed to resolve GeyserMC/Geyser#3624
Crudely generated with the following code in Geyser.

List<String> blocks = Arrays.asList(BlockRegistries.CLEAN_JAVA_IDENTIFIERS.get());
Object2IntMap<String> ids = new Object2IntLinkedOpenHashMap<>();
ids.put("NOTE_BLOCK", blocks.indexOf("minecraft:note_block"));
ids.put("STICKY_PISTON", blocks.indexOf("minecraft:sticky_piston"));
ids.put("PISTON", blocks.indexOf("minecraft:piston"));
ids.put("MOB_SPAWNER", blocks.indexOf("minecraft:spawner"));
ids.put("CHEST", blocks.indexOf("minecraft:chest"));
ids.put("ENDER_CHEST", blocks.indexOf("minecraft:ender_chest"));
ids.put("TRAPPED_CHEST", blocks.indexOf("minecraft:trapped_chest"));
ids.put("END_GATEWAY", blocks.indexOf("minecraft:end_gateway"));
ids.put("SHULKER_BOX_LOWER", blocks.indexOf("minecraft:shulker_box"));
ids.put("SHULKER_BOX_HIGHER", blocks.indexOf("minecraft:black_shulker_box"));
ids.put("BELL", blocks.indexOf("minecraft:bell"));
ids.forEach((field, id) -> System.out.println("private static final int " + field + " = " + id + ";"));

@Camotoy Camotoy merged commit 24cb5ff into GeyserMC:master Mar 19, 2023
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.

Piston Animation Not Showing
2 participants