Created a config to disable the ore generator in total

This commit is contained in:
Robert S 2014-03-25 07:34:42 -04:00
parent 2b4bac211d
commit e6d0cc5319
2 changed files with 92 additions and 91 deletions

View file

@ -40,119 +40,118 @@ import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry; 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") @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) @NetworkMod(channels = Reference.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
@ModstatInfo(prefix = "resonantin") @ModstatInfo(prefix = "resonantin")
public class ResonantInduction public class ResonantInduction
{ {
/** Mod Information */ /** Mod Information */
public static final String ID = "ResonantInduction|Core"; public static final String ID = "ResonantInduction|Core";
public static final String NAME = Reference.NAME; public static final String NAME = Reference.NAME;
@Instance(ID) @Instance(ID)
public static ResonantInduction INSTANCE; public static ResonantInduction INSTANCE;
@SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy") @SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy")
public static CommonProxy proxy; public static CommonProxy proxy;
@Mod.Metadata(ID) @Mod.Metadata(ID)
public static ModMetadata metadata; public static ModMetadata metadata;
public static final Logger LOGGER = Logger.getLogger(Reference.NAME); public static final Logger LOGGER = Logger.getLogger(Reference.NAME);
/** Packets */ /** Packets */
public static final PacketTile PACKET_TILE = new PacketTile(Reference.CHANNEL); public static final PacketTile PACKET_TILE = new PacketTile(Reference.CHANNEL);
public static final PacketMultiPart PACKET_MULTIPART = new PacketMultiPart(Reference.CHANNEL); public static final PacketMultiPart PACKET_MULTIPART = new PacketMultiPart(Reference.CHANNEL);
public static final PacketAnnotation PACKET_ANNOTATION = new PacketAnnotation(Reference.CHANNEL); public static final PacketAnnotation PACKET_ANNOTATION = new PacketAnnotation(Reference.CHANNEL);
/** Blocks and Items */ /** Blocks and Items */
public static Block blockOre; public static Block blockOre;
public static ItemOreResource itemRubble, itemDust, itemRefinedDust; public static ItemOreResource itemRubble, itemDust, itemRefinedDust;
public static ItemOreResourceBucket itemBucketMixture, itemBucketMolten; public static ItemOreResourceBucket itemBucketMixture, itemBucketMolten;
public static Block blockDust; public static Block blockDust;
public static final HashMap<Integer, BlockFluidFinite> blockMixtureFluids = new HashMap<Integer, BlockFluidFinite>(); public static final HashMap<Integer, BlockFluidFinite> blockMixtureFluids = new HashMap<Integer, BlockFluidFinite>();
public static final HashMap<Integer, BlockFluidFinite> blockMoltenFluid = new HashMap<Integer, BlockFluidFinite>(); public static final HashMap<Integer, BlockFluidFinite> blockMoltenFluid = new HashMap<Integer, BlockFluidFinite>();
public static Block blockMachinePart; 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 */
* Recipe Types public static enum RecipeType
*/ {
public static enum RecipeType CRUSHER,
{ GRINDER,
CRUSHER, GRINDER, MIXER, SMELTER, SAWMILL; MIXER,
} SMELTER,
SAWMILL;
}
@EventHandler @EventHandler
public void preInit(FMLPreInitializationEvent evt) public void preInit(FMLPreInitializationEvent evt)
{ {
ResonantInduction.LOGGER.setParent(FMLLog.getLogger()); ResonantInduction.LOGGER.setParent(FMLLog.getLogger());
NetworkRegistry.instance().registerGuiHandler(this, proxy); NetworkRegistry.instance().registerGuiHandler(this, proxy);
Modstats.instance().getReporter().registerMod(this); Modstats.instance().getReporter().registerMod(this);
Settings.CONFIGURATION.load(); Settings.CONFIGURATION.load();
// Register Forge Events // Register Forge Events
MinecraftForge.EVENT_BUS.register(ResourceGenerator.INSTANCE); MinecraftForge.EVENT_BUS.register(ResourceGenerator.INSTANCE);
MinecraftForge.EVENT_BUS.register(new TextureHookHandler()); MinecraftForge.EVENT_BUS.register(new TextureHookHandler());
blockMachinePart = contentRegistry.createBlock(BlockMachineMaterial.class, ItemBlockMetadata.class); blockMachinePart = contentRegistry.createBlock(BlockMachineMaterial.class, ItemBlockMetadata.class);
/** /** Melting dusts */
* Melting dusts blockDust = contentRegistry.createTile(BlockDust.class, TileMaterial.class).setCreativeTab(null);
*/
blockDust = contentRegistry.createTile(BlockDust.class, TileMaterial.class).setCreativeTab(null);
// Items // Items
itemRubble = new ItemOreResource(Settings.getNextItemID("oreRubble"), "oreRubble"); itemRubble = new ItemOreResource(Settings.getNextItemID("oreRubble"), "oreRubble");
itemDust = new ItemOreResource(Settings.getNextItemID("oreDust"), "oreDust"); itemDust = new ItemOreResource(Settings.getNextItemID("oreDust"), "oreDust");
itemRefinedDust = new ItemOreResource(Settings.getNextItemID("oreRefinedDust"), "oreRefinedDust"); itemRefinedDust = new ItemOreResource(Settings.getNextItemID("oreRefinedDust"), "oreRefinedDust");
itemBucketMixture = new ItemOreResourceBucket(Settings.getNextItemID("bucketMixture"), "bucketMixture", false); itemBucketMixture = new ItemOreResourceBucket(Settings.getNextItemID("bucketMixture"), "bucketMixture", false);
itemBucketMolten = new ItemOreResourceBucket(Settings.getNextItemID("bucketMolten"), "bucketMolten", true); itemBucketMolten = new ItemOreResourceBucket(Settings.getNextItemID("bucketMolten"), "bucketMolten", true);
GameRegistry.registerItem(itemRubble, itemRubble.getUnlocalizedName()); GameRegistry.registerItem(itemRubble, itemRubble.getUnlocalizedName());
GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName()); GameRegistry.registerItem(itemDust, itemDust.getUnlocalizedName());
GameRegistry.registerItem(itemRefinedDust, itemRefinedDust.getUnlocalizedName()); GameRegistry.registerItem(itemRefinedDust, itemRefinedDust.getUnlocalizedName());
GameRegistry.registerItem(itemBucketMixture, itemBucketMixture.getUnlocalizedName()); GameRegistry.registerItem(itemBucketMixture, itemBucketMixture.getUnlocalizedName());
GameRegistry.registerItem(itemBucketMolten, itemBucketMolten.getUnlocalizedName()); GameRegistry.registerItem(itemBucketMolten, itemBucketMolten.getUnlocalizedName());
// Already registered with ContentRegistry // Already registered with ContentRegistry
// GameRegistry.registerTileEntity(TileMaterial.class, "ri_material"); // GameRegistry.registerTileEntity(TileMaterial.class, "ri_material");
GameRegistry.registerTileEntity(TileFluidMixture.class, "ri_fluid_mixture"); GameRegistry.registerTileEntity(TileFluidMixture.class, "ri_fluid_mixture");
proxy.preInit(); proxy.preInit();
TabRI.ITEMSTACK = new ItemStack(blockMachinePart); TabRI.ITEMSTACK = new ItemStack(blockMachinePart);
} }
@EventHandler @EventHandler
public void init(FMLInitializationEvent evt) public void init(FMLInitializationEvent evt)
{ {
// Load Languages // Load Languages
ResonantInduction.LOGGER.fine("Languages Loaded:" + LanguageUtility.loadLanguages(Reference.LANGUAGE_DIRECTORY, Reference.LANGUAGES)); ResonantInduction.LOGGER.fine("Languages Loaded:" + LanguageUtility.loadLanguages(Reference.LANGUAGE_DIRECTORY, Reference.LANGUAGES));
// Set Mod Metadata // Set Mod Metadata
Settings.setModMetadata(metadata, ID, NAME); Settings.setModMetadata(metadata, ID, NAME);
proxy.init(); proxy.init();
} }
@EventHandler @EventHandler
public void postInit(FMLPostInitializationEvent evt) public void postInit(FMLPostInitializationEvent evt)
{ {
try try
{ {
ConfigHandler.configure(Settings.CONFIGURATION, "resonantinduction"); ConfigHandler.configure(Settings.CONFIGURATION, "resonantinduction");
} }
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
} }
Settings.CONFIGURATION.save(); Settings.CONFIGURATION.save();
// Generate Resources // Generate Resources
ResourceGenerator.generateOreResources(); if (Settings.RESOURCE_GENERATOR)
proxy.postInit(); ResourceGenerator.generateOreResources();
} proxy.postInit();
}
} }

View file

@ -65,6 +65,8 @@ public class Settings
public static double LEVITATOR_MAX_SPEED = .2; public static double LEVITATOR_MAX_SPEED = .2;
@Config(category = Configuration.CATEGORY_GENERAL, key = "Levitator Acceleration") @Config(category = Configuration.CATEGORY_GENERAL, key = "Levitator Acceleration")
public static double LEVITATOR_ACCELERATION = .02; 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) public static void setModMetadata(ModMetadata metadata, String id, String name)
{ {