Java Code Examples for cpw.mods.fml.common.registry.GameRegistry#registerBlock()

The following examples show how to use cpw.mods.fml.common.registry.GameRegistry#registerBlock() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EnderStorageProxy.java    From EnderStorage with MIT License 6 votes vote down vote up
public void init()
{
    blockEnderChest = new BlockEnderStorage();
    blockEnderChest.setBlockName("enderchest");
    GameRegistry.registerBlock(blockEnderChest, ItemEnderStorage.class, "enderChest");
    MinecraftForge.EVENT_BUS.register(blockEnderChest);
    
    itemEnderPouch = new ItemEnderPouch();
    itemEnderPouch.setUnlocalizedName("enderpouch");
    GameRegistry.registerItem(itemEnderPouch, "enderPouch");
    
    GameRegistry.registerTileEntity(TileEnderChest.class, "Ender Chest");
    GameRegistry.registerTileEntity(TileEnderTank.class, "Ender Tank");
    
    PacketCustom.assignHandler(EnderStorageSPH.channel, new EnderStorageSPH());
    EnderStorageRecipe.init();
}
 
Example 2
Source File: ModBlocks.java    From GardenCollection with MIT License 6 votes vote down vote up
public void init () {
    thinLog = new BlockThinLog(makeName("thinLog"));
    thinLogFence = new BlockThinLogFence(makeName("thinLogFence"));
    flowerLeaves = new BlockFlowerLeaves(makeName("flowerLeaves"));
    sapling = new BlockGTSapling(makeName("sapling"));
    ivy = new BlockIvy(makeName("ivy"));
    strangePlant = new BlockStrangePlant(makeName("strangePlant"));
    candelilla = new BlockCandelilla(makeName("candelilla"));

    GameRegistry.registerBlock(sapling, ItemGTSapling.class, "sapling");
    GameRegistry.registerBlock(thinLog, ItemThinLog.class, "thin_log");
    GameRegistry.registerBlock(thinLogFence, ItemThinLogFence.class, "thin_log_fence");
    //GameRegistry.registerBlock(flowerLeaves, "flower_leaves");
    GameRegistry.registerBlock(ivy, ItemIvy.class, "ivy");
    GameRegistry.registerBlock(strangePlant, "strange_plant");
    GameRegistry.registerBlock(candelilla, "candelilla_bush");

    GameRegistry.registerTileEntity(TileEntityWoodProxy.class, ModBlocks.getQualifiedName(thinLog));
}
 
Example 3
Source File: IC2BlockRegistry.java    From Electro-Magic-Tools with GNU General Public License v3.0 6 votes vote down vote up
public static void registerBlocks() {
    shield = new BlockShield().setBlockName(ModInformation.modid + ".shield");
    GameRegistry.registerBlock(shield, "ShieldBlock");

    emtSolars = new BlockEMTSolars().setBlockName(ModInformation.modid + ".emtsolars");
    GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMTSolars");

    emtSolars2 = new BlockEMTSolars2().setBlockName(ModInformation.modid + ".emtsolars2");
    GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMTSolars2");

    emtMachines = new BlockEMTMachines().setBlockName(ModInformation.modid + ".emtmachines");
    GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMTMachines");

    essentiaGens = new BlockEssentiaGenerators().setBlockName(ModInformation.modid + ".essentiaGens");
    GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");

    essentiaGenerator = new BlockEssentiaGenerator().setBlockName(ModInformation.modid + ".essentiaGenerator");
    GameRegistry.registerBlock(essentiaGenerator, ItemBlockEssentiaGenerator.class, "Essentia Generator");
}
 
Example 4
Source File: CarvableStairsMaker.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
public void create(IStairsCreator creator, String name, Block[] blocks) {
	for (int i = 0; i < blocks.length; i++) {
		String n = name + "." + i;
		blocks[i] = creator == null ? new BlockCarvableStairs(blockBase, i * 2, carverHelper) : creator.create(blockBase, i * 2, carverHelper);

		blocks[i].setBlockName("chisel." + n).setCreativeTab(ChiselTabs.tabStairChiselBlocks);
		GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n);

		for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.infoList.size(); meta++) {
			IVariationInfo info = carverHelper.infoList.get(i * 2 + meta);

			carverHelper.registerVariation(name, info);

			GameRegistry.addRecipe(new ItemStack(blocks[i], 4, meta * 8), "*  ", "** ", "***", '*', new ItemStack(blockBase, 1, i * 2 + meta));
		}
	}
}
 
