Search in sources :

Example 1 with SlabBlock

use of net.tslat.aoa3.block.decoration.slabs.SlabBlock in project Advent-Of-Ascension by Tslat.

the class BlockRegister method registerBlock.

private static void registerBlock(IForgeRegistry<Block> registry, Block block, String modelSubfolder, String... oreDictKeys) {
    registry.register(block);
    ItemBlock itemBlock;
    if (block instanceof SlabBlock.DoubleSlabBlock) {
        BlockSlab halfBlock = ((SlabBlock) block).getHalfBlock();
        blockRegistryList.add(new BlockRegistryWrapper(halfBlock, (ItemSlab) new ItemSlab(halfBlock, halfBlock, (SlabBlock.DoubleSlabBlock) block).setRegistryName(halfBlock.getRegistryName()), "blocks/decoration/slabs/", oreDictKeys));
        blockRegistryList.add(new BlockRegistryWrapper(block, null, null));
        registry.register(halfBlock);
        return;
    } else if (block instanceof LampBlock) {
        LampBlock offLamp = ((LampBlock) block).getOffLamp();
        blockRegistryList.add(new BlockRegistryWrapper(offLamp, (ItemBlock) new ItemBlock(offLamp).setRegistryName(offLamp.getRegistryName()), modelSubfolder, oreDictKeys));
        blockRegistryList.add(new BlockRegistryWrapper(block, (ItemBlock) new ItemBlock(block).setRegistryName(block.getRegistryName()), modelSubfolder));
        registry.register(offLamp);
        return;
    } else {
        itemBlock = (ItemBlock) new ItemBlock(block).setRegistryName(block.getRegistryName());
    }
    blockRegistryList.add(new BlockRegistryWrapper(block, itemBlock, modelSubfolder, oreDictKeys));
}
Also used : ItemSlab(net.minecraft.item.ItemSlab) BlockSlab(net.minecraft.block.BlockSlab) SlabBlock(net.tslat.aoa3.block.decoration.slabs.SlabBlock) LampBlock(net.tslat.aoa3.block.functional.lamps.LampBlock) ItemBlock(net.minecraft.item.ItemBlock)

Aggregations

BlockSlab (net.minecraft.block.BlockSlab)1 ItemBlock (net.minecraft.item.ItemBlock)1 ItemSlab (net.minecraft.item.ItemSlab)1 SlabBlock (net.tslat.aoa3.block.decoration.slabs.SlabBlock)1 LampBlock (net.tslat.aoa3.block.functional.lamps.LampBlock)1