cpw.mods.fml.common.Loader Java Examples

The following examples show how to use cpw.mods.fml.common.Loader. 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: Waila.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
public static void callbackRegister(IWailaRegistrar registrar){
    registrar.registerBodyProvider(new WailaPneumaticHandler(), IPneumaticMachine.class);
    registrar.registerBodyProvider(new WailaHeatHandler(), IHeatExchanger.class);
    registrar.registerBodyProvider(new WailaPlantHandler(), BlockPneumaticPlantBase.class);
    registrar.registerBodyProvider(new WailaSemiBlockHandler(), Block.class);
    registrar.registerBodyProvider(new WailaRedstoneControl(), IRedstoneControl.class);
    registrar.registerBodyProvider(new WailaTubeModuleHandler(), TileEntityPressureTube.class);
    registrar.registerNBTProvider(new WailaPneumaticHandler(), IPneumaticMachine.class);
    registrar.registerNBTProvider(new WailaHeatHandler(), IHeatExchanger.class);
    registrar.registerNBTProvider(new WailaTubeModuleHandler(), TileEntityPressureTube.class);
    registrar.registerNBTProvider(new WailaSemiBlockHandler(), Block.class);
    registrar.registerNBTProvider(new WailaRedstoneControl(), IRedstoneControl.class);

    if(Loader.isModLoaded(ModIds.FMP)) {
        registrar.registerBodyProvider(new WailaFMPHandler(), "tile.pressureTube");
        registrar.registerBodyProvider(new WailaFMPHandler(), "tile.advancedPressureTube");
    }
}
 
Example #2
Source File: EtFuturum.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);

	ModRecipes.init();

	proxy.registerEvents();
	proxy.registerEntities();
	proxy.registerRenderers();

	if (ModEntityList.hasEntitiesWithEggs()) {
		ModEntityList.entity_egg = new ItemEntityEgg();
		GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg");
		OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg);
	}

	isTinkersConstructLoaded = Loader.isModLoaded("TConstruct");
}
 
Example #3
Source File: TwilightForestIntegration.java    From GardenCollection with 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 #4
Source File: RegisteredIntegrations.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
private static void registerDependent(String modId, String clazz) {
    if(!Loader.isModLoaded(modId)) {
        return;
    }

    Object integration;
    try {
        integration = Injector.getClass(clazz).newInstance();
    } catch (Throwable e) {//InstantiationException | IllegalAccessException
        return;
    }

    if(integration instanceof IntegrationMod) {
        ((IntegrationMod) integration).init();
    }
}
 
Example #5
Source File: IntegrationRegistry.java    From GardenCollection with MIT License 6 votes vote down vote up
public void init () {
    for (int i = 0; i < registry.size(); i++) {
        IntegrationModule module = registry.get(i);
        if (module.getModID() != null && !Loader.isModLoaded(module.getModID())) {
            registry.remove(i--);
            continue;
        }

        try {
            module.init();
        }
        catch (Throwable t) {
            registry.remove(i--);
            FMLLog.log(GardenStuff.MOD_ID, Level.INFO, "Could not load integration module: " + module.getClass().getName() + " (init)");
        }
    }
}
 
Example #6
Source File: AdvancedGolemProvider.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public List<String> getWailaTail(Entity paramEntity, List<String> strings, IWailaEntityAccessor data, IWailaConfigHandler config) {
    if(data.getEntity() instanceof EntityGolemBase) {
        AdditionalGolemType type = GadomancyApi.getAdditionalGolemType(((EntityGolemBase) data.getEntity()).getGolemType());
        if(type != null && strings.size() > 0) {
            String oldMod = strings.get(strings.size() - 1);

            ModContainer container = Loader.instance().getIndexedModList().get(type.getModId());
            if(container != null) {
                String mod = ColorHelper.extractColors(oldMod) + container.getName();

                strings.remove(strings.size() - 1);
                strings.add(mod);
            }
        }
    }
    return strings;
}
 
Example #7
Source File: Crossmod.java    From Ex-Aliquo with MIT License 6 votes vote down vote up
public static void initCross()
{
	if (isArsMagicaLoaded && isTConLoaded)
	{
		ArsMagica_Tinker.SmeltArs();
	}
	if (isThaumcraftLoaded && isNetherOresLoaded)
	{
		NetherOres_Thaumcraft.Whenk();
	}
	if (isExtraTICLoaded && isMetallurgyLoaded)
	{
		ExtraTic_Metallurgy.SmeltMetallurgy();
	}
	if (isExtraTICLoaded && Loader.isModLoaded("Mekanisum"))
	{
		ExtraTic_Mekanism.SmeltMekanism();
	}
	CropXYZ.Shoukan();
}
 
