public class FMLTextureFX extends TextureFX implements ITextureFX { public int tileSizeBase = 16; public int tileSizeSquare = 256; public int tileSizeMask = 15; public int tileSizeSquareMask = 255; public boolean errored = false; protected Logger log = FMLLog.getLogger(); public FMLTextureFX(int icon) { super(icon); } @Override public void setErrored(boolean err) { errored = err; } @Override public boolean getErrored() { return errored; } @Override public void onTexturePackChanged( RenderEngine engine, ITexturePack texturepack, Dimension dimensions) { onTextureDimensionsUpdate(dimensions.width, dimensions.height); } @Override public void onTextureDimensionsUpdate(int width, int height) { tileSizeBase = width >> 4; tileSizeSquare = tileSizeBase * tileSizeBase; tileSizeMask = tileSizeBase - 1; tileSizeSquareMask = tileSizeSquare - 1; setErrored(false); setup(); } protected void setup() { imageData = new byte[tileSizeSquare << 2]; } public boolean unregister(RenderEngine engine, List<TextureFX> effects) { effects.remove(this); return true; } }
@EventHandler public void preInit(FMLPreInitializationEvent evt) { ResonantInduction.LOGGER.setParent(FMLLog.getLogger()); NetworkRegistry.instance().registerGuiHandler(this, proxy); Modstats.instance().getReporter().registerMod(this); Settings.CONFIGURATION.load(); // Register Forge Events MinecraftForge.EVENT_BUS.register(ResourceGenerator.INSTANCE); MinecraftForge.EVENT_BUS.register(new TextureHookHandler()); blockMachinePart = contentRegistry.createBlock(BlockMachineMaterial.class, ItemBlockMetadata.class); /** Melting dusts */ blockDust = contentRegistry .createBlock("dust", BlockDust.class, null, TileDust.class) .setCreativeTab(null); blockRefinedDust = contentRegistry .createBlock("refinedDust", BlockDust.class, null, TileDust.class) .setCreativeTab(null); // Items itemRubble = new ItemOreResource(Settings.getNextItemID("oreRubble"), "oreRubble"); itemDust = new ItemOreResource(Settings.getNextItemID("oreDust"), "oreDust"); itemRefinedDust = new ItemOreResource(Settings.getNextItemID("oreRefinedDust"), "oreRefinedDust"); itemBucketMixture = new ItemOreResourceBucket(Settings.getNextItemID("bucketMixture"), "bucketMixture", false); itemBucketMolten = new ItemOreResourceBucket(Settings.getNextItemID("bucketMolten"), "bucketMolten", true); itemBiomass = contentRegistry.createItem(ItemBiomass.class); GameRegistry.registerItem(itemRubble, itemRubble.getUnlocalizedName()); GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName()); GameRegistry.registerItem(itemRefinedDust, itemRefinedDust.getUnlocalizedName()); GameRegistry.registerItem(itemBucketMixture, itemBucketMixture.getUnlocalizedName()); GameRegistry.registerItem(itemBucketMolten, itemBucketMolten.getUnlocalizedName()); // Already registered with ContentRegistry // GameRegistry.registerTileEntity(TileMaterial.class, "ri_material"); GameRegistry.registerTileEntity(TileFluidMixture.class, "ri_fluid_mixture"); proxy.preInit(); TabRI.ITEMSTACK = new ItemStack(blockMachinePart); }
@PreInit public void preInit(FMLPreInitializationEvent event) { logger.setParent(FMLLog.getLogger()); logger.info("Starting Inventory Tools"); logger.info("Copyright (c) Xelat, 2012"); blockInventorySupplier = new BlockInventorySupplier(); GameRegistry.registerBlock(blockInventorySupplier); LanguageRegistry.addName(blockInventorySupplier, "Inventory Supplier"); GameRegistry.registerTileEntity( TileInventorySupplier.class, blockInventorySupplier.getBlockName()); GameRegistry.addShapelessRecipe( new ItemStack(blockInventorySupplier), new Object[] {new ItemStack(Block.dirt)}); Localization.addLocalization("/lang/itools/", "en_US"); }
private void func_98238_b() { this.field_98242_a.setParent(FMLLog.getLogger()); Handler[] ahandler = this.field_98242_a.getHandlers(); int i = ahandler.length; for (int j = 0; j < i; ++j) { Handler handler = ahandler[j]; this.field_98242_a.removeHandler(handler); } LogFormatter logformatter = new LogFormatter(this, (LogAgentINNER1) null); try { FileHandler filehandler = new FileHandler(this.field_98240_b, true); filehandler.setFormatter(logformatter); this.field_98242_a.addHandler(filehandler); } catch (Exception exception) { this.field_98242_a.log( Level.WARNING, "Failed to log " + this.field_98241_c + " to " + this.field_98240_b, exception); } }
// Preinitialisation Event @PreInit public void preInit(FMLPreInitializationEvent event) throws Exception { logger.setParent(FMLLog.getLogger()); try { if (CoreLoadingPlugin.callBack()) { CraftMineCore.logger.info("nintendofan9797-Core callback succeeded!"); } else { throw new Exception(); } } catch (Exception e) { throw new RuntimeException("nintendofan9797-Core is not installed/corrupt! Cannot proceed!"); } try { Validator.verify(); // Do some loading checks, for example checking // the jar signature. EnumPacketType.put( "KEYARMOR", PacketKeyArmor.class, "KEYARMOR", PacketChannelLib.CHANNEL_ARMOR_TO_SERVER, EnumDirection.SERVER); EnumPacketType.put( "SOUND", PacketSound.class, "SOUND", PacketChannelLib.CHANNEL_SV_TO_CL, EnumDirection.CLIENT); EnumPacketType.put( "ENDPICK", PacketEndPick.class, "ENDPICK", PacketChannelLib.CHANNEL_ENDPICK, EnumDirection.SERVER); EnumPacketType.put( "RENAME", PacketRename.class, "RENAME", PacketChannelLib.CHANNEL_SV_TO_CL, EnumDirection.CLIENT); EnumPacketType.put( "GUI", PacketGui.class, "GUI", PacketChannelLib.CHANNEL_SV_TO_CL, EnumDirection.CLIENT); EnumPacketType.put( "CAMO", PacketCamo.class, "CAMO", PacketChannelLib.CHANNEL_CAMO, EnumDirection.CLIENT); EnumPacketType.put( "KEY", PacketKey.class, "KEY", PacketChannelLib.CHANNEL_KEY, EnumDirection.SERVER); CoreLoadingPlugin.manager.registerMod(new PacketHandlerClient(), "CMPKC"); CoreLoadingPlugin.manager.registerMod(new PacketHandlerServer(), "CMPKS"); CoreLoadingPlugin.manager.getContainerForId("CMPKC").setSide(Side.CLIENT); CoreLoadingPlugin.manager.getContainerForId("CMPKS").setSide(Side.SERVER); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_ARMOR_TO_SERVER, "CMPKS"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_CL_TO_SV, "CMPKS"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_DATA_UPDATE, "CMPKC"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_ENDPICK, "CMPKS"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_INV_CHANGE, "CMPKS"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_MAIN, "CMPKS"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_SV_TO_CL, "CMPKC"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_CAMO, "CMPKC"); CoreLoadingPlugin.manager.registerChannelToMultipleHandlers( PacketChannelLib.CHANNEL_KEY, "CMPKS"); proxy.registerConfigurationCategories(); ReferenceLib.DAY = Calendar.getInstance().get(Calendar.DAY_OF_MONTH); // CraftMineCore.logger.info("Day: " + ReferenceLib.DAY); ReferenceLib.MONTH = Calendar.getInstance().get(Calendar.MONTH); // CraftMineCore.logger.info("Month: " + ReferenceLib.MONTH); logger.info("Attempting AutoUpdate..."); UpdateMain.doVersionCheck(); CapeLib.init(); proxy.registerGuis(); logger.info("Configuring API..."); CraftMineApi.constructionTab = tabsCraftMineConstruction; CraftMineApi.coreTab = tabsCraftMine; CraftMineApi.toolsTab = tabsCraftMineTools; if (event.getSide() == Side.SERVER) { logger.info("Initializing Server-side..."); isServer = true; } else { logger.info("Initializing Client-side..."); } proxy.registerSounds(); MinecraftForge.EVENT_BUS.register(new AttackHandler()); logger.info("Reading/Writing configuration values..."); try { Config.init(); } catch (Exception e) { CraftMineCore.logger.warning("Error while initialising configuration!"); CraftMineCore.logger.warning("Re-writing configuration file."); Config.rewriteConfig(); Config.init(); } } catch (Exception e) { CrashLogger.killWithError(e, "Fatal error during pre-initialization"); } }
public static void init() { logger.setParent(FMLLog.getLogger()); }
@EventHandler public void preInitialize(FMLPreInitializationEvent evt) { aboLog.setParent(FMLLog.getLogger()); aboLog.info( "Starting Additional-Buildcraft-Objects #@BUILD_NUMBER@ " + VERSION + " (Built for Minecraft @MINECRAFT_VERSION@ with Buildcraft @BUILDCRAFT_VERSION@ and Forge @FORGE_VERSION@"); aboLog.info("Copyright (c) Flow86, 2011-2013"); aboConfiguration = new ABOConfiguration(new File(evt.getModConfigurationDirectory(), "abo/main.conf")); try { aboConfiguration.load(); itemGateSettingsDuplicator = createItem( itemGateSettingsDuplicatorID, ItemGateSettingsDuplicator.class, "Gate Settings Duplicator", BuildCraftCore.wrenchItem, BuildCraftTransport.pipeGateAutarchic, null); pipeFluidsValve = createPipe( pipeFluidsValveID, PipeFluidsValve.class, "Valve Pipe", 1, BuildCraftTransport.pipeFluidsWood, BuildCraftTransport.pipeGateAutarchic, null); pipeFluidsGoldenIron = createPipe( pipeFluidsGoldenIronID, PipeFluidsGoldenIron.class, "Golden Iron Waterproof Pipe", 1, BuildCraftTransport.pipeFluidsGold, BuildCraftTransport.pipeFluidsIron, null); pipeFluidsBalance = createPipe( pipeFluidsBalanceID, PipeFluidsBalance.class, "Balancing Waterproof Pipe", 1, BuildCraftTransport.pipeFluidsWood, new ItemStack(BuildCraftEnergy.engineBlock, 1, 0), BuildCraftTransport.pipeFluidsWood); pipeFluidsDiamond = createPipe( pipeFluidsDiamondID, PipeFluidsDistribution.class, "Diamond Waterproof Pipe", 1, BuildCraftTransport.pipeItemsDiamond, BuildCraftTransport.pipeWaterproof, null); if (GameRegistry.findItem("APUnofficial", "item.PipeFluidsWaterPump") == null) { pipeFluidsWaterPump = createPipe( pipeFluidsWaterPumpID, PipeFluidsPump.class, "Water Pump Pipe", 1, false, new Object[] { " L ", "rPr", " W ", 'r', Item.redstone, 'P', BuildCraftCore.ironGearItem, 'L', BuildCraftTransport.pipeFluidsGold, 'W', BuildCraftTransport.pipeFluidsWood }); } pipeItemsRoundRobin = createPipe( pipeItemsRoundRobinID, PipeItemsRoundRobin.class, "RoundRobin Transport Pipe", 1, BuildCraftTransport.pipeItemsStone, Block.gravel, null); pipeItemsCompactor = createPipe( pipeItemsCompactorID, PipeItemsCompactor.class, "Compactor Pipe", 1, BuildCraftTransport.pipeItemsStone, Block.pistonBase, null); pipeItemsInsertion = createPipe( pipeItemsInsertionID, PipeItemsInsertion.class, "Insertion Pipe", 1, BuildCraftTransport.pipeItemsIron, new ItemStack(Item.dyePowder, 1, 2), null); pipeItemsExtraction = createPipe( pipeItemsExtractionID, PipeItemsExtraction.class, "Extraction Transport Pipe", 1, BuildCraftTransport.pipeItemsWood, Block.planks, null); pipeItemsBounce = createPipe( pipeItemsBounceID, PipeItemsBounce.class, "Bounce Transport Pipe", 1, BuildCraftTransport.pipeItemsStone, Block.cobblestone, null); pipeItemsCrossover = createPipe( pipeItemsCrossoverID, PipeItemsCrossover.class, "Crossover Transport Pipe", 1, BuildCraftTransport.pipeItemsStone, BuildCraftTransport.pipeItemsIron, null); pipeItemsStripes = createPipe( pipeItemsStripesID, PipeItemsStripes.class, "Stripes Transport Pipe", 8, new ItemStack(Item.dyePowder, 1, 0), Block.glass, new ItemStack(Item.dyePowder, 1, 11)); pipePowerSwitch = createPipe( pipePowerSwitchID, PipePowerSwitch.class, "Power Switch Pipe", 1, BuildCraftTransport.pipePowerGold, Block.lever, null); pipePowerIron = createPipe( pipePowerIronID, PipePowerIron.class, "Iron Power Pipe", 1, Item.redstone, BuildCraftTransport.pipeItemsIron, null); pipeDistributionConductive = createPipe( pipeDistributionConductiveID, PipePowerDistribution.class, "Distribution Conductive Pipe", 2, pipePowerIron, BuildCraftTransport.pipeItemsDiamond, pipePowerIron); triggerEngineSafe = new TriggerEngineSafe(triggerEngineSafeID); actionSwitchOnPipe = new ActionSwitchOnPipe(actionSwitchOnPipeID); actionToggleOnPipe = new ActionToggleOnPipe(actionToggleOnPipeID); actionToggleOffPipe = new ActionToggleOffPipe(actionToggleOffPipeID); ActionManager.registerActionProvider(new ABOActionProvider()); ActionManager.registerTriggerProvider(new ABOTriggerProvider()); BuildCraftCore.itemBptProps[pipeItemsExtraction.itemID] = new BptItemPipeWooden(); BuildCraftCore.itemBptProps[pipeFluidsValve.itemID] = new BptItemPipeIron(); BuildCraftCore.itemBptProps[pipeFluidsGoldenIron.itemID] = new BptItemPipeIron(); BuildCraftCore.itemBptProps[pipeFluidsDiamond.itemID] = new BptItemPipeDiamond(); BuildCraftCore.itemBptProps[pipePowerIron.itemID] = new BptItemPipeIron(); MinecraftForge.EVENT_BUS.register(this); } finally { if (aboConfiguration.hasChanged()) aboConfiguration.save(); } }
static { log.setParent(FMLLog.getLogger()); }
/** * Get a logger instance configured to write to the FML Log as a parent, identified by modid. * Handy for mod logging! Configurations can be applied through the <code> * config/logging.properties</code> file, specifying logging levels for your ModID. Use this! * * @return A logger */ public Logger getModLog() { Logger log = Logger.getLogger(modContainer.getModId()); log.setParent(FMLLog.getLogger()); return log; }
public SpoutcraftLogger() { this(FMLLog.getLogger()); }
@PreInit public void preInit(FMLPreInitializationEvent event) { logger = Logger.getLogger(ID); logger.setParent(FMLLog.getLogger()); }