Java Code Examples for cpw.mods.fml.common.registry.GameRegistry

The following examples show how to use cpw.mods.fml.common.registry.GameRegistry. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: GardenCollection   Source File: ModBlocks.java    License: 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 2
Source Project: GardenCollection   Source File: TwilightForestIntegration.java    License: MIT License 6 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    try {
        classEntityFirefly = Class.forName("twilightforest.entity.passive.EntityTFTinyFirefly");
        classRenderFirefly = Class.forName("twilightforest.client.renderer.entity.RenderTFTinyFirefly");

        constEntityFirefly = classEntityFirefly.getConstructor(World.class, double.class, double.class, double.class);
        constRenderFirefly = classRenderFirefly.getConstructor();

        if (GardenStuff.proxy instanceof ClientProxy)
            registerEntity();

        Block blockFirefly = GameRegistry.findBlock(MOD_ID, "tile.TFFirefly");
        ILanternSource fireflySource = new FireflyLanternSource(blockFirefly);

        GardenAPI.instance().registries().lanternSources().registerLanternSource(fireflySource);

        initialized = true;
    }
    catch (Throwable t) { }
}
 
Example 3
Source Project: GardenCollection   Source File: ModBlocks.java    License: MIT License 6 votes vote down vote up
public void init () {
    gardenSoil = new BlockGardenSoil(makeName("gardenSoil"));
    gardenFarmland = new BlockGardenFarmland(makeName("gardenFarmland"));
    gardenProxy = new BlockGardenProxy(makeName("gardenProxy"));
    smallFire = new BlockSmallFire(makeName("smallFire"));
    compostBin = new BlockCompostBin(makeName("compostBin"));

    GameRegistry.registerBlock(gardenSoil, "garden_soil");
    GameRegistry.registerBlock(gardenFarmland, "garden_farmland");
    GameRegistry.registerBlock(gardenProxy, "garden_proxy");
    GameRegistry.registerBlock(smallFire, "small_fire");
    GameRegistry.registerBlock(compostBin, "compost_bin");

    GameRegistry.registerTileEntity(TileEntityGardenSoil.class, ModBlocks.getQualifiedName(gardenSoil));
    GameRegistry.registerTileEntity(TileEntityGardenFarmland.class, ModBlocks.getQualifiedName(gardenFarmland));
    GameRegistry.registerTileEntity(TileEntityCompostBin.class, ModBlocks.getQualifiedName(compostBin));
}
 
Example 4
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 5
@Override
public boolean registerAdditionalGolemType(String name, String modId, AdditionalGolemType newType) {
    String uniqueName = name.toUpperCase();
    if(!additionalGolemTypes.containsKey(uniqueName)) {
        GolemEnumHelper.addGolemType(uniqueName, newType);

        ItemAdditionalGolemPlacer placerItem = new ItemAdditionalGolemPlacer(newType);
        GameRegistry.registerItem(placerItem, "item" + StringHelper.firstToUpper(name.toLowerCase()) + "GolemPlacer");
        newType.setModId(modId);
        newType.setPlacerItem(placerItem);

        additionalGolemTypes.put(uniqueName, newType);
        return true;
    }
    return false;
}
 
Example 6
Source Project: GardenCollection   Source File: Botania.java    License: MIT License 6 votes vote down vote up
@Override
public boolean applyBonemeal (World world, int x, int y, int z, BlockGarden hostBlock, int slot) {
    TileEntityGarden te = hostBlock.getTileEntity(world, x, y, z);

    Block block = hostBlock.getPlantBlockFromSlot(world, x, y, z, slot);
    int meta = hostBlock.getPlantMetaFromSlot(world, x, y, z, slot);

    Block flower = GameRegistry.findBlock(MOD_ID, "flower");

    if (block == flower) {
        ItemStack upgrade = ((meta & 0x8) == 0) ? new ItemStack(flower1, 1, meta) : new ItemStack(flower2, 1, meta & 0x7);
        if (hostBlock.isPlantValidForSlot(world, x, y, z, slot, PlantItem.getForItem(upgrade))) {
            te.setInventorySlotContents(slot, upgrade);
            return true;
        }
    }

    return false;
}
 