Example #8
Source File: GuiProgrammer.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void drawGuiContainerForegroundLayer(int x, int y){
    super.drawGuiContainerForegroundLayer(x, y);

    boolean igwLoaded = Loader.isModLoaded(ModIds.IGWMOD);
    fontRendererObj.drawString(widgetPage + 1 + "/" + (maxPage + 1), 305, 175, 0xFF000000);
    fontRendererObj.drawString(I18n.format("gui.programmer.difficulty"), 263, 190, 0xFF000000);

    if(showingWidgetProgress == 0) {
        programmerUnit.renderForeground(x, y, draggingWidget);
    }

    for(IProgWidget widget : visibleSpawnWidgets) {
        if(widget != draggingWidget && x - guiLeft >= widget.getX() && y - guiTop >= widget.getY() && x - guiLeft <= widget.getX() + widget.getWidth() / 2 && y - guiTop <= widget.getY() + widget.getHeight() / 2) {
            List<String> tooltip = new ArrayList<String>();
            widget.getTooltip(tooltip);
            if(igwLoaded) tooltip.add(I18n.format("gui.programmer.pressIForInfo"));
            if(tooltip.size() > 0) drawHoveringString(tooltip, x - guiLeft, y - guiTop, fontRendererObj);
        }
    }

}
 
Example #9
Source File: GT_CustomLoader.java    From NewHorizonsCoreMod with GNU General Public License v3.0 6 votes vote down vote up
public void run()
{
	GameRegistry.registerItem(QuantumBread.Instance(), "itemQuantumToast");
	if (Loader.isModLoaded("EnderIO"))
        FrankenskullFix.fixEnderIO();
	MaterialLoader.run();
	FluidPipeLoader.run();
	WireLoader.run();
    CasingLoader.run();
	ItemLoader.run();
	MachineLoader.run();
	BatteryLoader.run();
	Remover.run();
    MachineRecipeLoader.run();
    CraftingRecipeLoader.run();
    OreDictionary.run();
}
 
Example #10
Source File: ModIntegration.java    From GardenCollection with MIT License 6 votes vote down vote up
public void postInit () {
    IntegrationRegistry.instance().postInit();

    //BiomesOPlenty.init();
    ExtraBiomesXLIntegration.init();
    NaturaIntegration.init();
    TwilightForestIntegration.init();
    WeeeFlowersIntegration.init();
    //Botania.init();
    ThaumcraftIntegration.init();
    //AgriCraft.init();
    MineTweakerIntegration.init();
    WitcheryIntegration.init();

    if (Loader.isModLoaded("plantmegapack"))
        PlantMegaPackIntegration.init();
}
 
Example #11
Source File: WeeeFlowersIntegration.java    From GardenCollection with MIT License 6 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    String[] pamColors = new String[] { "White", "Orange", "Magenta", "Light Blue", "Yellow", "Lime", "Pink",
        "Light Grey", "Dark Grey", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black" };

    PlantRegistry plantReg = PlantRegistry.instance();

    for (int i : new int[] { 3, 4, 5, 6, 8, 9, 10, 11, 12 })
        plantReg.registerPlantInfo(MOD_ID, "Flower", i, new SimplePlantInfo(PlantType.GROUND, PlantSize.LARGE));

    for (String color : pamColors) {
        plantReg.registerPlantInfo(MOD_ID, color + " Flower Crop", new SimplePlantInfo(PlantType.GROUND, PlantSize.FULL));
        plantReg.registerPlantInfo(MOD_ID, color + " Vine", new SimplePlantInfo(PlantType.HANGING_SIDE, PlantSize.LARGE));
    }
}
 