Example 5
Source File: HexxitGear.java    From HexxitGear with GNU General Public License v3.0 6 votes vote down vote up
@Init
public void init(FMLInitializationEvent evt) {
    hexbiscus = new BlockHexbiscus(HexxitGearConfig.hexbiscus.getInt());

    tribalHelmet = new ItemTribalArmor(HexxitGearConfig.tribalHelmetId.getInt(), proxy.addArmor("tribal"), 0).setUnlocalizedName("hexxitgear.tribal.helmet");
    tribalChest = new ItemTribalArmor(HexxitGearConfig.tribalChestId.getInt(), proxy.addArmor("tribal"), 1).setUnlocalizedName("hexxitgear.tribal.chest");
    tribalLeggings = new ItemTribalArmor(HexxitGearConfig.tribalLeggingsId.getInt(), proxy.addArmor("tribal"), 2).setUnlocalizedName("hexxitgear.tribal.leggings");
    tribalShoes = new ItemTribalArmor(HexxitGearConfig.tribalShoesId.getInt(), proxy.addArmor("tribal"), 3).setUnlocalizedName("hexxitgear.tribal.boots");
    scaleHelmet = new ItemScaleArmor(HexxitGearConfig.scaleHelmetId.getInt(), proxy.addArmor("scale"), 0).setUnlocalizedName("hexxitgear.scale.helmet");
    scaleChest = new ItemScaleArmor(HexxitGearConfig.scaleChestId.getInt(), proxy.addArmor("scale"), 1).setUnlocalizedName("hexxitgear.scale.chest");
    scaleLeggings = new ItemScaleArmor(HexxitGearConfig.scaleLeggingsId.getInt(), proxy.addArmor("scale"), 2).setUnlocalizedName("hexxitgear.scale.leggings");
    scaleBoots = new ItemScaleArmor(HexxitGearConfig.scaleBootsId.getInt(), proxy.addArmor("scale"), 3).setUnlocalizedName("hexxitgear.scale.boots");
    thiefHelmet = new ItemThiefArmor(HexxitGearConfig.thiefHelmetId.getInt(), proxy.addArmor("thief"), 0).setUnlocalizedName("hexxitgear.thief.helmet");
    thiefChest = new ItemThiefArmor(HexxitGearConfig.thiefChestId.getInt(), proxy.addArmor("thief"), 1).setUnlocalizedName("hexxitgear.thief.chest");
    thiefLeggings = new ItemThiefArmor(HexxitGearConfig.thiefLeggingsId.getInt(), proxy.addArmor("thief"), 2).setUnlocalizedName("hexxitgear.thief.leggings");
    thiefBoots = new ItemThiefArmor(HexxitGearConfig.thiefBootsId.getInt(), proxy.addArmor("thief"), 3).setUnlocalizedName("hexxitgear.thief.boots");

    hexicalEssence = new ItemHexicalEssence(HexxitGearConfig.hexicalEssence.getInt());
    hexicalDiamond = new ItemHexicalDiamond(HexxitGearConfig.hexicalDiamond.getInt());

    GameRegistry.registerBlock(hexbiscus, hexbiscus.getUnlocalizedName());

    GameRegistry.registerWorldGenerator(new HGWorldGen());

    proxy.init();
}
 
Example 6
Source File: ForbiddenBlocks.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 6 votes vote down vote up
public static void addBlocks() {
    arcaneCake = GameRegistry.registerBlock(new BlockArcaneCake().setBlockName("ArcaneCake"), "ArcaneCake");

    wrathCage = GameRegistry.registerBlock(new BlockWrathCage().setBlockName("WrathCage"), "WrathCage");
    GameRegistry.registerTileEntity(TileEntityWrathCage.class, "WrathCage");

    blackFlower = GameRegistry.registerBlock(new BlockBlackFlower().setBlockName("InkFlower"), "InkFlower");

    starBlock = GameRegistry.registerBlock(new BlockResource().setBlockName("StarBlock"), "StarBlock");
    OreDictionary.registerOre("blockNetherStar", new ItemStack(starBlock, 1, 0));

    roseBush = GameRegistry.registerBlock(new BlockRoseBush(), "UmbralBush");

    taintLog = GameRegistry.registerBlock(new BlockLogTainted().setBlockName("TaintLog"), "TaintLog");
    taintPlanks = GameRegistry.registerBlock(new BlockPlanksTainted().setBlockName("TaintPlank"), "TaintPlank");
    taintLeaves = GameRegistry.registerBlock(new BlockLeavesTainted().setBlockName("TaintLeaves"), "TaintLeaves");
    taintSapling = GameRegistry.registerBlock(new BlockSaplingTainted().setBlockName("TaintSapling"), "TaintSapling");

    taintStone = GameRegistry.registerBlock(new BlockStoneTainted(), ItemBlockStoneTainted.class, "TaintBlock");
}
 