Example 7
Source Project: EnderStorage   Source File: EnderStorageProxy.java    License: 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 8
Source Project: AdvancedMod   Source File: AdvancedMod.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
    ModBlocks.init();
    ModTileEntities.init();
    proxy.preInit();
    GameRegistry.registerWorldGenerator(new WorldGeneratorFlag(), 0);
    NetworkHandler.init();
    DescriptionHandler.init();
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
    MinecraftForge.EVENT_BUS.register(new AdvancedModEventHandler());//For registering events from the net.miencraftforge.event package.
    FMLCommonHandler.instance().bus().register(new AdvancedModEventHandler());//For registering events from the cpw.mods.fml.gameevent package.
    FMLInterModComms.sendMessage(Reference.MOD_ID, "camoMineBlacklist", new ItemStack(Blocks.stone));
    FMLInterModComms.sendMessage("Waila", "register", "com.minemaarten.advancedmod.thirdparty.waila.Waila.onWailaCall");
    Log.info("Pre Initialization Complete!");

    if(Loader.isModLoaded("Thaumcraft")) {
        loadThaumcraft();
    }
}
 
Example 9
Source Project: Chisel-2   Source File: Chisel.java    License: GNU General Public License v2.0 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
	Features.init();

	NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler());

	addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount);
	addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount);
	addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5);
	addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5);
	addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5);
	GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000);

       EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);

	proxy.init();
	MinecraftForge.EVENT_BUS.register(this);
	FMLCommonHandler.instance().bus().register(instance);

	FMLInterModComms.sendMessage("Waila", "register", "com.cricketcraft.chisel.compat.WailaCompat.register");
}
 
Example 10
Source Project: WirelessRedstone   Source File: WRLogicProxy.java    License: MIT License 6 votes vote down vote up
public void init()
{  
    MultiPartRegistry.registerParts(this, new String[]{
            "wrcbe-tran",
            "wrcbe-recv",
            "wrcbe-jamm"
    });

    MultipartGenerator.registerPassThroughInterface("codechicken.wirelessredstone.core.ITileWireless");
    MultipartGenerator.registerPassThroughInterface("codechicken.wirelessredstone.core.ITileReceiver");
    MultipartGenerator.registerPassThroughInterface("codechicken.wirelessredstone.core.ITileJammer");
    //until CC proper integration
    //MultipartGenerator.registerPassThroughInterface("dan200.computer.api.IPeripheral");
    
    itemwireless = new ItemWirelessPart().setCreativeTab(CreativeTabs.tabRedstone);
    GameRegistry.registerItem(itemwireless, "wirelessLogic");

    addRecipies();
}
 
Example 11
Source Project: MyTown2   Source File: MyTown.java    License: The Unlicense 6 votes vote down vote up
/**
 * Checks the config to see if there are any wrong values.
 * Throws an exception if there is a problem.
 */
private void checkConfig() {
    // Checking cost item
    if(EconomyProxy.isItemEconomy()) {
        String[] split = Config.instance.costItemName.get().split(":");
        if (split.length < 2 || split.length > 3) {
            throw new ConfigException("Field costItem has an invalid value. Template: (modid):(unique_name)[:meta]. Use \"minecraft\" as modid for vanilla items/blocks.");
        }

        if (GameRegistry.findItem(split[0], split[1]) == null) {
            throw new ConfigException("Field costItem has an invalid modid or unique name of the item. Template: (modid):(unique_name)[:meta]. Use \"minecraft\" as modid for vanilla items/blocks.");
        }

        if (split.length > 2 && (!StringUtils.tryParseInt(split[2]) || Integer.parseInt(split[2]) < 0)) {
            throw new ConfigException("Field costItem has an invalid metadata. Template: (modid):(unique_name)[:meta]. Use \"minecraft\" as modid for vanilla items/blocks.");
        }
    }
}
 
Example 12
Source Project: SimplyJetpacks   Source File: ItemPack.java    License: MIT License 5 votes vote down vote up
public ItemPack(ModType modType, String registryName) {
    super(ArmorMaterial.IRON, 2, 1);
    this.modType = modType;
    this.setUnlocalizedName(SimplyJetpacks.PREFIX + "pack" + modType.suffix);
    this.setHasSubtypes(true);
    this.setMaxDamage(0);
    this.setCreativeTab(ModCreativeTab.instance);
    
    GameRegistry.registerItem(this, registryName);
}
 
