Completely removed the configuration file since none of its values are even used
This commit is contained in:
parent
729968a509
commit
a6e0afd0a0
|
|
@ -10,7 +10,6 @@ import static cpw.mods.ironchest.IronChestType.SILVER;
|
||||||
import static cpw.mods.ironchest.IronChestType.WOOD;
|
import static cpw.mods.ironchest.IronChestType.WOOD;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
public enum ChestChangerType {
|
public enum ChestChangerType {
|
||||||
|
|
@ -50,7 +49,7 @@ public enum ChestChangerType {
|
||||||
return this.target.ordinal();
|
return this.target.ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemChestChanger buildItem(Configuration cfg)
|
public ItemChestChanger buildItem()
|
||||||
{
|
{
|
||||||
item = new ItemChestChanger(this);
|
item = new ItemChestChanger(this);
|
||||||
GameRegistry.registerItem(item, itemName);
|
GameRegistry.registerItem(item, itemName);
|
||||||
|
|
@ -70,14 +69,6 @@ public enum ChestChangerType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void buildItems(Configuration cfg)
|
|
||||||
{
|
|
||||||
for (ChestChangerType type : values())
|
|
||||||
{
|
|
||||||
type.buildItem(cfg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void generateRecipes()
|
public static void generateRecipes()
|
||||||
{
|
{
|
||||||
for (ChestChangerType item : values())
|
for (ChestChangerType item : values())
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
package cpw.mods.ironchest;
|
package cpw.mods.ironchest;
|
||||||
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLLog;
|
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.Mod.EventHandler;
|
import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.Instance;
|
||||||
|
|
@ -18,42 +13,29 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[10.10,);required-after:FML@[7.2,)")
|
@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[10.10,);required-after:FML@[7.2,)")
|
||||||
public class IronChest {
|
public class IronChest {
|
||||||
public static BlockIronChest ironChestBlock;
|
public static BlockIronChest ironChestBlock;
|
||||||
|
|
||||||
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
|
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
|
||||||
public static CommonProxy proxy;
|
public static CommonProxy proxy;
|
||||||
|
|
||||||
@Instance("IronChest")
|
@Instance("IronChest")
|
||||||
public static IronChest instance;
|
public static IronChest instance;
|
||||||
public static boolean CACHE_RENDER = true;
|
|
||||||
public static boolean OCELOTS_SITONCHESTS = true;
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void preInit(FMLPreInitializationEvent event)
|
public void preInit(FMLPreInitializationEvent e)
|
||||||
{
|
{
|
||||||
Version.init(event.getVersionProperties());
|
Version.init(e.getVersionProperties());
|
||||||
event.getModMetadata().version = Version.fullVersionString();
|
e.getModMetadata().version = Version.fullVersionString();
|
||||||
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
|
|
||||||
try
|
for (ChestChangerType type : ChestChangerType.values())
|
||||||
{
|
type.buildItem();
|
||||||
cfg.load();
|
|
||||||
ChestChangerType.buildItems(cfg);
|
|
||||||
CACHE_RENDER = cfg.get(Configuration.CATEGORY_GENERAL, "cacheRenderingInformation", true).getBoolean(true);
|
|
||||||
OCELOTS_SITONCHESTS = cfg.get(Configuration.CATEGORY_GENERAL, "ocelotsSitOnChests", true).getBoolean(true);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
FMLLog.log(Level.ERROR, e, "IronChest has a problem loading its configuration");
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (cfg.hasChanged())
|
|
||||||
cfg.save();
|
|
||||||
}
|
|
||||||
ironChestBlock = new BlockIronChest();
|
ironChestBlock = new BlockIronChest();
|
||||||
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
|
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
|
||||||
|
|
||||||
PacketHandler.INSTANCE.ordinal();
|
PacketHandler.INSTANCE.ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void load(FMLInitializationEvent evt)
|
public void init(FMLInitializationEvent e)
|
||||||
{
|
{
|
||||||
for (IronChestType typ : IronChestType.values())
|
for (IronChestType typ : IronChestType.values())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue