Fix connection

This commit is contained in:
TheMode 2021-05-25 13:20:44 +02:00
parent 042311d5e3
commit b31f76615a
2 changed files with 4 additions and 6 deletions

View File

@ -274,7 +274,7 @@ class BlockImpl implements Block {
state.get("pushReaction").getAsString(),
state.get("blocksMotion").getAsBoolean(),
state.get("isFlammable").getAsBoolean(),
state.get("air").getAsBoolean(),
state.get("isAir").getAsBoolean(),
state.get("isLiquid").getAsBoolean(),
state.get("isReplaceable").getAsBoolean(),
state.get("isSolid").getAsBoolean(),

View File

@ -25,9 +25,8 @@ class BlockRegistry {
public static synchronized @Nullable Block fromStateId(short stateId) {
Block.Supplier supplier = stateSet.get(stateId);
if(supplier == null){
System.out.println("state "+stateId);
return Block.STONE;
if (supplier == null) {
return null;
}
return supplier.get(stateId);
}
@ -39,8 +38,7 @@ class BlockRegistry {
public static synchronized void register(@NotNull NamespaceID namespaceID, @NotNull Block block,
@NotNull IntRange range, @NotNull Block.Supplier blockSupplier) {
namespaceMap.put(namespaceID, block);
IntStream.range(range.getMinimum(), range.getMaximum()).forEach(value -> stateSet.put((short) value, blockSupplier));
IntStream.range(range.getMinimum(), range.getMaximum() + 1).forEach(value -> stateSet.put((short) value, blockSupplier));
blockSet.put(block.getBlockId(), block);
}
}