Example 13
Source Project: SimplyJetpacks   Source File: BCItems.java    License: MIT License 5 votes vote down vote up
public static void init() {
    SimplyJetpacks.logger.info("Stealing BuildCraft's items");
    
    if (Loader.isModLoaded("BuildCraft|Transport")) {
        pipeFluidStone = new ItemStack(GameRegistry.findItem("BuildCraft|Transport", "item.buildcraftPipe.pipefluidsstone"));
        pipeEnergyGold = new ItemStack(GameRegistry.findItem("BuildCraft|Transport", "item.buildcraftPipe.pipepowergold"));
    } else {
        pipeFluidStone = "blockGlass";
        pipeEnergyGold = "dustRedstone";
    }
    
    if (Loader.isModLoaded("BuildCraft|Energy")) {
        Block engine = GameRegistry.findBlock("BuildCraft|Core", "engineBlock");
        if (engine == null) {
            engine = GameRegistry.findBlock("BuildCraft|Energy", "engineBlock");
        }
        
        engineCombustion = new ItemStack(engine, 1, 2);
    } else {
        engineCombustion = "gearIron";
    }
    
    if (Loader.isModLoaded("BuildCraft|Factory")) {
        tank = new ItemStack(GameRegistry.findBlock("BuildCraft|Factory", "tankBlock"));
    } else {
        tank = "blockGlass";
    }
    
    if (Loader.isModLoaded("BuildCraft|Silicon")) {
        chipsetGold = new ItemStack(GameRegistry.findItem("BuildCraft|Silicon", "redstoneChipset"), 1, 2);
    } else {
        chipsetGold = "gearGold";
    }
}
 
Example 14
public static IRecipe drillTopRecipe(ItemStack output, String X, ItemStack Y) {
    if (isOreRegistered(X)) {
        for (int i = 0; i < OreDictionary.getOres(X).size(); i++) {
            return GameRegistry.addShapedRecipe(output, " Y ", "XXX", 'X', OreDictionary.getOres(X).get(i), 'Y', Y);
        }
    }
    return null;
}
 
Example 15
public static IRecipe toolRecipe(ItemStack output, ItemStack X, String Y, ItemStack Z) {
    if (isOreRegistered(Y)) {
        for (int i = 0; i < OreDictionary.getOres(Y).size(); i++) {
            return GameRegistry.addShapedRecipe(output, " X ", " Y ", "YZY", 'X', X, 'Y', OreDictionary.getOres(Y).get(i), 'Z', Z);
        }
    }
    return null;
}
 
Example 16
public void registerFuel(final ItemStack fuelStack, final int fuelValue){
    GameRegistry.registerFuelHandler(new IFuelHandler(){
        @Override
        public int getBurnTime(ItemStack fuel){
            return fuel != null && fuel.isItemEqual(fuelStack) ? fuelValue : 0;
        }
    });
}
 
Example 17
public FuelItem FindFuelValue(ItemStack pItem)
{
    try
    {
        Init();
        if (pItem == null) {
            return null;
        }

        GameRegistry.UniqueIdentifier UID = GameRegistry.findUniqueIdentifierFor(pItem.getItem());
        String tCompareName = UID.toString();
        if (pItem.getItemDamage() > 0) {
            tCompareName = String.format("%s:%d", tCompareName, pItem.getItemDamage());
        }

        for (FuelItem ifi : mFuelItems)
        {
            if (ifi.mItemName.equalsIgnoreCase(tCompareName)) {
                return ifi;
            }
        }

        return null;
    }
    catch (Exception e)
    {
        return null;
    }
}
 
Example 18
Source Project: GardenCollection   Source File: GardenTrees.java    License: MIT License 5 votes vote down vote up
@Mod.EventHandler
public void init (FMLInitializationEvent event) {
    proxy.registerRenderers();
    integration.init();

    MinecraftForge.EVENT_BUS.register(new ForgeEventHandler());
    FMLCommonHandler.instance().bus().register(new ForgeEventHandler());

    GameRegistry.registerFuelHandler(new FuelHandler());

    if (config.generateCandelilla)
        GameRegistry.registerWorldGenerator(new WorldGenCandelilla(ModBlocks.candelilla), 10);
}
 
Example 19
Source Project: BigReactors   Source File: BigReactors.java    License: MIT License 5 votes vote down vote up
public static void registerCreativeParts(int id, boolean require) {
	BRConfig.CONFIGURATION.load();
	
	boolean regCreativeParts = BRConfig.CONFIGURATION.get("General", "registerCreativeMultiblockParts", true, "If true, creative parts for reactors, turbines and other multiblocks will be registered.").getBoolean(true);
	if(regCreativeParts && BigReactors.blockMultiblockCreativePart == null) {
		BigReactors.blockMultiblockCreativePart = new BlockMBCreativePart(Material.iron);
		GameRegistry.registerBlock(BigReactors.blockMultiblockCreativePart, ItemBlockBigReactors.class, "BRMultiblockCreativePart");
	}
	
	BRConfig.CONFIGURATION.save();
}
 
Example 20
Source Project: NOVA-Core   Source File: CommonProxy.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent evt) {
	GameRegistry.registerTileEntity(FWTile.class, "novaTile");
	int globalUniqueEntityId = EntityRegistry.findGlobalUniqueEntityId();
	EntityRegistry.registerGlobalEntityID(FWEntity.class, "novaEntity", globalUniqueEntityId);
	EntityRegistry.registerModEntity(FWEntity.class, "novaEntity", globalUniqueEntityId, NovaMinecraft.instance, 64, 20, true);
}
 
Example 21
Source Project: GardenCollection   Source File: TwilightForestIntegration.java    License: MIT License 5 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    Map<String, int[]> saplingBank1 = new HashMap<String, int[]>();
    saplingBank1.put("small_oak", new int[] { 0, 7, 8, 9 });
    saplingBank1.put("large_oak", new int[] { 4, 5 });
    saplingBank1.put("small_canopy", new int[] { 1, 2, 3, 6 });

    Map<Item, Map<String, int[]>> banks = new HashMap<Item, Map<String, int[]>>();
    banks.put(Item.getItemFromBlock(GameRegistry.findBlock(MOD_ID, "tile.TFSapling")), saplingBank1);

    SaplingRegistry saplingReg = SaplingRegistry.instance();

    for (Map.Entry<Item, Map<String, int[]>> entry : banks.entrySet()) {
        Item sapling = entry.getKey();

        for (Map.Entry<String, int[]> bankEntry : entry.getValue().entrySet()) {
            OrnamentalTreeFactory factory = OrnamentalTreeRegistry.getTree(bankEntry.getKey());
            if (factory == null)
                continue;

            for (int i : bankEntry.getValue()) {
                UniqueMetaIdentifier woodBlock = saplingReg.getWoodForSapling(sapling, i);
                UniqueMetaIdentifier leafBlock = saplingReg.getLeavesForSapling(sapling, i);
                if (woodBlock == null || leafBlock == null)
                    continue;

                saplingReg.putExtendedData(sapling, i, "sm_generator",
                    factory.create(woodBlock.getBlock(), woodBlock.meta, leafBlock.getBlock(), leafBlock.meta));
            }
        }
    }
}
 
Example 22
Source Project: PneumaticCraft   Source File: ComputerCraft.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void init(){
    if(Loader.isModLoaded(ModIds.OPEN_COMPUTERS)) super.init();
    Block modem = GameRegistry.findBlock(ModIds.COMPUTERCRAFT, "CC-Peripheral");
    if(modem != null) {
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(droneInterface), true, " u ", "mp ", "iii", 'u', new ItemStack(Itemss.machineUpgrade, 1, ItemMachineUpgrade.UPGRADE_RANGE), 'm', new ItemStack(modem, 1, 1), 'p', Itemss.printedCircuitBoard, 'i', Names.INGOT_IRON_COMPRESSED));
    } else {
        Log.error("Wireless Modem block not found! Using the backup recipe");
        GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(droneInterface), true, " u ", "mp ", "iii", 'u', new ItemStack(Itemss.machineUpgrade, 1, ItemMachineUpgrade.UPGRADE_RANGE), 'm', Items.ender_pearl, 'p', Itemss.printedCircuitBoard, 'i', Names.INGOT_IRON_COMPRESSED));
    }
}
 
