1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-06 15:41:50 +00:00

Use the right javaId when registering non-vanilla block states (#5553)

This commit is contained in:
Eclipse
2025-05-17 15:59:40 +00:00
committed by GitHub
parent f616230c52
commit d0be6d9c48

View File

@@ -306,11 +306,15 @@ public class Block {
private List<BlockState> build(Block block) {
if (states.isEmpty()) {
BlockState state;
if (javaId == null) {
javaId = BlockRegistries.BLOCK_STATES.get().size();
state = new BlockState(block, BlockRegistries.BLOCK_STATES.get().size());
BlockRegistries.BLOCK_STATES.get().add(state);
} else {
state = new BlockState(block, javaId);
BlockRegistries.BLOCK_STATES.registerWithAnyIndex(javaId, state, Blocks.AIR.defaultBlockState());
}
BlockState state = new BlockState(block, javaId);
BlockRegistries.BLOCK_STATES.get().add(state);
return List.of(state);
} else if (states.size() == 1) {
// We can optimize because we don't need to worry about combinations