Example #12
Source File: WitcheryIntegration.java    From GardenCollection with MIT License 6 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    initWood();

    GardenCoreAPI.instance().registerBonemealHandler(new BonemealHandler());

    PlantRegistry plantReg = PlantRegistry.instance();

    plantReg.registerPlantInfo(MOD_ID, "embermoss", new SimplePlantInfo(PlantType.GROUND, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "leapinglily", new SimplePlantInfo(PlantType.AQUATIC_COVER, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "spanishmoss", new SimplePlantInfo(PlantType.HANGING_SIDE, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "bramble", new SimplePlantInfo(PlantType.GROUND, PlantSize.FULL));
    plantReg.registerPlantInfo(MOD_ID, "glintweed", new SimplePlantInfo(PlantType.GROUND, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "voidbramble", new SimplePlantInfo(PlantType.GROUND, PlantSize.FULL));

    plantReg.registerPlantInfo(MOD_ID, "seedsartichoke", 0, new SimplePlantInfo(PlantType.AQUATIC_SURFACE, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "seedswormwood", 0, new SimplePlantInfo(PlantType.GROUND, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "seedsmandrake", 0, new SimplePlantInfo(PlantType.GROUND, PlantSize.FULL));
    plantReg.registerPlantInfo(MOD_ID, "seedswolfsbane", 0, new SimplePlantInfo(PlantType.GROUND, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "seedsbelladonna", 0, new SimplePlantInfo(PlantType.GROUND, PlantSize.FULL));
    plantReg.registerPlantInfo(MOD_ID, "seedssnowbell", 0, new SimplePlantInfo(PlantType.GROUND, PlantSize.LARGE));
    plantReg.registerPlantInfo(MOD_ID, "garlic", 0, new SimplePlantInfo(PlantType.GROUND, PlantSize.FULL));
}
 
Example #13
Source File: GuiLogisticsRequester.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void initGui(){
    super.initGui();
    addAnimatedStat("gui.tab.info.ghostSlotInteraction.title", new ItemStack(Blocks.hopper), 0xFF00AAFF, true).setText("gui.tab.info.ghostSlotInteraction");
    if(Loader.isModLoaded(ModIds.AE2)) {
        if(logistics.isPlacedOnInterface()) {
            Item item = GameRegistry.findItem(ModIds.AE2, "item.ItemMultiPart");
            if(item == null) {
                Log.warning("AE2 cable couldn't be found!");
                item = Itemss.logisticsFrameRequester;
            }
            GuiAnimatedStat stat = addAnimatedStat("gui.tab.info.logisticsRequester.aeIntegration.title", new ItemStack(item, 1, 16), 0xFF00AAFF, false);
            List<String> text = new ArrayList<String>();
            for(int i = 0; i < 2; i++)
                text.add("");
            text.add("gui.tab.info.logisticsRequester.aeIntegration");
            stat.setText(text);
            stat.addWidget(aeIntegration = new GuiCheckBox(1, 16, 13, 0xFF000000, "gui.tab.info.logisticsRequester.aeIntegration.enable"));
        }
    }
}
 
Example #14
Source File: GuiModIdConfig.java    From ehacks-pro with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) {
    this.drawDefaultBackground();
    this.drawCenteredString(this.fontRendererObj, "ModID configuration", this.width / 2, 15, 16777215);
    this.modId.drawTextBox();
    this.modVersion.drawTextBox();
    boolean nameOk = true;
    for (ModContainer container : Loader.instance().getActiveModList()) {
        if ((container.getModId() == null ? this.modId.getText() == null : container.getModId().equals(this.modId.getText())) && container.getMod() != INSTANCE) {
            nameOk = false;
            break;
        }
    }
    this.saveButton.enabled = "".equals(this.modId.getText()) || nameOk;
    this.drawString(this.fontRendererObj, "Mod ID (empty - no mod)", this.width / 2 - 100, this.height / 6 + 66 - 13, 16777215);
    this.drawString(this.fontRendererObj, "Mod Version", this.width / 2 - 100, this.height / 6 + 66 + 36 - 13, 16777215);
    super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
}
 
Example #15
Source File: Nan0EventRegistar.java    From ehacks-pro with GNU General Public License v3.0 6 votes vote down vote up
public static void register(EventBus bus, Object target) {
    ConcurrentHashMap<Object, ArrayList<IEventListener>> listeners = ReflectionHelper.getPrivateValue(EventBus.class, bus, "listeners");
    Map<Object, ModContainer> listenerOwners = ReflectionHelper.getPrivateValue(EventBus.class, bus, "listenerOwners");
    if (listeners.containsKey(target)) {
        return;
    }
    ModContainer activeModContainer = Loader.instance().getMinecraftModContainer();
    listenerOwners.put(target, activeModContainer);
    ReflectionHelper.setPrivateValue(EventBus.class, bus, listenerOwners, "listenerOwners");
    Set<? extends Class<?>> supers = TypeToken.of(target.getClass()).getTypes().rawTypes();
    for (Method method : target.getClass().getMethods()) {
        for (Class<?> cls : supers) {
            try {
                Method real = cls.getDeclaredMethod(method.getName(), method.getParameterTypes());
                if (real.isAnnotationPresent(SubscribeEvent.class)) {
                    Class<?>[] parameterTypes = method.getParameterTypes();
                    Class<?> eventType = parameterTypes[0];
                    register(bus, eventType, target, method, activeModContainer);
                    break;
                }
            } catch (NoSuchMethodException ignored) {
            }
        }
    }
}
 
Example #16
Source File: Info.java    From Electro-Magic-Tools with GNU General Public License v3.0 5 votes vote down vote up
public static boolean isIc2Available() {
    if (ic2Available != null) return ic2Available;

    boolean loaded = Loader.isModLoaded("IC2");

    if (Loader.instance().hasReachedState(LoaderState.CONSTRUCTING)) {
        ic2Available = loaded;
    }

    return loaded;
}
 
Example #17
Source File: GuiHelmetMainOptions.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void initGui(IGuiScreen gui){
    gui.getButtonList().add(new GuiButton(10, 30, 128, 150, 20, "Move Pressure Stat Screen..."));
    gui.getButtonList().add(new GuiButton(11, 30, 150, 150, 20, "Move Message Screen..."));
    if(!Loader.isModLoaded(ModIds.NOT_ENOUGH_KEYS)) {
        changeKeybindingButton = new GuiButton(12, 30, 172, 150, 20, "Change open menu key...");
        gui.getButtonList().add(changeKeybindingButton);
    }
}
 
Example #18
Source File: PneumaticCraft.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void PreInit(FMLPreInitializationEvent event){
    event.getModMetadata().version = Versions.fullVersionString();
    isNEIInstalled = Loader.isModLoaded(ModIds.NEI);

    PneumaticRegistry.init(PneumaticCraftAPIHandler.getInstance());
    UpgradeRenderHandlerList.init();
    SensorHandler.init();
    Config.init(event.getSuggestedConfigurationFile());
    ThirdPartyManager.instance().index();

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    tabPneumaticCraft = new CreativeTabPneumaticCraft("tabPneumaticCraft");
    Fluids.initFluids();
    Blockss.init();
    Itemss.init();
    HackableHandler.addDefaultEntries();
    ModuleRegistrator.init();
    WidgetRegistrator.init();
    ThirdPartyManager.instance().preInit();
    TileEntityRegistrator.init();
    EntityRegistrator.init();
    SemiBlockInitializer.init();
    CraftingRegistrator.init();
    VillagerHandler.instance().init();
    GameRegistry.registerWorldGenerator(new WorldGeneratorPneumaticCraft(), 0);
    AchievementHandler.init();
    HeatBehaviourManager.getInstance().init();

    proxy.registerRenders();
    proxy.registerHandlers();
    tickHandler = new TickHandlerPneumaticCraft();
    FMLCommonHandler.instance().bus().register(tickHandler);
    MinecraftForge.EVENT_BUS.register(new EventHandlerPneumaticCraft());
    MinecraftForge.EVENT_BUS.register(new EventHandlerUniversalSensor());
    MinecraftForge.EVENT_BUS.register(new DroneSpecialVariableHandler());

    FMLCommonHandler.instance().bus().register(new CraftingHandler());
    FMLCommonHandler.instance().bus().register(new Config());
}
 
Example #19
Source File: OpenComputers.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void init(){
    if(!Loader.isModLoaded(ModIds.COMPUTERCRAFT)) {
        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));
    }
    if(Loader.isModLoaded(ModIds.OPEN_COMPUTERS)) {
        initializeDrivers();
    }
}
 
Example #20
Source File: CommandDump.java    From OpenPeripheral with MIT License 5 votes vote down vote up
private static String getModVersion() {
	try {
		return Loader.instance().getIndexedModList().get(ModInfo.ID).getDisplayVersion();
	} catch (Exception e) {
		Log.info(e, "Failed to get OpenPeripheral version");
	}
	return "unknown";
}
 
Example #21
Source File: ComputerCraft.java    From PneumaticCraft with 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 #22
Source File: SemiBlockInitializer.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
public static void init(){
    MinecraftForge.EVENT_BUS.register(SemiBlockManager.getServerInstance());
    FMLCommonHandler.instance().bus().register(SemiBlockManager.getServerInstance());
    Class requesterClass = Loader.isModLoaded(ModIds.AE2) ? SemiBlockRequesterAE.class : SemiBlockRequester.class;

    registerSemiBlock(SemiBlockActiveProvider.ID, SemiBlockActiveProvider.class, false);
    registerSemiBlock(SemiBlockPassiveProvider.ID, SemiBlockPassiveProvider.class, false);
    registerSemiBlock(SemiBlockStorage.ID, SemiBlockStorage.class, false);
    registerSemiBlock(SemiBlockDefaultStorage.ID, SemiBlockDefaultStorage.class, false);
    registerSemiBlock(SemiBlockRequester.ID, requesterClass, false);
    registerSemiBlock("heatFrame", SemiBlockHeatFrame.class);

    PneumaticCraft.proxy.registerSemiBlockRenderer((ItemSemiBlockBase)Itemss.logisticsFrameRequester);
    SemiBlockManager.registerSemiBlockToItemMapping(requesterClass, Itemss.logisticsFrameRequester);

    PneumaticCraft.proxy.registerSemiBlockRenderer((ItemSemiBlockBase)Itemss.logisticsFrameDefaultStorage);
    SemiBlockManager.registerSemiBlockToItemMapping(SemiBlockDefaultStorage.class, Itemss.logisticsFrameDefaultStorage);

    PneumaticCraft.proxy.registerSemiBlockRenderer((ItemSemiBlockBase)Itemss.logisticsFrameStorage);
    SemiBlockManager.registerSemiBlockToItemMapping(SemiBlockStorage.class, Itemss.logisticsFrameStorage);

    PneumaticCraft.proxy.registerSemiBlockRenderer((ItemSemiBlockBase)Itemss.logisticsFramePassiveProvider);
    SemiBlockManager.registerSemiBlockToItemMapping(SemiBlockPassiveProvider.class, Itemss.logisticsFramePassiveProvider);

    PneumaticCraft.proxy.registerSemiBlockRenderer((ItemSemiBlockBase)Itemss.logisticsFrameActiveProvider);
    SemiBlockManager.registerSemiBlockToItemMapping(SemiBlockActiveProvider.class, Itemss.logisticsFrameActiveProvider);
}
 
Example #23
Source File: GuiAerialInterface.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void initGui(){
    super.initGui();
    if(PneumaticCraftAPIHandler.getInstance().liquidXPs.size() > 0) addAnimatedStat("gui.tab.info.aerialInterface.liquidXp.info.title", new ItemStack(Items.water_bucket), 0xFF55FF55, false).setText(getLiquidXPText());
    if(Loader.isModLoaded(ModIds.COFH_CORE)) {
        addAnimatedStat("gui.tab.info.aerialInterface.interfacingRF.info.title", new ItemStack(Items.glowstone_dust), 0xFFFF2222, false).setText("gui.tab.info.aerialInterface.interfacingRF.info");
    }

    if(te.getUpgrades(ItemMachineUpgrade.UPGRADE_DISPENSER_DAMAGE) > 0) {
        GuiAnimatedStat optionStat = addAnimatedStat("gui.tab.aerialInterface.feedMode", new ItemStack(Items.beef), 0xFFFFCC00, false);
        List<String> text = new ArrayList<String>();
        for(int i = 0; i < 4; i++)
            text.add("                 ");
        optionStat.setTextWithoutCuttingString(text);

        GuiButtonSpecial button = new GuiButtonSpecial(1, 5, 20, 20, 20, "");
        button.setRenderStacks(new ItemStack(Items.beef));
        button.setTooltipText(I18n.format("gui.tab.aerialInterface.feedMode.feedFullyUtilize"));
        optionStat.addWidget(button);
        modeButtons[0] = button;

        button = new GuiButtonSpecial(2, 30, 20, 20, 20, "");
        button.setRenderStacks(new ItemStack(Items.apple));
        button.setTooltipText(I18n.format("gui.tab.aerialInterface.feedMode.feedWhenPossible"));
        optionStat.addWidget(button);
        modeButtons[1] = button;

        button = new GuiButtonSpecial(3, 55, 20, 20, 20, "");
        button.setRenderStacks(new ItemStack(Items.golden_apple));
        button.setTooltipText(Arrays.asList(WordUtils.wrap(I18n.format("gui.tab.aerialInterface.feedMode.utilizeFullHealthElsePossible"), 40).split(System.getProperty("line.separator"))));
        optionStat.addWidget(button);
        modeButtons[2] = button;
    } else {
        for(int i = 0; i < modeButtons.length; i++)
            modeButtons[i] = null;
    }
}
 
Example #24
Source File: ColoredLightsIntegration.java    From GardenCollection with MIT License 5 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    initPackedColors();
    initialized = true;
}
 
Example #25
Source File: ThaumcraftIntegration.java    From GardenCollection with MIT License 5 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    Block blockCandle = GameRegistry.findBlock(ThaumcraftIntegration.MOD_ID, "blockCandle");
    ILanternSource candleSource = new ThaumcraftCandleSource(blockCandle);

    GardenAPI.instance().registries().lanternSources().registerLanternSource(candleSource);
}
 
Example #26
Source File: NEIIntegration.java    From GardenCollection with MIT License 5 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    if (GardenStuff.proxy instanceof ClientProxy)
        NEIHelper.registerNEI();
}
 
