70 lines
2.3 KiB
Java
70 lines
2.3 KiB
Java
package WayofTime.bloodmagic.registry;
|
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
|
import WayofTime.bloodmagic.ConfigHandler;
|
|
import WayofTime.bloodmagic.block.BlockAltar;
|
|
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
|
import WayofTime.bloodmagic.block.BlockRitualController;
|
|
import WayofTime.bloodmagic.item.block.ItemBlockRitualController;
|
|
import WayofTime.bloodmagic.util.helper.InventoryRenderHelper;
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.item.ItemBlock;
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
|
|
|
public class ModBlocks {
|
|
|
|
public static Block altar;
|
|
public static Block ritualStone;
|
|
|
|
public static Block lifeEssence;
|
|
|
|
public static Block crystal;
|
|
public static Block rune;
|
|
public static Block bloodStone;
|
|
|
|
public static void init() {
|
|
FluidRegistry.registerFluid(BlockLifeEssence.getLifeEssence());
|
|
lifeEssence = registerBlock(new BlockLifeEssence());
|
|
|
|
altar = registerBlock(new BlockAltar());
|
|
ritualStone = registerBlock(new BlockRitualController(), ItemBlockRitualController.class);
|
|
|
|
initTiles();
|
|
}
|
|
|
|
public static void initTiles() {
|
|
|
|
}
|
|
|
|
public static void initRenders() {
|
|
InventoryRenderHelper renderHelper = BloodMagic.instance.getRenderHelper();
|
|
|
|
renderHelper.fluidRender(lifeEssence);
|
|
renderHelper.itemRender(InventoryRenderHelper.getItemFromBlock(ritualStone), 0);
|
|
renderHelper.itemRender(InventoryRenderHelper.getItemFromBlock(ritualStone), 1);
|
|
}
|
|
|
|
private static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlock, String name) {
|
|
if (!ConfigHandler.blockBlacklist.contains(name))
|
|
GameRegistry.registerBlock(block, itemBlock, name);
|
|
|
|
return block;
|
|
}
|
|
|
|
private static Block registerBlock(Block block, Class<? extends ItemBlock> itemBlock) {
|
|
return registerBlock(block, itemBlock, block.getClass().getSimpleName());
|
|
}
|
|
|
|
private static Block registerBlock(Block block, String name) {
|
|
if (!ConfigHandler.blockBlacklist.contains(name))
|
|
GameRegistry.registerBlock(block, name);
|
|
|
|
return block;
|
|
}
|
|
|
|
private static Block registerBlock(Block block) {
|
|
return registerBlock(block, block.getClass().getSimpleName());
|
|
}
|
|
}
|