Added method to register special blocks to correct registries
This commit is contained in:
parent
42d9f7f887
commit
d63aa5b92e
1 changed files with 21 additions and 0 deletions
|
@ -44,4 +44,25 @@ public class BaseBlockEntities {
|
||||||
public static Block[] getFurnaces() {
|
public static Block[] getFurnaces() {
|
||||||
return BaseRegistry.getRegisteredBlocks().values().stream().filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseFurnaceBlock).map(item -> ((BlockItem) item).getBlock()).toArray(Block[]::new);
|
return BaseRegistry.getRegisteredBlocks().values().stream().filter(item -> item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BaseFurnaceBlock).map(item -> ((BlockItem) item).getBlock()).toArray(Block[]::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean registerSpecialBlock(Block block) {
|
||||||
|
if (block instanceof BaseChestBlock) {
|
||||||
|
BaseBlockEntities.CHEST.registerBlock(block);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (block instanceof BaseSignBlock) {
|
||||||
|
BaseBlockEntities.SIGN.registerBlock(block);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (block instanceof BaseBarrelBlock) {
|
||||||
|
BaseBlockEntities.BARREL.registerBlock(block);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (block instanceof BaseFurnaceBlock) {
|
||||||
|
BaseBlockEntities.FURNACE.registerBlock(block);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue