From e6d0cc5319035c9fa41efb65d3c19e7d35ae9008 Mon Sep 17 00:00:00 2001 From: Robert S Date: Tue, 25 Mar 2014 07:34:42 -0400 Subject: [PATCH] Created a config to disable the ore generator in total --- .../core/ResonantInduction.java | 181 +++++++++--------- .../resonantinduction/core/Settings.java | 2 + 2 files changed, 92 insertions(+), 91 deletions(-) diff --git a/src/main/scala/resonantinduction/core/ResonantInduction.java b/src/main/scala/resonantinduction/core/ResonantInduction.java index 8d017ebcd..0e15f3de8 100644 --- a/src/main/scala/resonantinduction/core/ResonantInduction.java +++ b/src/main/scala/resonantinduction/core/ResonantInduction.java @@ -40,119 +40,118 @@ import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; -/** - * The core module of Resonant Induction +/** The core module of Resonant Induction * - * @author Calclavia - */ + * @author Calclavia */ @Mod(modid = ResonantInduction.ID, name = ResonantInduction.NAME, version = Reference.VERSION, dependencies = "required-after:ForgeMultipart@[1.0.0.244,);required-after:CalclaviaCore;before:ThermalExpansion;before:Mekanism") @NetworkMod(channels = Reference.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) @ModstatInfo(prefix = "resonantin") public class ResonantInduction { - /** Mod Information */ - public static final String ID = "ResonantInduction|Core"; - public static final String NAME = Reference.NAME; + /** Mod Information */ + public static final String ID = "ResonantInduction|Core"; + public static final String NAME = Reference.NAME; - @Instance(ID) - public static ResonantInduction INSTANCE; + @Instance(ID) + public static ResonantInduction INSTANCE; - @SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy") - public static CommonProxy proxy; + @SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy") + public static CommonProxy proxy; - @Mod.Metadata(ID) - public static ModMetadata metadata; + @Mod.Metadata(ID) + public static ModMetadata metadata; - public static final Logger LOGGER = Logger.getLogger(Reference.NAME); + public static final Logger LOGGER = Logger.getLogger(Reference.NAME); - /** Packets */ - public static final PacketTile PACKET_TILE = new PacketTile(Reference.CHANNEL); - public static final PacketMultiPart PACKET_MULTIPART = new PacketMultiPart(Reference.CHANNEL); - public static final PacketAnnotation PACKET_ANNOTATION = new PacketAnnotation(Reference.CHANNEL); + /** Packets */ + public static final PacketTile PACKET_TILE = new PacketTile(Reference.CHANNEL); + public static final PacketMultiPart PACKET_MULTIPART = new PacketMultiPart(Reference.CHANNEL); + public static final PacketAnnotation PACKET_ANNOTATION = new PacketAnnotation(Reference.CHANNEL); - /** Blocks and Items */ - public static Block blockOre; - public static ItemOreResource itemRubble, itemDust, itemRefinedDust; - public static ItemOreResourceBucket itemBucketMixture, itemBucketMolten; - public static Block blockDust; - public static final HashMap blockMixtureFluids = new HashMap(); - public static final HashMap blockMoltenFluid = new HashMap(); - public static Block blockMachinePart; + /** Blocks and Items */ + public static Block blockOre; + public static ItemOreResource itemRubble, itemDust, itemRefinedDust; + public static ItemOreResourceBucket itemBucketMixture, itemBucketMolten; + public static Block blockDust; + public static final HashMap blockMixtureFluids = new HashMap(); + public static final HashMap blockMoltenFluid = new HashMap(); + public static Block blockMachinePart; - public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, Settings.idManager, ID).setPrefix(Reference.PREFIX).setTab(TabRI.CORE); + public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.CONFIGURATION, Settings.idManager, ID).setPrefix(Reference.PREFIX).setTab(TabRI.CORE); - /** - * Recipe Types - */ - public static enum RecipeType - { - CRUSHER, GRINDER, MIXER, SMELTER, SAWMILL; - } + /** Recipe Types */ + public static enum RecipeType + { + CRUSHER, + GRINDER, + MIXER, + SMELTER, + SAWMILL; + } - @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()); + @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); + blockMachinePart = contentRegistry.createBlock(BlockMachineMaterial.class, ItemBlockMetadata.class); - /** - * Melting dusts - */ - blockDust = contentRegistry.createTile(BlockDust.class, TileMaterial.class).setCreativeTab(null); + /** Melting dusts */ + blockDust = contentRegistry.createTile(BlockDust.class, TileMaterial.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); + // 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); - 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()); + 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"); + // Already registered with ContentRegistry + // GameRegistry.registerTileEntity(TileMaterial.class, "ri_material"); + GameRegistry.registerTileEntity(TileFluidMixture.class, "ri_fluid_mixture"); - proxy.preInit(); - TabRI.ITEMSTACK = new ItemStack(blockMachinePart); - } + proxy.preInit(); + TabRI.ITEMSTACK = new ItemStack(blockMachinePart); + } - @EventHandler - public void init(FMLInitializationEvent evt) - { - // Load Languages - ResonantInduction.LOGGER.fine("Languages Loaded:" + LanguageUtility.loadLanguages(Reference.LANGUAGE_DIRECTORY, Reference.LANGUAGES)); - // Set Mod Metadata - Settings.setModMetadata(metadata, ID, NAME); - proxy.init(); - } + @EventHandler + public void init(FMLInitializationEvent evt) + { + // Load Languages + ResonantInduction.LOGGER.fine("Languages Loaded:" + LanguageUtility.loadLanguages(Reference.LANGUAGE_DIRECTORY, Reference.LANGUAGES)); + // Set Mod Metadata + Settings.setModMetadata(metadata, ID, NAME); + proxy.init(); + } - @EventHandler - public void postInit(FMLPostInitializationEvent evt) - { - try - { - ConfigHandler.configure(Settings.CONFIGURATION, "resonantinduction"); - } - catch (Exception e) - { - e.printStackTrace(); - } + @EventHandler + public void postInit(FMLPostInitializationEvent evt) + { + try + { + ConfigHandler.configure(Settings.CONFIGURATION, "resonantinduction"); + } + catch (Exception e) + { + e.printStackTrace(); + } - Settings.CONFIGURATION.save(); - // Generate Resources - ResourceGenerator.generateOreResources(); - proxy.postInit(); - } + Settings.CONFIGURATION.save(); + // Generate Resources + if (Settings.RESOURCE_GENERATOR) + ResourceGenerator.generateOreResources(); + proxy.postInit(); + } } diff --git a/src/main/scala/resonantinduction/core/Settings.java b/src/main/scala/resonantinduction/core/Settings.java index 9221db918..cdfbdd4e7 100644 --- a/src/main/scala/resonantinduction/core/Settings.java +++ b/src/main/scala/resonantinduction/core/Settings.java @@ -65,6 +65,8 @@ public class Settings public static double LEVITATOR_MAX_SPEED = .2; @Config(category = Configuration.CATEGORY_GENERAL, key = "Levitator Acceleration") public static double LEVITATOR_ACCELERATION = .02; + @Config(category = Configuration.CATEGORY_GENERAL, key = "Enabled Resource Generator") + public static boolean RESOURCE_GENERATOR = true; public static void setModMetadata(ModMetadata metadata, String id, String name) {