Search in sources :

Example 1 with BlockTropicsWater

use of net.tropicraft.core.common.block.BlockTropicsWater in project Tropicraft by Tropicraft.

the class BlockRegistry method registerBlocks.

/**
 * Register blocks in preInit
 */
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
    IForgeRegistry<Block> registry = event.getRegistry();
    chunk = registerBlock(registry, new BlockChunkOHead(), Names.BLOCK_CHUNK_O_HEAD);
    ore = registerBlock(registry, new BlockTropicraftOre(), "ore", new MultiBlockItemCreator(TropicraftOres.VALUES).withOredict("oreAzurite", TropicraftOres.AZURITE.getMeta()).withOredict("oreEudialyte", TropicraftOres.EUDIALYTE.getMeta()).withOredict("oreZircon", TropicraftOres.ZIRCON.getMeta()).withOredict("oreManganese", TropicraftOres.MANGANESE.getMeta()));
    // FIXME ew
    oreBlock = registerBlock(registry, new BlockTropicraftOreBlock(), "oreblock", new MultiBlockItemCreator(TropicraftOres.ORES_WITH_BLOCKS) {

        @Override
        public Item getItem(Block block) {
            return new ItemBlockTropicraft(block, variants.toArray(new ITropicraftVariant[variants.size()])) {

                @Override
                public String getUnlocalizedName(ItemStack itemstack) {
                    return super.getUnlocalizedName(itemstack).replaceAll(TropicraftOres.AZURITE.getTypeName(), "oreblock");
                }
            };
        }
    });
    flowers = registerBlock(registry, new BlockTropicsFlowers(), "flower", new StandardItemCreator(TropicraftFlowers.VALUES));
    logs = registerBlock(registry, new BlockTropicraftLog(), "log", new MultiBlockItemCreator(TropicraftLogs.values()).withOredict("logWood", OreDictionary.WILDCARD_VALUE));
    coral = registerBlock(registry, new BlockCoral(), "coral", new StandardItemCreator(TropicraftCorals.VALUES));
    bundles = registerBlock(registry, new BlockBundle(Material.WOOD), "bundle", new StandardItemCreator(TropicraftBundles.values()).withOredict("blockThatch", TropicraftBundles.THATCH.getMeta()).withOredict("blockBamboo", TropicraftBundles.BAMBOO.getMeta()));
    seaweed = registerBlockNoItem(registry, new BlockSeaweed(), "seaweed");
    slabs = new BlockTropicraftSlab(Material.WOOD, false);
    doubleSlabs = new BlockTropicraftSlab(Material.WOOD, true);
    IBlockItemRegistrar slabRegistrar = new MultiBlockItemCreator(TropicraftSlabs.VALUES) {

        @Override
        public ItemTropicraftSlab getItem(Block block) {
            return new ItemTropicraftSlab(block, slabs, doubleSlabs);
        }
    }.withOredict("slabWood", TropicraftSlabs.PALM.getMeta(), TropicraftSlabs.MAHOGANY.getMeta());
    slabs = registerBlock(registry, slabs, "slab", slabRegistrar);
    doubleSlabs = registerBlock(registry, doubleSlabs, "double_slab", slabRegistrar);
    planks = registerBlock(registry, new BlockTropicraftPlank(Material.WOOD), "plank", new MultiBlockItemCreator(TropicraftPlanks.VALUES).withOredict("plankWood", OreDictionary.WILDCARD_VALUE));
    bambooShoot = registerBlock(registry, new BlockBambooShoot(), Names.BAMBOO_SHOOT, new SimpleItemCreator(Names.BAMBOO_SHOOT, false).withOredict("bamboo", 0));
    thatchStairs = registerBlock(registry, new BlockTropicraftStairs(bundles.defaultForVariant(TropicraftBundles.THATCH)), Names.BLOCK_THATCH_STAIRS, new SimpleItemCreator(Names.BLOCK_THATCH_STAIRS, true));
    bambooStairs = registerBlock(registry, new BlockTropicraftStairs(bundles.defaultForVariant(TropicraftBundles.BAMBOO)), Names.BLOCK_BAMBOO_STAIRS, new SimpleItemCreator(Names.BLOCK_BAMBOO_STAIRS, true));
    palmStairs = registerBlock(registry, new BlockTropicraftStairs(planks.defaultForVariant(TropicraftPlanks.PALM)), Names.BLOCK_PALM_STAIRS, new SimpleItemCreator(Names.BLOCK_PALM_STAIRS, true).withOredict("stairsWood", OreDictionary.WILDCARD_VALUE));
    chunkStairs = registerBlock(registry, new BlockTropicraftStairs(chunk.getDefaultState()), Names.BLOCK_CHUNK_O_HEAD_STAIRS, new SimpleItemCreator(Names.BLOCK_CHUNK_O_HEAD_STAIRS, true));
    mahoganyStairs = registerBlock(registry, new BlockTropicraftStairs(planks.defaultForVariant(TropicraftPlanks.MAHOGANY)), Names.BLOCK_MAHOGANY_STAIRS, new SimpleItemCreator(Names.BLOCK_MAHOGANY_STAIRS, true).withOredict("stairsWood", OreDictionary.WILDCARD_VALUE));
    thatchStairsFuzzy = registerBlock(registry, new BlockTropicraftStairsFuzzy(bundles.defaultForVariant(TropicraftBundles.THATCH)), Names.BLOCK_THATCH_STAIRS_FUZZY, new SimpleItemCreator(Names.BLOCK_THATCH_STAIRS_FUZZY, true));
    leaves = registerBlock(registry, new BlockTropicraftLeaves(), "leaves", new MultiBlockItemCreator(TropicraftLeaves.VALUES).withOredict("treeLeaves", OreDictionary.WILDCARD_VALUE));
    fruitLeaves = registerBlock(registry, new BlockFruitLeaves(), "leaves_fruit", new MultiBlockItemCreator(TropicraftFruitLeaves.VALUES).withOredict("treeLeaves", OreDictionary.WILDCARD_VALUE));
    bambooChest = registerBlock(registry, new BlockBambooChest(), Names.BAMBOO_CHEST);
    saplings = registerBlock(registry, new BlockTropicsSapling(), "sapling", new StandardItemCreator(TropicraftSaplings.VALUES).withOredict("treeSapling", OreDictionary.WILDCARD_VALUE));
    coconut = registerBlock(registry, new BlockCoconut(), Names.COCONUT);
    pineapple = registerBlock(registry, new BlockPineapple(), "pineapple");
    iris = registerBlock(registry, new BlockIris(), "iris");
    coffeePlant = registerBlock(registry, new BlockCoffeeBush(), "coffee_bush", (IBlockItemRegistrar) null);
    sands = registerBlock(registry, new BlockTropicraftSands(), "sand", new MultiBlockItemCreator(TropicraftSands.VALUES).withOredict("sand", TropicraftSands.PURIFIED.getMeta()));
    volcano = registerBlock(registry, new BlockVolcano(), Names.VOLCANO, (IBlockItemRegistrar) null);
    tikiTorch = registerBlock(registry, new BlockTikiTorch(), "tiki_torch");
    drinkMixer = registerBlock(registry, new BlockDrinkMixer(), Names.DRINK_MIXER);
    sifter = registerBlock(registry, new BlockSifter(), Names.SIFTER);
    airCompressor = registerBlock(registry, new BlockAirCompressor(), Names.AIR_COMPRESSOR);
    flowerPot = registerBlockNoItem(registry, new BlockTropicraftFlowerPot(), Names.FLOWER_POT);
    bambooDoor = registerBlockNoItem(registry, new BlockBambooDoor(), Names.BAMBOO_DOOR);
    bongo = registerBlock(registry, new BlockBongoDrum(), Names.BONGO, new MultiBlockItemCreator(TropicraftBongos.VALUES));
    bambooFenceGate = registerBlock(registry, (BlockFenceGate) new BlockFenceGate(BlockPlanks.EnumType.BIRCH).setHardness(2.0F).setResistance(5.0F), "bamboo_fence_gate");
    thatchFenceGate = registerBlock(registry, (BlockFenceGate) new BlockFenceGate(BlockPlanks.EnumType.BIRCH).setHardness(2.0F).setResistance(5.0F), "thatch_fence_gate");
    chunkFenceGate = registerBlock(registry, (BlockFenceGate) new BlockFenceGate(BlockPlanks.EnumType.DARK_OAK).setHardness(2.0F).setResistance(30F), "chunk_fence_gate");
    palmFenceGate = registerBlock(registry, (BlockFenceGate) new BlockFenceGate(BlockPlanks.EnumType.SPRUCE).setHardness(2.0F).setResistance(5.0F), "palm_fence_gate", new SimpleItemCreator("palm_fence_gate", false).withOredict("fenceGateWood", OreDictionary.WILDCARD_VALUE));
    mahoganyFenceGate = registerBlock(registry, (BlockFenceGate) new BlockFenceGate(BlockPlanks.EnumType.OAK).setHardness(2.0F).setResistance(5.0F), "mahogany_fence_gate", new SimpleItemCreator("mahogany_fence_gate", false).withOredict("fenceGateWood", OreDictionary.WILDCARD_VALUE));
    bambooFence = registerBlock(registry, new BlockTropicraftFence(bambooFenceGate, Material.WOOD, MapColor.SAND), "bamboo_fence");
    thatchFence = registerBlock(registry, new BlockTropicraftFence(thatchFenceGate, Material.PLANTS, MapColor.SAND), "thatch_fence");
    chunkFence = registerBlock(registry, new BlockTropicraftFence(chunkFenceGate, Material.ROCK, MapColor.SAND), "chunk_fence");
    palmFence = registerBlock(registry, new BlockTropicraftFence(palmFenceGate, Material.WOOD, MapColor.SAND), "palm_fence", new SimpleItemCreator("palm_fence", true).withOredict("fenceWood", OreDictionary.WILDCARD_VALUE));
    mahoganyFence = registerBlock(registry, new BlockTropicraftFence(mahoganyFenceGate, Material.WOOD, MapColor.SAND), "mahogany_fence", new SimpleItemCreator("mahogany_fence", true).withOredict("fenceWood", OreDictionary.WILDCARD_VALUE));
    bambooLadder = registerBlock(registry, new BlockTropicraftLadder().setHardness(BlockHardnessValues.BAMBOO.hardness).setResistance(BlockHardnessValues.BAMBOO.resistance), Names.BAMBOO_LADDER);
    packedPurifiedSand = registerBlock(registry, new BlockPackedPurifiedSand(), "packed_purified_sand");
    // Water must be after fences to reference them in ctor
    tropicsWater = registerBlockNoItem(registry, new BlockTropicsWater(FluidRegistry.tropicsWater, Material.WATER), Names.TROPICS_WATER);
    tropicsPortal = registerBlockNoItem(registry, new BlockTropicsPortal(FluidRegistry.tropicsPortal, Material.WATER, false), Names.TROPICS_PORTAL);
    tropicsPortalTeleporter = registerBlockNoItem(registry, new BlockTropicsPortal(FluidRegistry.tropicsPortal, Material.WATER, true), Names.TROPICS_PORTAL_TELEPORTER);
    Tropicraft.proxy.registerFluidBlockRendering(BlockRegistry.tropicsWater, Names.TROPICS_WATER);
    Tropicraft.proxy.registerFluidBlockRendering(BlockRegistry.tropicsPortal, Names.TROPICS_PORTAL);
    Tropicraft.proxy.registerFluidBlockRendering(BlockRegistry.tropicsPortalTeleporter, Names.TROPICS_PORTAL_TELEPORTER);
    portalWall = registerBlockNoItem(registry, new BlockPortalWall(), Names.PORTAL_WALL);
}
Also used : BlockBambooChest(net.tropicraft.core.common.block.BlockBambooChest) BlockFruitLeaves(net.tropicraft.core.common.block.BlockFruitLeaves) BlockTropicraftLadder(net.tropicraft.core.common.block.BlockTropicraftLadder) BlockTropicraftLeaves(net.tropicraft.core.common.block.BlockTropicraftLeaves) BlockTropicsFlowers(net.tropicraft.core.common.block.BlockTropicsFlowers) BlockTropicraftPlank(net.tropicraft.core.common.block.BlockTropicraftPlank) ItemTropicraftSlab(net.tropicraft.core.common.itemblock.ItemTropicraftSlab) BlockIris(net.tropicraft.core.common.block.BlockIris) BlockBambooDoor(net.tropicraft.core.common.block.BlockBambooDoor) BlockSeaweed(net.tropicraft.core.common.block.BlockSeaweed) BlockCoconut(net.tropicraft.core.common.block.BlockCoconut) BlockTropicraftStairs(net.tropicraft.core.common.block.BlockTropicraftStairs) BlockBongoDrum(net.tropicraft.core.common.block.BlockBongoDrum) ITropicraftVariant(net.tropicraft.core.common.enums.ITropicraftVariant) BlockPineapple(net.tropicraft.core.common.block.BlockPineapple) BlockVolcano(net.tropicraft.core.common.block.BlockVolcano) BlockTropicraftFlowerPot(net.tropicraft.core.common.block.BlockTropicraftFlowerPot) BlockFenceGate(net.minecraft.block.BlockFenceGate) BlockTikiTorch(net.tropicraft.core.common.block.BlockTikiTorch) BlockTropicraftSands(net.tropicraft.core.common.block.BlockTropicraftSands) BlockSifter(net.tropicraft.core.common.block.BlockSifter) BlockAirCompressor(net.tropicraft.core.common.block.scuba.BlockAirCompressor) BlockDrinkMixer(net.tropicraft.core.common.block.BlockDrinkMixer) BlockTropicsSapling(net.tropicraft.core.common.block.BlockTropicsSapling) BlockTropicraftOreBlock(net.tropicraft.core.common.block.BlockTropicraftOreBlock) ItemBlockTropicraft(net.tropicraft.core.common.itemblock.ItemBlockTropicraft) BlockTropicraftOre(net.tropicraft.core.common.block.BlockTropicraftOre) BlockChunkOHead(net.tropicraft.core.common.block.BlockChunkOHead) BlockTropicsPortal(net.tropicraft.core.common.block.BlockTropicsPortal) BlockTropicraftFence(net.tropicraft.core.common.block.BlockTropicraftFence) IBlockItemRegistrar(net.tropicraft.core.registry.ItemRegistry.IBlockItemRegistrar) BlockPackedPurifiedSand(net.tropicraft.core.common.block.BlockPackedPurifiedSand) BlockTropicraftStairsFuzzy(net.tropicraft.core.common.block.BlockTropicraftStairsFuzzy) BlockTropicsWater(net.tropicraft.core.common.block.BlockTropicsWater) BlockCoral(net.tropicraft.core.common.block.BlockCoral) BlockPortalWall(net.tropicraft.core.common.block.BlockPortalWall) Block(net.minecraft.block.Block) BlockTropicraftOreBlock(net.tropicraft.core.common.block.BlockTropicraftOreBlock) ItemStack(net.minecraft.item.ItemStack) BlockBambooShoot(net.tropicraft.core.common.block.BlockBambooShoot) BlockTropicraftLog(net.tropicraft.core.common.block.BlockTropicraftLog) BlockCoffeeBush(net.tropicraft.core.common.block.BlockCoffeeBush) BlockBundle(net.tropicraft.core.common.block.BlockBundle) BlockTropicraftSlab(net.tropicraft.core.common.block.BlockTropicraftSlab) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