Example 23
Source Project: PneumaticCraft   Source File: BuildCraft.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void init(){
    ItemStack stoneGear = PneumaticCraftUtils.getBuildcraftItemStack(EnumBuildcraftModule.CORE, "stoneGearItem");

    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Itemss.compressedIronGear), " i ", "isi", " i ", 'i', Names.INGOT_IRON_COMPRESSED, 's', stoneGear));

    //PneumaticRegistry.getInstance().registerFuel(FluidRegistry.getFluid("fuel"), 1500000);
}
 
Example 24
private static <T extends Item> T registerItem(String modId, T item, String name) {
    Injector modController = new Injector(new Injector(Loader.instance(), Loader.class).getField("modController"), LoadController.class);
    Object old = modController.getField("activeContainer");
    modController.setField("activeContainer", Loader.instance().getIndexedModList().get(modId));

    GameRegistry.registerItem(item, name);

    modController.setField("activeContainer", old);
    return item;
}
 
Example 25
public static void addCarversRecipes() {
    for (int i = 0; i < OreDictionary.getOres("logWood").size(); i++) {
        woodenCarver = GameRegistry.addShapedRecipe(BaseItemStacks.woodenCarver, " X ", "YYY", 'X', Items.flint, 'Y', OreDictionary.getOres("logWood").get(i));
    }
    stoneCarver = GameRegistry.addShapedRecipe(BaseItemStacks.stoneCarver, " X ", "YYY", 'X', Items.flint, 'Y', Blocks.stone);
    ironCarver = GameRegistry.addShapedRecipe(BaseItemStacks.ironCarver, " X ", "YYY", 'X', BaseItemStacks.ironShard, 'Y', Blocks.stone);
    obsidianCarver = GameRegistry.addShapedRecipe(BaseItemStacks.obsidianCarver, " X ", "YYY", 'X', BaseItemStacks.ironShard, 'Y', Blocks.obsidian);
    diamondCarver = GameRegistry.addShapedRecipe(BaseItemStacks.ironCarver, " X ", "YYY", "ZZZ", 'X', BaseItemStacks.obsidianShard, 'Y', Items.diamond, 'Z', Blocks.obsidian);
}
 
Example 26
public static IRecipe chainsawTopRecipe(ItemStack output, String X, ItemStack Y) {
    if (isOreRegistered(X)) {
        for (int i = 0; i < OreDictionary.getOres(X).size(); i++) {
            return GameRegistry.addShapedRecipe(output, " Y ", "XYX", "XYX", 'X', OreDictionary.getOres(X).get(i), 'Y', Y);
        }
    }
    return null;
}
 
Example 27
Source Project: Et-Futurum   Source File: ModItems.java    License: The Unlicense 5 votes vote down vote up
private static void registerItem(Item item) {
	if (!(item instanceof IConfigurable) || ((IConfigurable) item).isEnabled()) {
		String name = item.getUnlocalizedName();
		String[] strings = name.split("\\.");
		GameRegistry.registerItem(item, strings[strings.length - 1]);
	}
}
 