Example #27
Source File: ThaumcraftIntegration.java    From GardenCollection with 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("large_oak", new int[] { 0 });
    saplingBank1.put("large_spruce", new int[] { 1 });

    Map<Item, Map<String, int[]>> banks = new HashMap<Item, Map<String, int[]>>();
    banks.put(Item.getItemFromBlock(GameRegistry.findBlock(MOD_ID, "blockCustomPlant")), 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 #28
Source File: LoaderReference.java    From bartworks with MIT License 5 votes vote down vote up
public static void init() {
    Natura = Loader.isModLoaded("Natura");
    RandomThings = Loader.isModLoaded("RandomThings");
    TConstruct = Loader.isModLoaded("TConstruct");
    chisel = Loader.isModLoaded("chisel");
    Railcraft = Loader.isModLoaded("Railcraft");
    Ztones = Loader.isModLoaded("Ztones");
    witchery = Loader.isModLoaded("witchery");
    GalaxySpace = Loader.isModLoaded("GalaxySpace");
    GalacticraftCore = Loader.isModLoaded("GalacticraftCore");
    GalacticraftMars = Loader.isModLoaded("GalacticraftMars");
    Thaumcraft = Loader.isModLoaded("Thaumcraft");
    miscutils = Loader.isModLoaded("miscutils");
    tectech = Loader.isModLoaded("tectech");
    ExtraUtilities = Loader.isModLoaded("ExtraUtilities");
    RWG = Loader.isModLoaded("RWG");
    galacticgreg = Loader.isModLoaded("galacticgreg");
    gendustry = Loader.isModLoaded("gendustry");
    croploadcore = Loader.isModLoaded("croploadcore");
    Forestry = Loader.isModLoaded("Forestry");
    berriespp = Loader.isModLoaded("berriespp");
    dreamcraft = Loader.isModLoaded("dreamcraft");
    BloodArsenal = Loader.isModLoaded("BloodArsenal");
    Botany = Loader.isModLoaded("Botany");
    EnderIO = Loader.isModLoaded("EnderIO");
    HardcoreEnderExpension = Loader.isModLoaded("HardcoreEnderExpension");
    betterloadingscreen = Loader.isModLoaded("betterloadingscreen");
}
 
Example #29
Source File: WitcheryIntegration.java    From GardenCollection with 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, 1, 2 });

    Map<Item, Map<String, int[]>> banks = new HashMap<Item, Map<String, int[]>>();
    banks.put(Item.getItemFromBlock(GameRegistry.findBlock(MOD_ID, "witchsapling")), 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 #30
Source File: ThaumcraftIntegration.java    From GardenCollection with MIT License 5 votes vote down vote up
public static void init () {
    if (!Loader.isModLoaded(MOD_ID))
        return;

    initWood();

    PlantRegistry plantReg = PlantRegistry.instance();

    plantReg.registerPlantInfo(MOD_ID, "blockCustomPlant", 2, new SimplePlantInfo(PlantType.GROUND, PlantSize.SMALL));
    plantReg.registerPlantInfo(MOD_ID, "blockCustomPlant", 4, new SimplePlantInfo(PlantType.INVALID, PlantSize.LARGE));
}