mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 04:09:40 +00:00
89 lines
3.5 KiB
Java
89 lines
3.5 KiB
Java
package tinker.armory;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
import net.minecraftforge.common.Configuration;
|
|
|
|
public class PHArmory
|
|
{
|
|
|
|
public static void initProps()
|
|
{
|
|
/* Here we will set up the config file for the mod
|
|
* First: Create a folder inside the config folder
|
|
* Second: Create the actual config file
|
|
* Note: Configs are a pain, but absolutely necessary for every mod.
|
|
*/
|
|
|
|
File file = new File(Armory.proxy.getMinecraftDir() + "/config/InfiCraft");
|
|
file.mkdir();
|
|
File newFile = new File(Armory.proxy.getMinecraftDir() + "/config/InfiCraft/Armory.txt");
|
|
|
|
/* Some basic debugging will go a long way */
|
|
try
|
|
{
|
|
newFile.createNewFile();
|
|
System.out.println("Successfully read configuration file for mod_FloraBerries");
|
|
}
|
|
catch (IOException e)
|
|
{
|
|
System.out.println("Could not read configuration file for mod_FloraBerries. Reason:");
|
|
System.out.println(e);
|
|
}
|
|
|
|
/* [Forge] Configuration class, used as config method */
|
|
Configuration config = new Configuration(newFile);
|
|
|
|
/* Load the configuration file */
|
|
config.load();
|
|
|
|
/* Define the mod's IDs.
|
|
* Avoid values below 4096 for items and in the 250-450 and 2216-2226 range for blocks
|
|
*/
|
|
|
|
armorBlock = config.getBlock("Armor Stand", 3257).getInt(3257);
|
|
rackBlock = config.getBlock("Tool Rack", 3257).getInt(3257);
|
|
armorItem = config.getItem("Armor Stand Item", 4570).getInt(4570);
|
|
/*berryBlockID = config.getBlock("Berry_Bush", 3257).getInt(3257);
|
|
berryItemID = config.getItem("Berry_Food", 12402).getInt(12402);
|
|
|
|
raspSpawnDensity = config.get("general", "Raspberry_Spawn_Density", 14).getInt(14);
|
|
raspSpawnHeight = config.get("general", "Raspberry_Spawn_Height", 64).getInt(64);
|
|
raspSpawnRange = config.get("general", "Raspberry_Spawn_Range", 128).getInt(128);
|
|
blueSpawnDensity = config.get("general", "Blueberry_Spawn_Density", 12).getInt(12);
|
|
blueSpawnHeight = config.get("general", "Blueberry_Spawn_Height", 64).getInt(64);
|
|
blueSpawnRange = config.get("general", "Blueberry_Spawn_Range", 128).getInt(128);
|
|
blackSpawnDensity = config.get("general", "Blackberry_Spawn_Density", 10).getInt(10);
|
|
blackSpawnHeight = config.get("general", "Blackberry_Spawn_Height", 64).getInt(64);
|
|
blackSpawnRange = config.get("general", "Blackberry_Spawn_Range", 128).getInt(128);
|
|
geoSpawnDensity = config.get("general", "Geoberry_Spawn_Density", 14).getInt(14);
|
|
geoSpawnHeight = config.get("general", "Geoberry_Spawn_Height", 64).getInt(64);
|
|
geoSpawnRange = config.get("general", "Geoberry_Spawn_Range", 128).getInt(128);*/
|
|
|
|
/* Save the configuration file */
|
|
config.save();
|
|
}
|
|
|
|
/* Prototype fields, used elsewhere */
|
|
public static int armorBlock;
|
|
public static int armorItem;
|
|
public static int rackBlock;
|
|
/*public static int raspSpawnDensity;
|
|
public static int raspSpawnHeight;
|
|
public static int raspSpawnRange;
|
|
public static int blueSpawnDensity;
|
|
public static int blueSpawnHeight;
|
|
public static int blueSpawnRange;
|
|
public static int blackSpawnDensity;
|
|
public static int blackSpawnHeight;
|
|
public static int blackSpawnRange;
|
|
public static int geoSpawnDensity;
|
|
public static int geoSpawnHeight;
|
|
public static int geoSpawnRange;
|
|
|
|
public static int berryItemID;
|
|
public static int berryBlockID;*/
|
|
|
|
}
|