Example 7
Source File: BlockConverter.java    From NOVA-Core with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void registerNovaBlock(BlockFactory blockFactory) {
	FWBlock blockWrapper = new FWBlock(blockFactory);
	blockFactoryMap.put(blockFactory, blockWrapper);
	NovaMinecraft.proxy.registerBlock(blockWrapper);
	String blockId = blockFactory.getID();
	if (!blockId.contains(":"))
		blockId = NovaLauncher.instance().flatMap(NovaLauncher::getCurrentMod).map(Mod::id).orElse("nova") + ':' + blockId;
	GameRegistry.registerBlock(blockWrapper, FWItemBlock.class, blockId);

	if (blockWrapper.dummy.components.has(Category.class) && FMLCommonHandler.instance().getSide().isClient()) {
		//Add into creative tab
		Category category = blockWrapper.dummy.components.get(Category.class);
		blockWrapper.setCreativeTab(CategoryConverter.instance().toNative(category, blockWrapper));
	}

	Game.logger().info("Registered block: {}", blockFactory.getID());
}
 
Example 8
Source File: WerkstoffLoader.java    From bartworks with MIT License 6 votes vote down vote up
static void gameRegistryHandler() {
    if (SideReference.Side.Client)
        RenderingRegistry.registerBlockHandler(BW_Renderer_Block_Ores.INSTANCE);

    GameRegistry.registerTileEntity(BW_MetaGeneratedOreTE.class, "bw.blockoresTE");
    GameRegistry.registerTileEntity(BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmallTE");
    GameRegistry.registerTileEntity(BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblockTE");
    GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockcasingTE");
    GameRegistry.registerTileEntity(BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvancedTE");

    WerkstoffLoader.BWOres = new BW_MetaGenerated_Ores(Material.rock, BW_MetaGeneratedOreTE.class, "bw.blockores");
    WerkstoffLoader.BWSmallOres = new BW_MetaGenerated_SmallOres(Material.rock, BW_MetaGeneratedSmallOreTE.class, "bw.blockoresSmall");
    WerkstoffLoader.BWBlocks = new BW_MetaGenerated_WerkstoffBlocks(Material.iron, BW_MetaGenerated_WerkstoffBlock_TE.class, "bw.werkstoffblocks");
    WerkstoffLoader.BWBlockCasings = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_Casing_TE.class, "bw.werkstoffblockscasing", blockCasing);
    WerkstoffLoader.BWBlockCasingsAdvanced = new BW_MetaGeneratedBlocks_Casing(Material.iron, BW_MetaGeneratedBlocks_CasingAdvanced_TE.class, "bw.werkstoffblockscasingadvanced", blockCasingAdvanced);

    GameRegistry.registerBlock(WerkstoffLoader.BWOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.01");
    GameRegistry.registerBlock(WerkstoffLoader.BWSmallOres, BW_MetaGeneratedBlock_Item.class, "bw.blockores.02");
    GameRegistry.registerBlock(WerkstoffLoader.BWBlocks, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblocks.01");
    GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasings, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasing.01");
    GameRegistry.registerBlock(WerkstoffLoader.BWBlockCasingsAdvanced, BW_MetaGeneratedBlock_Item.class, "bw.werkstoffblockscasingadvanced.01");

    GTMetaItemEnhancer.init();
}
 
Example 9
Source File: ModBlocks.java    From GardenCollection with MIT License 5 votes vote down vote up
public void init () {
    woodWindowBox = new BlockWindowBox(makeName("woodWindowBox"), Material.wood);
    stoneWindowBox = new BlockWindowBoxStone(makeName("stoneWindowBox"));
    decorativePot = new BlockDecorativePot(makeName("decorativePot"));
    largePot = new BlockLargePotStandard(makeName("largePot"));
    largePotColored = new BlockLargePotColored(makeName("largePotColored"));
    mediumPot = new BlockMediumPotStandard(makeName("mediumPot"));
    mediumPotColored = new BlockMediumPotColored(makeName("mediumPotColored"));
    potteryTable = new BlockPotteryTable(makeName("potteryTable"));

    GameRegistry.registerBlock(woodWindowBox, ItemWindowBox.class, "wood_window_box");
    GameRegistry.registerBlock(stoneWindowBox, ItemWindowBox.class, "stone_window_box");
    GameRegistry.registerBlock(decorativePot, ItemDecorativePot.class, "decorative_pot");
    GameRegistry.registerBlock(largePot, ItemLargePot.class, "large_pot");
    GameRegistry.registerBlock(largePotColored, ItemLargePot.class, "large_pot_colored");
    GameRegistry.registerBlock(mediumPot, ItemMediumPot.class, "medium_pot");
    GameRegistry.registerBlock(mediumPotColored, ItemMediumPot.class, "medium_pot_colored");
    GameRegistry.registerBlock(potteryTable, "pottery_table");

    GameRegistry.registerTileEntity(TileEntityWindowBox.class, ModBlocks.getQualifiedName(woodWindowBox));
    GameRegistry.registerTileEntity(TileEntityDecorativePot.class, ModBlocks.getQualifiedName(decorativePot));
    GameRegistry.registerTileEntity(TileEntityLargePot.class, ModBlocks.getQualifiedName(largePot));
    GameRegistry.registerTileEntity(TileEntityLargePot.class, ModBlocks.getQualifiedName(largePotColored));
    GameRegistry.registerTileEntity(TileEntityMediumPot.class, ModBlocks.getQualifiedName(mediumPot));
    GameRegistry.registerTileEntity(TileEntityMediumPot.class, ModBlocks.getQualifiedName(mediumPotColored));
    GameRegistry.registerTileEntity(TileEntityPotteryTable.class, ModBlocks.getQualifiedName(potteryTable));
}
 
Example 10
Source File: BurlapCraft.java    From burlapcraft with GNU Lesser General Public License v3.0 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	

	burlapStone = new BlockBurlapStone();
	redRock = new BlockRedRock();
	blueRock = new BlockBlueRock();
	orangeRock = new BlockOrangeRock();
	greenRock = new BlockGreenRock();
	mineableRedRock = new BlockMineableRedRock();
	mineableOrangeRock = new BlockMineableOrangeRock();
	mineableGreenRock = new BlockMineableGreenRock();
	mineableBlueRock = new BlockMineableBlueRock();
	
	// make sure minecraft knows
	GameRegistry.registerBlock(burlapStone, "burlapstone");
	GameRegistry.registerBlock(redRock, "redrock");
	GameRegistry.registerBlock(blueRock, "bluerock");
	GameRegistry.registerBlock(greenRock, "greenrock");
	GameRegistry.registerBlock(orangeRock, "orangerock");
	GameRegistry.registerBlock(mineableRedRock, "mineableRedRock");
	GameRegistry.registerBlock(mineableGreenRock, "mineableGreenRock");
	GameRegistry.registerBlock(mineableBlueRock, "mineableBlueRock");
	GameRegistry.registerBlock(mineableOrangeRock, "mineableOrangeRock");
	GameRegistry.registerWorldGenerator(genHandler, 0);
	
	MinecraftForge.EVENT_BUS.register(eventHandler);
	// FMLCommonHandler.instance().bus().register(fmlHandler);
	
}
 
Example 11
Source File: ModBlocks.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
private static void registerBlock(Block block) {
	if (!(block instanceof IConfigurable) || ((IConfigurable) block).isEnabled()) {
		String name = block.getUnlocalizedName();
		String[] strings = name.split("\\.");

		if (block instanceof ISubBlocksBlock)
			GameRegistry.registerBlock(block, ((ISubBlocksBlock) block).getItemBlockClass(), strings[strings.length - 1]);
		else
			GameRegistry.registerBlock(block, strings[strings.length - 1]);

		if (block instanceof IBurnableBlock)
			Blocks.fire.setFireInfo(block, 5, 20);
	}
}
 
Example 12
Source File: FramezBlocks.java    From Framez with GNU General Public License v3.0 5 votes vote down vote up
public static void register() {

        for (Entry<Block, String> e : motors.entrySet())
            GameRegistry.registerBlock(e.getKey(), References.Block.MOTOR + "_" + e.getValue());

        GameRegistry.registerBlock(moving, References.Block.MOVING);
        GameRegistry.registerTileEntity(TileMoving.class, References.Block.MOVING);
    }
 
Example 13
Source File: ModBlocks.java    From AdvancedMod with GNU General Public License v3.0 5 votes vote down vote up
public static void init(){
    GameRegistry.registerBlock(dutchFlag, Names.Blocks.DUTCH_FLAG);
    GameRegistry.registerBlock(camoMine, Names.Blocks.CAMO_MINE);
    GameRegistry.registerBlock(modularStorage, Names.Blocks.MODULAR_STORAGE);
    GameRegistry.registerBlock(treeFarm, Names.Blocks.TREE_FARM);

    Log.info("Modblocks initialized");
}
 
Example 14
Source File: Registries.java    From Ex-Aliquo with MIT License 5 votes vote down vote up
public static void registerBlocks()
{
	blockEndEye = new BlockEndEye(Configurations.blockEndEye).setUnlocalizedName("EndEye").setCreativeTab(exatab);
	GameRegistry.registerBlock(blockEndEye, "ExAliquo.EndEye");
	blockEndCake = new BlockEndCake(Configurations.blockEndCake).setUnlocalizedName("EndCake").setCreativeTab(exatab);
	GameRegistry.registerBlock(blockEndCake, "ExAliquo.EndCake");
	
	OreDictionary.registerOre("blockEnder", blockEndEye);
	
	registerOres();
}
 
Example 15
Source File: BlockMarbleStairsMaker.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
public void create(BlockMarbleStairsMakerCreator creator, String name)
{
    blocks = new BlockMarbleStairs[carverHelper.variations.size() / 2];
    for(int i = 0; i < blocks.length; i++)
    {
        String n = name + "." + i;
        blocks[i] = creator == null ?
                new BlockMarbleStairs(blockBase, i * 2, carverHelper) :
                creator.create(blockBase, i * 2, carverHelper);

        blocks[i].setBlockName(n);
        GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n);

        for(int meta = 0; meta < 2 && i * 2 + meta < carverHelper.variations.size(); meta++)
        {
            CarvableVariation variation = carverHelper.variations.get(i * 2 + meta);

            for(int j = 0; j < 8; j++)
                carverHelper.registerVariation(name + ".orientation." + j, variation, blocks[i], j + meta * 8);

            CraftingManager.getInstance().addRecipe(new ItemStack(blocks[i], 4, meta * 8), new Object[]{"*  ", "** ", "***", '*', new ItemStack(blockBase, 1, i * 2 + meta)});
        }

        CarvableHelper.chiselBlocks.add(blocks[i]);
    }

}
 
Example 16
Source File: FluidLoader.java    From bartworks with MIT License 5 votes vote down vote up
public static void run() {
        FluidLoader.renderID = RenderingRegistry.getNextAvailableRenderId();
        short[] rgb = new short[3];
        Arrays.fill(rgb, (short) 255);
        FluidLoader.ff = new GT_Fluid("BWfakeFluid", "molten.autogenerated", rgb);
        FluidLoader.fulvicAcid = FluidLoader.createAndRegisterFluid("Fulvic Acid", new Color(20, 20, 20));
        FluidLoader.heatedfulvicAcid = FluidLoader.createAndRegisterFluid("Heated Fulvic Acid", new Color(40, 20, 20),720);
        FluidLoader.Kerogen = FluidLoader.createAndRegisterFluid("Kerogen", new Color(85, 85, 85));
        FluidLoader.BioLabFluidMaterials = new Fluid[]{
                new GT_Fluid("FluorecentdDNA", "molten.autogenerated", new short[]{125, 50, 170, 0}),
                new GT_Fluid("EnzymesSollution", "molten.autogenerated", new short[]{240, 200, 125, 0}),
                new GT_Fluid("Penicillin", "molten.autogenerated", new short[]{255, 255, 255, 0}),
                new GT_Fluid("Polymerase", "molten.autogenerated", new short[]{110, 180, 110, 0}),
        };

        FluidLoader.BioLabFluidCells = new ItemStack[FluidLoader.BioLabFluidMaterials.length];
        for (int i = 0; i < FluidLoader.BioLabFluidMaterials.length; i++) {
            FluidRegistry.registerFluid(FluidLoader.BioLabFluidMaterials[i]);
            FluidLoader.BioLabFluidCells[i] = ItemFluidCell.getUniversalFluidCell(new FluidStack(FluidLoader.BioLabFluidMaterials[i], 1000));
        }

//        BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).setFluid(new GT_Fluid("_NULL", "molten.autogenerated", BW_Util.splitColorToRBGArray(BioCulture.BIO_CULTURE_ARRAY_LIST.get(0).getColorRGB())));
        FluidStack dnaFluid = LoaderReference.gendustry ? FluidRegistry.getFluidStack("liquiddna", 100) : Materials.Biomass.getFluid(100L);
        for (BioCulture B : BioCulture.BIO_CULTURE_ARRAY_LIST) {
            if (B.isBreedable()) {
                B.setFluid(new GT_Fluid(B.getName().replaceAll(" ", "").toLowerCase() + "fluid", "molten.autogenerated", new short[]{(short) B.getColor().getRed(), (short) B.getColor().getBlue(), (short) B.getColor().getGreen()}));
                FluidRegistry.registerFluid(B.getFluid());
                GT_LanguageManager.addStringLocalization(B.getFluid().getUnlocalizedName(), B.getLocalisedName()+" Fluid");
                GT_Values.RA.addCentrifugeRecipe(GT_Utility.getIntegratedCircuit(10),GT_Values.NI,new FluidStack(B.getFluid(),1000),dnaFluid,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,GT_Values.NI,null,500,120);
            }
        }

        FluidLoader.bioFluidBlock = new BioFluidBlock();
        GameRegistry.registerBlock(FluidLoader.bioFluidBlock, "coloredFluidBlock");
        GameRegistry.registerTileEntity(BWTileEntityDimIDBridge.class, "bwTEDimIDBridge");
        if (SideReference.Side.Client) {
            RenderingRegistry.registerBlockHandler(RendererSwitchingColorFluid.instance);
            RenderingRegistry.registerBlockHandler(RendererGlasBlock.instance);
        }
    }
 
Example 17
Source File: ItemRegistry.java    From bartworks with MIT License 4 votes vote down vote up
public static void run() {
    if (newStuff) {
        GameRegistry.registerBlock(ItemRegistry.bw_fake_glasses, "BW_FakeGlasBlock");
        GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[2], BW_ItemBlocks.class, "BW_Machinery_Casings");
        GameRegistry.registerItem(ItemRegistry.LEATHER_ROTOR, "BW_LeatherRotor");
        GameRegistry.registerItem(ItemRegistry.WOOL_ROTOR, "BW_WoolRotor");
        GameRegistry.registerItem(ItemRegistry.PAPER_ROTOR, "BW_PaperRotor");
        GameRegistry.registerItem(ItemRegistry.COMBINED_ROTOR, "BW_CombinedRotor");
        GameRegistry.registerItem(ItemRegistry.CRAFTING_PARTS, "craftingParts");
        GameRegistry.registerTileEntity(BW_RotorBlock.class, "BWRotorBlockTE");
        GameRegistry.registerBlock(ItemRegistry.ROTORBLOCK, BW_ItemBlocks.class, "BWRotorBlock");
        GameRegistry.registerTileEntity(BW_TileEntity_HeatedWaterPump.class, "BWHeatedWaterPumpTE");
        GameRegistry.registerBlock(ItemRegistry.PUMPBLOCK, BW_ItemBlocks.class, "BWHeatedWaterPumpBlock");
        GameRegistry.registerItem(ItemRegistry.PUMPPARTS, "BWPumpParts");
        GameRegistry.registerItem(ItemRegistry.WINDMETER, "BW_SimpleWindMeter");
        GameRegistry.registerTileEntity(BW_TileEntity_ExperimentalFloodGate.class, "BWExpReversePump");
        GameRegistry.registerBlock(ItemRegistry.EXPPUMP, BW_ItemBlocks.class, "BWExpReversePumpBlock");
    }

    //GT2 stuff
    GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[0], BW_ItemBlocks.class, "BW_ItemBlocks");
    GameRegistry.registerBlock(ItemRegistry.BW_BLOCKS[1], BW_ItemBlocks.class, "GT_LESU_CASING");
    if (ConfigHandler.teslastaff)
        GameRegistry.registerItem(ItemRegistry.TESLASTAFF, ItemRegistry.TESLASTAFF.getUnlocalizedName());

    GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_LV, ItemRegistry.ROCKCUTTER_LV.getUnlocalizedName());
    GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_MV, ItemRegistry.ROCKCUTTER_MV.getUnlocalizedName());
    GameRegistry.registerItem(ItemRegistry.ROCKCUTTER_HV, ItemRegistry.ROCKCUTTER_HV.getUnlocalizedName());
    GameRegistry.registerItem(ItemRegistry.TAB, "tabIconGT2");
    if (newStuff) {
        if (ConfigHandler.creativeScannerID != 0)
            new CreativeScanner(ConfigHandler.creativeScannerID,"Creative Debug Scanner","Creative Debug Scanner",20);
        ItemRegistry.eic = new GT_TileEntity_ElectricImplosionCompressor(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 6, "ElectricImplosionCompressor", "Electric Implosion Compressor").getStackForm(1L);
        ItemRegistry.thtr = new GT_TileEntity_THTR(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 5, "THTR", "Thorium High Temperature Reactor").getStackForm(1L);
        GT_TileEntity_THTR.THTRMaterials.registeraTHR_Materials();
        GT_OreDictUnificator.add(OrePrefixes.block, Materials.BorosilicateGlass, new ItemStack(ItemRegistry.bw_glasses[0], 1, 0));
        GT_OreDictUnificator.registerOre(OrePrefixes.block, Materials.NickelZincFerrite, new ItemStack(ItemRegistry.BW_BLOCKS[2]));
        for (int i = 0; i < GT_Values.VN.length; i++) {
            ItemRegistry.diode2A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length + 1 + i, "diode" + "2A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 2A " + GT_Values.VN[i], i).getStackForm(1L);
            ItemRegistry.diode4A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 2 + 1 + i, "diode" + "4A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 4A " + GT_Values.VN[i], i).getStackForm(1L);
            ItemRegistry.diode8A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 3 + 1 + i, "diode" + "8A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 8A " + GT_Values.VN[i], i).getStackForm(1L);
            ItemRegistry.diode12A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 4 + 1 + i, "diode" + "12A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 12A " + GT_Values.VN[i], i).getStackForm(1L);
            ItemRegistry.diode16A[i] = new GT_MetaTileEntity_Diode(ConfigHandler.IDOffset + GT_Values.VN.length * 5 + 1 + i, "diode" + "16A" + GT_Values.VN[i], StatCollector.translateToLocal("tile.diode.name") + " 16A " + GT_Values.VN[i], i).getStackForm(1L);
            ItemRegistry.energyDistributor[i] = new GT_MetaTileEntity_EnergyDistributor(ConfigHandler.IDOffset + 1 + i, "energydistributor" + GT_Values.VN[i], StatCollector.translateToLocal("tile.energydistributor.name") + " " + GT_Values.VN[i], i).getStackForm(1L);
        }
        for (int i = 0; i < 3; i++) {
            ItemRegistry.acidGens[i] = new GT_MetaTileEntity_AcidGenerator(ConfigHandler.IDOffset + GT_Values.VN.length * 8 - 2 + i, "acidgenerator" + GT_Values.VN[i + 2], StatCollector.translateToLocal("tile.acidgenerator.name") + " " + GT_Values.VN[i + 2], i + 2).getStackForm(1);
        }
        ItemRegistry.dehp = new GT_TileEntity_DEHP(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 1, 1, "DEHP", "Deep Earth Heating Pump").getStackForm(1L);
        ItemRegistry.megaMachines[0] = new GT_TileEntity_MegaBlastFurnace(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 2, "MegaBlastFurnace", StatCollector.translateToLocal("tile.bw.mbf.name")).getStackForm(1L);
        ItemRegistry.megaMachines[1] = new GT_TileEntity_MegaVacuumFreezer(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 3, "MegaVacuumFreezer", StatCollector.translateToLocal("tile.bw.mvf.name")).getStackForm(1L);
        ItemRegistry.cal = new GT_TileEntity_CircuitAssemblyLine(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 7, "CircuitAssemblyLine", "Circuit Assembly Line").getStackForm(1L);
        ItemRegistry.compressedHatch = new GT_MetaTileEntity_CompressedFluidHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 8, "CompressedFluidHatch", "Liquid Air Fluid Hatch").getStackForm(1L);
        ItemRegistry.giantOutputHatch = new GT_MetaTileEntity_GiantOutputHatch(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 9, "GiantOutputHatch", "Giant Output Hatch").getStackForm(1L);
        ItemRegistry.megaMachines[2] = new GT_TileEntity_MegaDistillTower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 10, "MegaDistillationTower", "Mega Distillation Tower").getStackForm(1L);

        if (LoaderReference.galacticgreg && WerkstoffLoader.gtnhGT) {
            ItemRegistry.voidminer[2] = new GT_TileEntity_VoidMiners.VMUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 11, "VoidMiner3", "Void Miner III").getStackForm(1L);
            ItemRegistry.voidminer[1] = new GT_TileEntity_VoidMiners.VMZPM(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 12, "VoidMiner2", "Void Miner II").getStackForm(1L);
            ItemRegistry.voidminer[0] = new GT_TileEntity_VoidMiners.VMLUV(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 13, "VoidMiner1", "Void Miner I").getStackForm(1L);
        }
        if (LoaderReference.tectech) {
            TecTechPipeEnergyLowPower = new TT_MetaTileEntity_Pipe_Energy_LowPower(ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 14, "pipe.lowpowerlaser", "Low Power Laser Pipe").getStackForm(1L);
            int startID = ConfigHandler.IDOffset + GT_Values.VN.length * 8 + 15;
            for (int amps = 32; amps <= 128; amps += 32) {
                for (int tier = 4; tier < 8; tier++) {
                    TecTechLaserAdditions[0][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserBox(startID++, GT_Values.VN[tier] + "_LPLaser_Converter_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Converter", tier, amps).getStackForm(1L);
                }
            }
            for (int amps = 32; amps <= 128; amps += 32) {
                for (int tier = 4; tier < 8; tier++) {
                    TecTechLaserAdditions[1][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserHatch(startID++, GT_Values.VN[tier] + "_LPLaser_Hatch_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Target Hatch", tier, amps).getStackForm(1L);
                }
            }
            for (int amps = 32; amps <= 128; amps += 32) {
                for (int tier = 4; tier < 8; tier++) {
                    TecTechLaserAdditions[2][amps / 32 - 1][tier - 4] = new TT_MetaTileEntity_LowPowerLaserDynamo(startID++, GT_Values.VN[tier] + "_LPLaser_Dynamo_" + amps, GT_Values.VN[tier] + " " + amps + "A/t" + " Low Power Laser Source Hatch", tier, amps).getStackForm(1L);
                }
            }
        }
    }
}
 