Example 28
public static void registerTEs() {

        GameRegistry.registerTileEntity(TileEntityPotentiaGenerator.class, "tileentitypotentiagenerator");
        GameRegistry.registerTileEntity(TileEntityIgnisGenerator.class, "tileentityignisgenerator");
        GameRegistry.registerTileEntity(TileEntityAuramGenerator.class, "tileentityauramgenerator");
        GameRegistry.registerTileEntity(TileEntityArborGenerator.class, "tileentityarborgenerator");
        GameRegistry.registerTileEntity(TileEntityAerGenerator.class, "tileentityaergenerator");
        GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge");
        GameRegistry.registerTileEntity(TileEntityCompressedSolar.class, "tileentitycompressedsolar");
        GameRegistry.registerTileEntity(TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar");
        GameRegistry.registerTileEntity(TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar");
        GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator");
        GameRegistry.registerTileEntity(TileEntityWaterSolar.class, "tileentitywatersolar");
        GameRegistry.registerTileEntity(TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar");
        GameRegistry.registerTileEntity(TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar");
        GameRegistry.registerTileEntity(TileEntityDarkSolar.class, "tileentitydarksolar");
        GameRegistry.registerTileEntity(TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar");
        GameRegistry.registerTileEntity(TileEntityTripleDarkSolar.class, "tileentitytripledarksolar");
        GameRegistry.registerTileEntity(TileEntityOrderSolar.class, "tileentityordersolar");
        GameRegistry.registerTileEntity(TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar");
        GameRegistry.registerTileEntity(TileEntityTripleOrderSolar.class, "tileentitytripleordersolar");
        GameRegistry.registerTileEntity(TileEntityFireSolar.class, "tileentityfiresolar");
        GameRegistry.registerTileEntity(TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar");
        GameRegistry.registerTileEntity(TileEntityTripleFireSolar.class, "tileentitytriplefiresolar");
        GameRegistry.registerTileEntity(TileEntityAirSolar.class, "tileentityairsolar");
        GameRegistry.registerTileEntity(TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar");
        GameRegistry.registerTileEntity(TileEntityTripleAirSolar.class, "tileentitytripleairsolar");
        GameRegistry.registerTileEntity(TileEntityEarthSolar.class, "tileentityearthsolar");
        GameRegistry.registerTileEntity(TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar");
        GameRegistry.registerTileEntity(TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar");
        GameRegistry.registerTileEntity(TileEntityEssentiaGenerator.class, "tileentityessentiagenerator");
    }
 
Example 29
Source Project: PneumaticCraft   Source File: BlockSupplier.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * @param blockName
 * @return
 */
public static Block getBlock(String blockName){
    return GameRegistry.findBlock("PneumaticCraft", blockName);
    /*try {
        if(blockClass == null) blockClass = Class.forName("pneumaticCraft.common.block.Blockss");
        return (Block)blockClass.getField(blockName).get(null);
    } catch(Exception e) {
        System.err.println("[PneumaticCraft API] Block supply failed for block: " + blockName);
        return null;
    }*/
}
 
Example 30
@EventHandler
public void onMissingMapping(FMLMissingMappingsEvent event){
    for(MissingMapping mapping : event.get()) {
        if(mapping.type == GameRegistry.Type.BLOCK && mapping.name.equals("PneumaticCraft:etchingAcid")) {
            mapping.remap(Fluids.etchingAcid.getBlock());
            Log.info("Remapping Etching Acid");
        }
        if(mapping.type == GameRegistry.Type.ITEM && mapping.name.equals("PneumaticCraft:etchingAcidBucket")) {
            mapping.remap(Fluids.getBucket(Fluids.etchingAcid));
            Log.info("Remapping Etching Acid Bucket");
        }

    }
}
 
Example 31
Source Project: GardenCollection   Source File: NaturaIntegration.java    License: MIT License 5 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    Map<String, int[]> saplingBank1 = new HashMap<String, int[]>();
    saplingBank1.put("small_oak", new int[] { 1, 3, 4, 6, 7 });
    saplingBank1.put("large_spruce", new int[] { 0 });
    saplingBank1.put("small_shrub", new int[] { 2 });

    Map<String, int[]> saplingBank2 = new HashMap<String, int[]>();
    saplingBank2.put("small_oak", new int[] { 0, 1, 3 });
    saplingBank2.put("tall_small_oak", new int[] { 2 });
    saplingBank2.put("small_willow", new int[] { 4 });

    Map<Item, Map<String, int[]>> banks = new HashMap<Item, Map<String, int[]>>();
    banks.put(GameRegistry.findItem(MOD_ID, "florasapling"), saplingBank1);
    banks.put(GameRegistry.findItem(MOD_ID, "Rare Sapling"), saplingBank2);

    SaplingRegistry saplingReg = SaplingRegistry.instance();

    for (Map.Entry<Item, Map<String, int[]>> entry : banks.entrySet()) {
        Item sapling = entry.getKey();

        for (Map.Entry<String, int[]> bankEntry : entry.getValue().entrySet()) {
            OrnamentalTreeFactory factory = OrnamentalTreeRegistry.getTree(bankEntry.getKey());
            if (factory == null)
                continue;

            for (int i : bankEntry.getValue()) {
                UniqueMetaIdentifier woodBlock = saplingReg.getWoodForSapling(sapling, i);
                UniqueMetaIdentifier leafBlock = saplingReg.getLeavesForSapling(sapling, i);
                if (woodBlock == null && leafBlock == null)
                    continue;

                saplingReg.putExtendedData(sapling, i, "sm_generator",
                    factory.create(woodBlock.getBlock(), woodBlock.meta, leafBlock.getBlock(), leafBlock.meta));
            }
        }
    }
}
 
Example 32
Source Project: Framez   Source File: BlockSupplier.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * @param blockName
 * @return
 */
public static Block getBlock(String blockName){
    return GameRegistry.findBlock("PneumaticCraft", blockName);
    /*try {
        if(blockClass == null) blockClass = Class.forName("pneumaticCraft.common.block.Blockss");
        return (Block)blockClass.getField(blockName).get(null);
    } catch(Exception e) {
        System.err.println("[PneumaticCraft API] Block supply failed for block: " + blockName);
        return null;
    }*/
}
 
Example 33
Source Project: PneumaticCraft   Source File: ClientProxy.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void init(){
    for(int i = 0; i < 16; i++) { //Only register these recipes client side, so NEI compatibility works, but drones don't lose their program when dyed.
        ItemStack drone = new ItemStack(Itemss.drone);
        NBTTagCompound tag = new NBTTagCompound();
        tag.setInteger("color", ItemDye.field_150922_c[i]);
        drone.setTagCompound(tag);
        GameRegistry.addRecipe(new ShapelessOreRecipe(drone, Itemss.drone, TileEntityPlasticMixer.DYES[i]));
    }
    CraftingRegistrator.addShapelessRecipe(new ItemStack(Itemss.drone), new ItemStack(Itemss.logisticsDrone), Itemss.printedCircuitBoard);

    ThirdPartyManager.instance().clientInit();
}
 
Example 34
Source Project: BigReactors   Source File: BigReactors.java    License: MIT License 5 votes vote down vote up
public static void registerFuelRods(int id, boolean require) {
	if(BigReactors.blockYelloriumFuelRod == null) {
		BRConfig.CONFIGURATION.load();
		BigReactors.blockYelloriumFuelRod = new BlockFuelRod(Material.iron);
		GameRegistry.registerBlock(BigReactors.blockYelloriumFuelRod, ItemBlock.class, "YelloriumFuelRod");
		BRConfig.CONFIGURATION.save();
	}
}
 
Example 35
Source Project: OpenPeripheral-Addons   Source File: ItemIcon.java    License: MIT License 5 votes vote down vote up
private static ItemStack findDrawStack(String itemId, int meta) {
	if (Strings.isNullOrEmpty(itemId)) return null;
	String[] itemSplit = itemId.split(":");
	if (itemSplit.length != 2) return null;

	Item item = GameRegistry.findItem(itemSplit[0], itemSplit[1]);
	if (item == null) return null;

	return new ItemStack(item, 1, meta);
}
 
Example 36
Source Project: GardenCollection   Source File: ThaumcraftIntegration.java    License: MIT License 5 votes vote down vote up
private static void initWood () {
    Block log = GameRegistry.findBlock(MOD_ID, "blockMagicalLog");
    Block leaf = GameRegistry.findBlock(MOD_ID, "blockMagicalLeaves");

    Item sapling = Item.getItemFromBlock(GameRegistry.findBlock(MOD_ID, "blockCustomPlant"));

    WoodRegistry woodReg = WoodRegistry.instance();
    woodReg.registerWoodType(log, 0);
    woodReg.registerWoodType(log, 1);

    SaplingRegistry saplingReg = SaplingRegistry.instance();
    saplingReg.registerSapling(sapling, 0, log, 0, leaf, 0); // Greatwood
    saplingReg.registerSapling(sapling, 1, log, 1, leaf, 1); // Silverwood
}
 
Example 37
Source Project: Chisel   Source File: BlockNameConversion.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static Item findItem(String oldname)
{
    FMLLog.getLogger().trace("findItem() START " + oldname);
    Item item = null;
    for (int i = 0; i < NameConversions.MAX && item == null; i++)
    {
        FMLLog.getLogger().trace("findItem()       Checking for " + NameConversions.conversion(oldname, i));
        item = GameRegistry.findItem(Chisel.MOD_ID, NameConversions.conversion(oldname, i));
    }

    return item;
}
 
Example 38
Source Project: ExtraCells1   Source File: CommonProxy.java    License: MIT License 5 votes vote down vote up
public void RegisterTileEntities()
{
	GameRegistry.registerTileEntity(TileEntitySolderingStation.class, "tileEntitySolderingStation");
	GameRegistry.registerTileEntity(TileEntityMEDropper.class, "tileEntityMEDropper");
	GameRegistry.registerTileEntity(TileEntityMEBattery.class, "tileEntityMEBattery");
	GameRegistry.registerTileEntity(TileEntityHardMEDrive.class, "tileEntityHardMEDrive");
	GameRegistry.registerTileEntity(TileEntityBusFluidImport.class, "tileEntityBusFluidImport");
	GameRegistry.registerTileEntity(TileEntityBusFluidExport.class, "tileEntityBusFluidExport");
	GameRegistry.registerTileEntity(TileEntityBusFluidStorage.class, "tileEntityBusFluidStorage");
	GameRegistry.registerTileEntity(TileEntityTerminalFluid.class, "tileEntityTerminalFluid");
	GameRegistry.registerTileEntity(TileEntityTransitionPlaneFluid.class, "tileEntityTransitionPlaneFluid");
	GameRegistry.registerTileEntity(TileEntityCertusTank.class, "tileEntityCertusTank");
	GameRegistry.registerTileEntity(TileEntityWalrus.class, "tileEntityWalrus");
	GameRegistry.registerTileEntity(TileEntityLevelEmitterFluid.class, "tileEntityLevelEmitterFluid");
	GameRegistry.registerTileEntity(TileEntityVoidFluid.class, "tileEntityVoidFluid");
	GameRegistry.registerTileEntity(TileEntityInterfaceFluid.class, "tileEntityInterfaceFluid");
	GameRegistry.registerTileEntity(TileEntityMonitorStorageFluid.class, "tileEntityMonitorStorageFluid");

	try
	{
		Class.forName("appeng.api.me.util.ITileCraftingProvider");
		GameRegistry.registerTileEntity(TileEntityFluidCrafter.class, "tileEntityFluidCrafter");
	} catch (ClassNotFoundException e)
	{
		// AE13
	}
}
 
Example 39
Source Project: GardenCollection   Source File: ModItems.java    License: MIT License 5 votes vote down vote up
public void init () {
    candelilla_seeds = new ItemSeeds(ModBlocks.candelilla).setUnlocalizedName(makeName("candelillaSeeds")).setTextureName(GardenTrees.MOD_ID + ":candelilla_seeds");
    candelilla = new Item().setUnlocalizedName(makeName("candelilla")).setCreativeTab(ModCreativeTabs.tabGardenTrees).setTextureName(GardenTrees.MOD_ID + ":candelilla");

    GameRegistry.registerItem(candelilla_seeds, "candelilla_seeds");
    GameRegistry.registerItem(candelilla, "candelilla");
}
 
Example 40
Source Project: Ex-Aliquo   Source File: Registries.java    License: MIT License 5 votes vote down vote up
static void registerOreCrafting()
{
	for (int i = 0; i < 3; i++)
	{
		GameRegistry.addShapedRecipe(new ItemStack(cobaltOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(cobaltOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(arditeOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(arditeOreItem, 1, i)});
		
		GameRegistry.addShapedRecipe(new ItemStack(adamantineOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(adamantineOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(alduoriteOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(alduoriteOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(astralsilverOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(astralsilverOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(atlarusOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(atlarusOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(carmotOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(carmotOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(ceruclaseOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(ceruclaseOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(deepironOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(deepironOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(eximiteOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(eximiteOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(ignatiusOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(ignatiusOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(infuscoliumOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(infuscoliumOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(kalendriteOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(kalendriteOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(lemuriteOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(lemuriteOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(manganeseOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(manganeseOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(meutoiteOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(meutoiteOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(midasiumOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(midasiumOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(mithrilOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(mithrilOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(orichalcumOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(orichalcumOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(oureclaseOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(oureclaseOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(prometheumOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(prometheumOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(rubraciumOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(adamantineOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(sanguiniteOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(rubraciumOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(shadowironOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(shadowironOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(vulcaniteOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(vulcaniteOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(vyroxeresOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(vyroxeresOreItem, 1, i)});
		GameRegistry.addShapedRecipe(new ItemStack(zincOreBlock, 1, i), new Object[] { oreshape, 'i', new ItemStack(zincOreItem, 1, i)});
	}
}