Block (net.minecraft.block.Block)1 BlockFenceGate (net.minecraft.block.BlockFenceGate)1 ItemStack (net.minecraft.item.ItemStack)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 BlockBambooChest (net.tropicraft.core.common.block.BlockBambooChest)1 BlockBambooDoor (net.tropicraft.core.common.block.BlockBambooDoor)1 BlockBambooShoot (net.tropicraft.core.common.block.BlockBambooShoot)1 BlockBongoDrum (net.tropicraft.core.common.block.BlockBongoDrum)1 BlockBundle (net.tropicraft.core.common.block.BlockBundle)1 BlockChunkOHead (net.tropicraft.core.common.block.BlockChunkOHead)1 BlockCoconut (net.tropicraft.core.common.block.BlockCoconut)1 BlockCoffeeBush (net.tropicraft.core.common.block.BlockCoffeeBush)1 BlockCoral (net.tropicraft.core.common.block.BlockCoral)1 BlockDrinkMixer (net.tropicraft.core.common.block.BlockDrinkMixer)1 BlockFruitLeaves (net.tropicraft.core.common.block.BlockFruitLeaves)1 BlockIris (net.tropicraft.core.common.block.BlockIris)1 BlockPackedPurifiedSand (net.tropicraft.core.common.block.BlockPackedPurifiedSand)1 BlockPineapple (net.tropicraft.core.common.block.BlockPineapple)1 BlockPortalWall (net.tropicraft.core.common.block.BlockPortalWall)1 BlockSeaweed (net.tropicraft.core.common.block.BlockSeaweed)1