Example 18
Source File: BigReactors.java    From BigReactors with MIT License 4 votes vote down vote up
public static ItemStack registerOres(int i, boolean b) {
	BRConfig.CONFIGURATION.load();

	if (blockYelloriteOre == null) {
		blockYelloriteOre = new BlockBROre();
		GameRegistry.registerBlock(BigReactors.blockYelloriteOre, ItemBlockBigReactors.class, "YelloriteOre");
		ItemStack yelloriteStack = new ItemStack(blockYelloriteOre, 1);
		OreDictionary.registerOre("oreYellorite", yelloriteStack);
		OreDictionary.registerOre("oreYellorium", yelloriteStack); // For convenience of mods which fiddle with recipes
	}

	if(blockMetal == null) {
		blockMetal = new BlockBRMetal();
		GameRegistry.registerBlock(BigReactors.blockMetal, ItemBlockBigReactors.class, "BRMetalBlock");
		blockMetal.registerOreDictEntries();
	}

	boolean genYelloriteOre = BRConfig.CONFIGURATION.get("WorldGen", "GenerateYelloriteOre", true, "Add yellorite ore during world generation?").getBoolean(true);
	if (yelloriteOreGeneration == null && genYelloriteOre)
	{
		// Magic number: 1 = stone
		int clustersPerChunk;
		int orePerCluster;
		int maxY;
		
		clustersPerChunk = BRConfig.CONFIGURATION.get("WorldGen", "MaxYelloriteClustersPerChunk", 5, "Maximum number of clusters per chunk; will generate at least half this number, rounded down").getInt();
		orePerCluster = BRConfig.CONFIGURATION.get("WorldGen", "MaxYelloriteOrePerCluster", 10, "Maximum number of blocks to generate in each cluster; will usually generate at least half this number").getInt();
		maxY = BRConfig.CONFIGURATION.get("WorldGen", "YelloriteMaxY", 50, "Maximum height (Y coordinate) in the world to generate yellorite ore").getInt();
		int[] dimensionBlacklist = BRConfig.CONFIGURATION.get("WorldGen", "YelloriteDimensionBlacklist", new int[] {}, "Dimensions in which yellorite ore should not be generated; Nether/End automatically included").getIntList();
		
		yelloriteOreGeneration = new BRSimpleOreGenerator(blockYelloriteOre, 0, Blocks.stone,
										clustersPerChunk/2, clustersPerChunk, 4, maxY, orePerCluster);

		// Per KingLemming's request, bonus yellorite around y12. :)
		BRSimpleOreGenerator yelloriteOreGeneration2 = new BRSimpleOreGenerator(blockYelloriteOre, 0, Blocks.stone,
				1, 2, 11, 13, orePerCluster);

		if(dimensionBlacklist != null) {
			for(int dimension : dimensionBlacklist) {
				yelloriteOreGeneration.blacklistDimension(dimension);
				yelloriteOreGeneration2.blacklistDimension(dimension);
			}
		}

		BRWorldGenerator.addGenerator(BigReactors.yelloriteOreGeneration);
		BRWorldGenerator.addGenerator(yelloriteOreGeneration2);
	}
	
	BRConfig.CONFIGURATION.save();

	return new ItemStack(blockYelloriteOre);
}
 
Example 19
Source File: ModBlocks.java    From LetsModReboot with GNU General Public License v3.0 4 votes vote down vote up
public static void init()
{
    GameRegistry.registerBlock(flag, Names.Blocks.FLAG);
}
 
Example 20
Source File: CarvableHelper.java    From Chisel-2 with GNU General Public License v2.0 4 votes vote down vote up
void registerBlock(Block block, String name, Class<? extends ItemBlock> cl) {
	block.setBlockName("chisel." + name);
	GameRegistry.registerBlock(block, cl, name);
}