@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"); }
public void initFlowers() { if (ItemWateringCan.flowers != null) { return; } ItemWateringCan.flowers = new ArrayList<ItemStack>(); if (!Loader.isModLoaded("Forestry")) { return; } try { final Class flowerManager = Class.forName("forestry.api.apiculture.FlowerManager"); final ArrayList<ItemStack> temp = (ArrayList<ItemStack>)flowerManager.getField("plainFlowers").get(null); ItemWateringCan.flowers.addAll(temp); } catch (Exception e) { e.printStackTrace(); } }
@Override protected void nerfNonStandardRecipes () { if (Loader.isModLoaded(ModIds.ENVIROMINE)) { nerfEnviromineRecipes(); } if (Loader.isModLoaded(ModIds.TIC)) { nerfTConstructRecipes(); } if (Loader.isModLoaded(ModIds.TISTEELWORKS)) { nerfTiSteelworksRecipes(); } }
@SuppressWarnings("unchecked") public static void SC2RecipeTweaks() { if(Loader.isModLoaded("steamcraft2")) { if(!ConfigSettings.FleshBlockRecipe) { List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList(); for (int i = 0; i < recipes.size(); i++) { if (recipes.get(i) != null) { ItemStack recipeResult = recipes.get(i).getRecipeOutput(); if (recipeResult != null && recipeResult.getItem() == Item.getItemFromBlock(InitBlocks.blockFlesh)) { recipes.remove(i--); } } } } //OreDictionary.registerOre("itemAxe", new ItemStack(InitItems.axeSteam, 1, OreDictionary.WILDCARD_VALUE)); } }
@Override public void run() { if (!Loader.isModLoaded("Micdoodlecore")) { if (ThreadRequirementMissing.threadSide.isServer()) { FMLCommonHandler.instance().getMinecraftServerInstance().logSevere("==================================================================="); FMLCommonHandler.instance().getMinecraftServerInstance().logSevere("MicdoodleCore not found in mods folder. Galacticraft will not load."); FMLCommonHandler.instance().getMinecraftServerInstance().logSevere("==================================================================="); } else { ThreadRequirementMissing.openGuiClient(); } } }
public void setupFluids() { FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid(TFCFluids.OLIVEOIL.getName()), new ItemStack(TFPItems.CustomBucketOliveOil), new ItemStack(TFCItems.woodenBucketEmpty)); if(Loader.isModLoaded("BuildCraft|Core")) { FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid(BuildCraftEnergy.fluidOil.getName()), new ItemStack(TFPItems.CustomBucketOil), new ItemStack(TFCItems.woodenBucketEmpty)); } if(Loader.isModLoaded("necromancy")) { FluidContainerRegistry.registerFluidContainer(new FluidStack(TFPFluids.tfpFluidBlood, 1000), new ItemStack(TFPItems.CustomBucketBlood), new ItemStack(TFCItems.woodenBucketEmpty)); FluidContainerRegistry.registerFluidContainer(new FluidStack(TFPFluids.tfpFluidBlood, 250), ItemGeneric.getItemStackFromName("Jar of Blood"), new ItemStack(TFCItems.glassBottle)); } if(Loader.isModLoaded("steamcraft2")) { FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid(TFPFluids.tfpFluidWhaleOil.getName()), new ItemStack(TFPItems.CustomBucketWhaleOil), new ItemStack(TFCItems.woodenBucketEmpty)); } }
@Override public void initRenders() { RenderIds.campfire = RenderingRegistry.getNextAvailableRenderId(); ClientRegistry.bindTileEntitySpecialRenderer(TileCampfire.class, new TileRenderCampfire()); ClientRegistry.bindTileEntitySpecialRenderer(TileHardJug.class, new TileRenderJug()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.hardjug), new ItemRenderJug()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.campfire), new ItemRenderCampfire()); // ClientRegistry.bindTileEntitySpecialRenderer(TileCampfire.class, new TileRenderCampfire()); if(Loader.isModLoaded("NotEnoughItems")) { } }
@Override protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator var5) { ModContainer mc=mods.get(listIndex); if (Loader.instance().getModState(mc)==ModState.DISABLED) { this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFF2222); this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xFF2222); this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a("DISABLED", listWidth - 10), this.left + 3 , var3 + 22, 0xFF2222); } else { this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getName(), listWidth - 10), this.left + 3 , var3 + 2, 0xFFFFFF); this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getDisplayVersion(), listWidth - 10), this.left + 3 , var3 + 12, 0xCCCCCC); this.parent.getFontRenderer().func_78276_b(this.parent.getFontRenderer().func_78269_a(mc.getMetadata() !=null ? mc.getMetadata().getChildModCountString() : "Metadata not found", listWidth - 10), this.left + 3 , var3 + 22, 0xCCCCCC); } }
public Object buildSoftDependProxy(String modId, String className) { if (Loader.isModLoaded(modId)) { try { Class<?> clz = Class.forName(className,true,Loader.instance().getModClassLoader()); return clz.newInstance(); } catch (Exception e) { Throwables.propagateIfPossible(e); return null; } } return null; }
/** * Prefix the supplied name with the current mod id. * * If no mod id can be determined, minecraft will be assumed. * The prefix is separated with a colon. * * If there's already a prefix, it'll be prefixed again if the new prefix * doesn't match the old prefix, as used by vanilla calls to addObject. * * @param name name to prefix. * @return prefixed name. */ private String addPrefix(String name) { int index = name.lastIndexOf(':'); String oldPrefix = index == -1 ? "" : name.substring(0, index); String prefix; ModContainer mc = Loader.instance().activeModContainer(); if (mc != null) { prefix = mc.getModId(); } else // no mod container, assume minecraft { prefix = "minecraft"; } if (!oldPrefix.equals(prefix)) { name = prefix + ":" + name; } return name; }
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id) { if (EntityList.field_75626_c.containsKey(entityClass)) { ModContainer activeModContainer = Loader.instance().activeModContainer(); String modId = "unknown"; if (activeModContainer != null) { modId = activeModContainer.getModId(); } else { FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped."); } FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass); return; } id = instance().validateAndClaimId(id); EntityList.func_75618_a(entityClass, entityName, id); }
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour) { if (EntityList.field_75626_c.containsKey(entityClass)) { ModContainer activeModContainer = Loader.instance().activeModContainer(); String modId = "unknown"; if (activeModContainer != null) { modId = activeModContainer.getModId(); } else { FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped."); } FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass); return; } instance().validateAndClaimId(id); EntityList.func_75614_a(entityClass, entityName, id, backgroundEggColour, foregroundEggColour); }
/** * Deprecated for removal in 1.8. Use the assets lang system */ @Deprecated public void loadLocalization(String localizationFile, String lang, boolean isXML) { URL urlResource = this.getClass().getResource(localizationFile); if (urlResource != null) { loadLocalization(urlResource, lang, isXML); } else { ModContainer activeModContainer = Loader.instance().activeModContainer(); if (activeModContainer!=null) { FMLLog.log(activeModContainer.getModId(), Level.ERROR, "The language resource %s cannot be located on the classpath. This is a programming error.", localizationFile); } else { FMLLog.log(Level.ERROR, "The language resource %s cannot be located on the classpath. This is a programming error.", localizationFile); } } }
public ForgeModContainer() { super(new ModMetadata()); ModMetadata meta = getMetadata(); meta.modId = "Forge"; meta.name = "Minecraft Forge"; meta.version = String.format("%d.%d.%d.%d", majorVersion, minorVersion, revisionVersion, buildVersion); meta.credits = "Made possible with help from many people"; meta.authorList = Arrays.asList("LexManos", "Eloraam", "Spacetoad"); meta.description = "Minecraft Forge is a common open source API allowing a broad range of mods " + "to work cooperatively together. It allows many mods to be created without " + "them editing the main Minecraft code."; meta.url = "http://MinecraftForge.net"; meta.updateUrl = "http://MinecraftForge.net/forum/index.php/topic,5.0.html"; meta.screenshots = new String[0]; meta.logoFile = "/forge_logo.png"; config = null; File cfgFile = new File(Loader.instance().getConfigDir(), "forge.cfg"); config = new Configuration(cfgFile); syncConfig(true); }
public Modpack(Logger logger, MinecraftConfig config, Gson gson) throws Exception { this.config = config; this.logger = logger; this.gson = gson; solderCache = Paths.get(Loader.instance().getConfigDir().getParent(), CACHE_DIR); if(!Files.exists(solderCache)){ Files.createDirectories(solderCache); } Path readme = solderCache.resolve("README.txt"); if(!Files.exists(readme)){ Files.copy(Modpack.class.getResourceAsStream("/README.txt"), readme); } modCache = solderCache.resolve(CACHE_MOD_DIR); if(!Files.exists(modCache)) Files.createDirectories(modCache); packCache = solderCache.resolve(CACHE_PACK_DIR); if(!Files.exists(packCache)) Files.createDirectories(packCache); clientModsCache = solderCache.resolve(CACHE_CLIENT_DIR); if(!Files.exists(clientModsCache)) Files.createDirectories(clientModsCache); }
@EventHandler public void initialize(FMLInitializationEvent event) { TerraFirmaCraft.PACKET_PIPELINE.registerPacket(InitClientWorldPacket.class); FMLCommonHandler.instance().bus().register(new PlayerTracker()); MinecraftForge.EVENT_BUS.register(new ChunkEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerInteractionHandler()); MinecraftForge.EVENT_BUS.register(new AnvilCraftingHandler()); if (Loader.isModLoaded("MineTweaker3")) { MineTweakerAPI.registerClass(ItemHeat.class); MineTweakerAPI.registerClass(Loom.class); MineTweakerAPI.registerClass(Quern.class); MineTweakerAPI.registerClass(Barrel.class); MineTweakerAPI.registerClass(Anvil.class); MineTweakerAPI.registerClass(Knapping.class); } }
public static void init() { if (!Loader.isModLoaded("journeymap")) return; try { Class clazzJMapClient = Class.forName("journeymap.client.JourneymapClient"); Class clazzJMapWaypointStore = Class.forName("journeymap.client.waypoint.WaypointStore"); Class clazzJMapWaypointProperties = Class.forName("journeymap.client.properties.WaypointProperties"); Class clazzJMapWaypoint = Class.forName("journeymap.client.model.Waypoint"); Class clazzJMapWaypointType = Class.forName("journeymap.client.model.Waypoint$Type"); Method methodGetWaypointProperties = clazzJMapClient.getMethod("getWaypointProperties"); Method methodInstance = clazzJMapWaypointStore.getMethod("instance"); Method methodGetAll = clazzJMapWaypointStore.getMethod("getAll"); Method methodSetRandomColor = clazzJMapWaypoint.getMethod("setRandomColor"); Method methodSave = clazzJMapWaypointStore.getMethod("save", clazzJMapWaypoint); Constructor constuctorWaypoint = clazzJMapWaypoint.getConstructor(String.class, int.class, int.class, int.class, Color.class, clazzJMapWaypointType, Integer.class); failedCompat = false; } catch (Exception e) {} }
@Override public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { NBTTagCompound tag = accessor.getNBTData(); TileEntity tileEntity = accessor.getTileEntity(); if(Loader.isModLoaded("Steamcraft") && ConfigSettings.FSPWailaIntegration) { if (tileEntity != null && tileEntity instanceof TEBoiler) { currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.watertank") + ": " + tag.getInteger("water") + " / " + ((TEBoiler)tileEntity).myTank.getCapacity()); currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.steamtank") + ": " + tag.getInteger("steam") + " / " + ((TEBoiler)tileEntity).getCapacity()); } else if (tileEntity != null && tileEntity instanceof TEFlashBoiler && ((TEFlashBoiler)tileEntity).hasMaster()) { currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.watertank") + ": " + ((TEFlashBoiler)tileEntity).getMasterTileEntity().getTank().getFluidAmount() + " / " + ((TEFlashBoiler)tileEntity).getMasterTileEntity().getTank().getCapacity()); currenttip.add(StatCollector.translateToLocal("gui.tfptweaks.steamtank") + ": "+ tag.getInteger("steam") + " / " + ((TEFlashBoiler)tileEntity).getMasterTileEntity().getCapacity()); } } return currenttip; }
public static void init(){ tesla = new ItemTeslaUpgrade(); radar = new ItemRadarUpgrade(); scanner = new ItemScanner(); nr = new ItemNRUpgrade(); wrench = li.cil.oc.api.Items.get("wrench").item(); if(Loader.isModLoaded("IC2")) uranCell = IC2Items.getItem("reactorUraniumSimple").getItem(); if(Config.registerTeslaUpgrade) GameRegistry.registerItem(tesla, "ot_teslaUpgrade"); if(Config.registerRadarUpgrade) GameRegistry.registerItem(radar, "ot_radarUpgrade"); if(Config.registerScanner) GameRegistry.registerItem(scanner, "ot_scanner"); if(Config.registerNR && Loader.isModLoaded("IC2")) GameRegistry.registerItem(nr, "ot_nrUpgrade"); }
public static void registerImplementation(IServerHost plugin) { if (Loader.isModLoaded("minetogether")) { Object mod = Loader.instance().getIndexedModList().get("minetogether").getMod(); ((ICreeperHostMod) mod).registerImplementation(plugin); } }
@Override public void hideNEIItems() { if (Loader.isModLoaded(ModDetails.MODID_NEI)) { } }
@EventHandler public void preInit(FMLPreInitializationEvent event) { if (event.getSide() == Side.CLIENT) { ConfigLoader.init(event); isCustomStuff2Loaded = Loader.isModLoaded("CustomStuff2"); } new CNPNetwork(); }
@Override public void registerEventHandler() { MinecraftForge.EVENT_BUS.register((Object)new EventHandlerClient()); FMLCommonHandler.instance().bus().register((Object)new EventHandlerClient()); ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)new LiquidColorRegistry()); ((IReloadableResourceManager)Minecraft.getMinecraft().getResourceManager()).registerReloadListener((IResourceManagerReloadListener)new ParticleHelperClient()); ExtraUtils.handlesClientMethods = true; if (Loader.isModLoaded("ForgeMultipart")) { RenderBlockConnectedTextures.fakeRender = new FakeRenderBlocksMultiPart(); } ClientCommandHandler.instance.registerCommand((ICommand)new CommandHologram()); ClientCommandHandler.instance.registerCommand((ICommand)new CommandUUID()); KeyHandler.INSTANCE.register(); super.registerEventHandler(); }
public static Item getMicroBlockItemId() { if (!ExtraUtilsProxy.checked2) { ExtraUtilsProxy.checked2 = true; if (Loader.isModLoaded("ForgeMultipart")) { ExtraUtilsProxy.MicroBlockId = (Item)Item.itemRegistry.getObject("ForgeMicroblock:microblock"); if (ExtraUtilsProxy.MicroBlockId == null) { ExtraUtilsProxy.checked2 = false; } } } return ExtraUtilsProxy.MicroBlockId; }
public void registerTileEntities() { GameRegistry.registerTileEntity(TEBrickOven.class, "TEBrickOven"); if(Loader.isModLoaded("Steamcraft")) { GameRegistry.registerTileEntity(TEBoiler.class, "TEBoiler"); GameRegistry.registerTileEntity(TEFlashBoiler.class, "TEFlashBoiler"); } if(Loader.isModLoaded("necromancy")) { GameRegistry.registerTileEntity(TEAltar.class, "TEAltar"); } }
private static void adjustMeltingTemps () { for (final String fluidName : buildFluidDictEntries(Settings.TConstruct.meltingTemps.keySet())) { TConstructHandler.setMeltingTemp(fluidName, Settings.TConstruct.meltingTemps.get(fluidName)); if (Loader.isModLoaded(ModIds.TISTEELWORKS)) { TSteelworksHandler.init(); TSteelworksHandler.setMeltingTemp(fluidName, Settings.TConstruct.meltingTemps.get(fluidName)); } } }
public void loadTcon() { if (Loader.isModLoaded("TConstruct")) { ILoading r = null; try { final Class<?> clazz = Class.forName("com.rwtema.extrautils.modintegration.TConIntegration"); r = (ILoading)clazz.newInstance(); } catch (Exception e) { e.printStackTrace(); } if (r != null) { this.loaders.add(r); } } }
private void FMPRegisterPassThroughInterfaces() { if (Loader.isModLoaded("ForgeMultipart")) { RegisterMicroMaterials.registerBlock(ExtraUtils.cobblestoneCompr, 0, 16); RegisterMicroMaterials.registerBlock(ExtraUtils.enderThermicPump); RegisterMicroMaterials.registerBlock(ExtraUtils.tradingPost); RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.etheralBlock, 0); RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.etheralBlock, 1); RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.etheralBlock, 2); RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.etheralBlock, 3); RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.etheralBlock, 4); RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.etheralBlock, 5); RegisterMicroMaterials.registerFullBright(ExtraUtils.greenScreen); for (final BlockColor col : ExtraUtils.colorblocks) { RegisterMicroMaterials.registerColorBlock(col); } for (int i = 0; i < 16; ++i) { if (ExtraUtils.decorative1 != null && ExtraUtils.decorative1.name[i] != null) { RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.decorative1, i); } if (ExtraUtils.decorative2 != null && ExtraUtils.decorative2.name[i] != null) { RegisterMicroMaterials.registerConnectedTexture(ExtraUtils.decorative2, i); } } } MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.IAntiMobTorch", false, true); MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.transfernodes.pipes.IPipe"); MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.transfernodes.pipes.IPipeCosmetic"); MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.transfernodes.pipes.IFilterPipe"); MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.transfernodes.nodebuffer.INode"); MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.transfernodes.nodebuffer.INodeInventory"); MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.transfernodes.nodebuffer.INodeLiquid"); MultipartGenerator.registerPassThroughInterface("com.rwtema.extrautils.tileentity.transfernodes.nodebuffer.INodeEnergy"); MultipartGenerator.registerPassThroughInterface("cofh.api.energy.IEnergyHandler"); }
public void postInit(final FMLPostInitializationEvent evt) { ForgeChunkManager.setForcedChunkLoadingCallback((Object)ExtraUtilsMod.instance, (ForgeChunkManager.LoadingCallback)new ChunkloadCallback()); CommandTPSTimer.init(); if (ExtraUtils.underdarkDimID != 0 && ExtraUtils.portalEnabled) { FMLCommonHandler.instance().bus().register((Object)new DarknessTickHandler()); } if (ExtraUtils.divisionSigilEnabled && !ExtraUtils.disableDivisionSigilInChests) { this.addSigil("dungeonChest", 0.01); this.addSigil("mineshaftCorridor", 0.001); this.addSigil("pyramidDesertyChest", 0.02); this.addSigil("pyramidJungleChest", 0.05); this.addSigil("strongholdCrossing", 0.01); this.addSigil("strongholdCorridor", 0.01); } if (!ExtraUtils.disableEnderLiliesInDungeons && ExtraUtils.enderLily != null) { addDungeonItem(new ItemStack((Block)ExtraUtils.enderLily), 1, 5, "dungeonChest", 0.03); } ExtraUtilsMod.proxy.postInit(); if (ExtraUtils.enderQuarryEnabled) { BlockBreakingRegistry.instance.setupBreaking(); } DispenserStuff.registerItems(); if (ExtraUtils.generatorEnabled) { TileEntityGeneratorPotion.genPotionLevels(); } if (ExtraUtils.transferPipeEnabled) { TNHelper.initBlocks(); } if (Loader.isModLoaded("Thaumcraft")) { ThaumcraftHelper.registerItems(); } for (final ILoading loader : this.loaders) { loader.postInit(); } }
@Override public void postInit(FMLPostInitializationEvent event) { RenderingRegistry.registerEntityRenderingHandler(EntitySmallAsteroid.class, new RenderSmallAsteroid()); RenderingRegistry.registerEntityRenderingHandler(EntityGrapple.class, new RenderGrapple()); IModelCustom podModel = AdvancedModelLoader.loadModel(new ResourceLocation(AsteroidsModule.ASSET_PREFIX, "models/pod.obj")); RenderingRegistry.registerEntityRenderingHandler(EntityEntryPod.class, new RenderEntryPod(podModel)); IModelCustom rocketModel = AdvancedModelLoader.loadModel(new ResourceLocation(AsteroidsModule.ASSET_PREFIX, "models/tier3rocket.obj")); RenderingRegistry.registerEntityRenderingHandler(EntityTier3Rocket.class, new RenderTier3Rocket(rocketModel, AsteroidsModule.ASSET_PREFIX, "tier3rocket")); RenderingRegistry.registerEntityRenderingHandler(EntityAstroMiner.class, new RenderAstroMiner()); IModelCustom grappleModel = AdvancedModelLoader.loadModel(new ResourceLocation(AsteroidsModule.ASSET_PREFIX, "models/grapple.obj")); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.grapple, new ItemRendererGrappleHook(grappleModel)); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.beamReceiver), new ItemRendererBeamReceiver()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.beamReflector), new ItemRendererBeamReflector()); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.tier3Rocket, new ItemRendererTier3Rocket(rocketModel)); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.astroMiner, new ItemRendererAstroMiner()); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.thermalPadding, new ItemRendererThermalArmor()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.shortRangeTelepad), new ItemRendererShortRangeTelepad()); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.heavyNoseCone, new ItemRendererHeavyNoseCone()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.blockWalkway), new ItemRendererWalkway()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.blockWalkwayOxygenPipe), new ItemRendererWalkway()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.blockWalkwayWire), new ItemRendererWalkway()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBeamReflector.class, new TileEntityBeamReflectorRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBeamReceiver.class, new TileEntityBeamReceiverRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMinerBase.class, new TileEntityMinerBaseRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShortRangeTelepad.class, new TileEntityShortRangeTelepadRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTreasureChestAsteroids.class, new TileEntityTreasureChestRenderer()); if (Loader.isModLoaded("craftguide")) CraftGuideIntegration.register(); }
@Override public void preInit(FMLPreInitializationEvent event) { ClientProxyCore.scaleup.put(ClientProxyCore.numbers, 0, 16); ClientProxyCore.renderIndexSensorGlasses = RenderingRegistry.addNewArmourRendererPrefix("sensor"); ClientProxyCore.renderIndexHeavyArmor = RenderingRegistry.addNewArmourRendererPrefix("titanium"); if (Loader.isModLoaded("PlayerAPI")) { ClientPlayerAPI.register(Constants.MOD_ID_CORE, GCPlayerBaseSP.class); } }
@Override protected void nerfNonStandardRecipes () { if (Loader.isModLoaded(ModIds.ENVIROMINE)) { nerfEnviromineRecipes(); } if (Loader.isModLoaded(ModIds.LYCANITES_JUNGLE_MOBS)) { nerfJungleMobRecipes(); } if (Loader.isModLoaded(ModIds.METALLURGY)) { nerfMetallurgyRecipes(); } if (Loader.isModLoaded(ModIds.SALTY_MOD)) { nerfTSaltyModRecipes(); } if (Loader.isModLoaded(ModIds.TIC)) { nerfTConstructRecipes(); } if (Loader.isModLoaded(ModIds.TISTEELWORKS)) { nerfTiSteelworksRecipes(); } }
public static void registerEntityRenderers() { RenderingRegistry.registerEntityRenderingHandler(EntityTier1Rocket.class, new RenderTier1Rocket(new ModelRocketTier1(), GalacticraftCore.ASSET_PREFIX, "rocketT1")); RenderingRegistry.registerEntityRenderingHandler(EntityEvolvedSpider.class, new RenderEvolvedSpider()); RenderingRegistry.registerEntityRenderingHandler(EntityEvolvedZombie.class, new RenderEvolvedZombie()); RenderingRegistry.registerEntityRenderingHandler(EntityEvolvedCreeper.class, new RenderEvolvedCreeper()); RenderingRegistry.registerEntityRenderingHandler(EntityEvolvedSkeleton.class, new RenderEvolvedSkeleton()); RenderingRegistry.registerEntityRenderingHandler(EntitySkeletonBoss.class, new RenderEvolvedSkeletonBoss()); RenderingRegistry.registerEntityRenderingHandler(EntityMeteor.class, new RenderMeteor()); RenderingRegistry.registerEntityRenderingHandler(EntityBuggy.class, new RenderBuggy()); RenderingRegistry.registerEntityRenderingHandler(EntityMeteorChunk.class, new RenderMeteorChunk()); RenderingRegistry.registerEntityRenderingHandler(EntityFlag.class, new RenderFlag()); RenderingRegistry.registerEntityRenderingHandler(EntityParachest.class, new RenderParaChest()); RenderingRegistry.registerEntityRenderingHandler(EntityAlienVillager.class, new RenderAlienVillager()); // RenderingRegistry.registerEntityRenderingHandler(EntityBubble.class, new RenderBubble(0.25F, 0.25F, 1.0F)); RenderingRegistry.registerEntityRenderingHandler(EntityLander.class, new RenderLander()); RenderingRegistry.registerEntityRenderingHandler(EntityCelestialFake.class, new RenderEntityFake()); if (Loader.isModLoaded("RenderPlayerAPI")) { ModelPlayerAPI.register(Constants.MOD_ID_CORE, ModelPlayerBaseGC.class); RenderPlayerAPI.register(Constants.MOD_ID_CORE, RenderPlayerBaseGC.class); } else { RenderingRegistry.registerEntityRenderingHandler(EntityPlayerSP.class, new RenderPlayerGC()); RenderingRegistry.registerEntityRenderingHandler(EntityOtherPlayerMP.class, new RenderPlayerGC()); } }
public static void init(FMLInitializationEvent event) { if(Loader.isModLoaded("Waila")) { new CompatModuleWaila().init(event); } if(Loader.isModLoaded("NotEnoughItems")) { } }
public int getPotionOffsetNEI() { if (this.initWithPotion && Loader.isModLoaded("NotEnoughItems")) { try { // Check whether NEI is hidden and enabled Class<?> c = Class.forName("codechicken.nei.NEIClientConfig"); Object hidden = c.getMethod("isHidden").invoke(null); Object enabled = c.getMethod("isEnabled").invoke(null); if (hidden instanceof Boolean && enabled instanceof Boolean) { if ((Boolean)hidden || !((Boolean)enabled)) { // If NEI is disabled or hidden, offset the tabs by the standard 60 return 0; } //Active NEI undoes the standard potion offset return -60; } } catch (Exception e) { } } //No NEI, no change return 0; }
@EventHandler public void preInit(FMLPreInitializationEvent event) { isPlanetsLoaded = Loader.isModLoaded(Constants.MOD_ID_PLANETS); GCCoreUtil.nextID = 0; MinecraftForge.EVENT_BUS.register(new EventHandlerGC()); handler = new GCPlayerHandler(); MinecraftForge.EVENT_BUS.register(handler); FMLCommonHandler.instance().bus().register(handler); GalacticraftCore.proxy.preInit(event); ConnectionPacket.bus = NetworkRegistry.INSTANCE.newEventDrivenChannel(ConnectionPacket.CHANNEL); ConnectionPacket.bus.register(new ConnectionPacket()); ConfigManagerCore.initialize(new File(event.getModConfigurationDirectory(), GalacticraftCore.CONFIG_FILE)); EnergyConfigHandler.setDefaultValues(new File(event.getModConfigurationDirectory(), GalacticraftCore.POWER_CONFIG_FILE)); ChunkLoadingCallback.loadConfig(new File(event.getModConfigurationDirectory(), GalacticraftCore.CHUNKLOADER_CONFIG_FILE)); this.registerOilandFuel(); if (Loader.isModLoaded("PlayerAPI")) { ServerPlayerAPI.register(Constants.MOD_ID_CORE, GCPlayerBaseMP.class); } GCBlocks.initBlocks(); GCItems.initItems(); //Allow canisters to be filled from other mods' tanks containing fuel / oil fluids FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(GalacticraftCore.fluidFuel, 1000), new ItemStack(GCItems.fuelCanister, 1, 1), new ItemStack(GCItems.oilCanister, 1, ItemCanisterGeneric.EMPTY))); FluidContainerRegistry.registerFluidContainer(new FluidContainerData(new FluidStack(GalacticraftCore.fluidOil, 1000), new ItemStack(GCItems.oilCanister, 1, 1), new ItemStack(GCItems.oilCanister, 1, ItemCanisterGeneric.EMPTY))); }
/** * Checks using the FML loader too see if IC2 is loaded */ public static boolean isIndustrialCraft2Loaded() { if (!cachedIC2Loaded) { cachedIC2Loaded = true; cachedIC2LoadedValue = Loader.isModLoaded("IC2"); } return cachedIC2LoadedValue; }
public static boolean isBuildcraftReallyLoaded() { if (!cachedBCReallyLoaded) { cachedBCReallyLoaded = true; cachedBCReallyLoadedValue = Loader.isModLoaded("BuildCraft|Energy"); } return cachedBCReallyLoadedValue; }
public static boolean isMekanismLoaded() { if (!cachedMekLoaded) { cachedMekLoaded = true; cachedMekLoadedValue = Loader.isModLoaded("Mekanism"); } return cachedMekLoadedValue; }
public static int getPotionOffsetNEI() { if (initWithPotion && Loader.isModLoaded("NotEnoughItems")) { try { // Check whether NEI is hidden and enabled Class<?> c = Class.forName("codechicken.nei.NEIClientConfig"); Object hidden = c.getMethod("isHidden").invoke(null); Object enabled = c.getMethod("isEnabled").invoke(null); if (hidden instanceof Boolean && enabled instanceof Boolean) { if ((Boolean)hidden || !((Boolean)enabled)) { // If NEI is disabled or hidden, offset the tabs by the standard 60 return 0; } //Active NEI undoes the standard potion offset return -60; } } catch (Exception e) { } } //No NEI, no change return 0; }