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 net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public enum ChestChangerType {
|
||||
|
|
@ -50,7 +49,7 @@ public enum ChestChangerType {
|
|||
return this.target.ordinal();
|
||||
}
|
||||
|
||||
public ItemChestChanger buildItem(Configuration cfg)
|
||||
public ItemChestChanger buildItem()
|
||||
{
|
||||
item = new ItemChestChanger(this);
|
||||
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()
|
||||
{
|
||||
for (ChestChangerType item : values())
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
package cpw.mods.ironchest;
|
||||
|
||||
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.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
|
|
@ -18,46 +13,33 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
|||
@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[10.10,);required-after:FML@[7.2,)")
|
||||
public class IronChest {
|
||||
public static BlockIronChest ironChestBlock;
|
||||
|
||||
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@Instance("IronChest")
|
||||
public static IronChest instance;
|
||||
public static boolean CACHE_RENDER = true;
|
||||
public static boolean OCELOTS_SITONCHESTS = true;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
public void preInit(FMLPreInitializationEvent e)
|
||||
{
|
||||
Version.init(event.getVersionProperties());
|
||||
event.getModMetadata().version = Version.fullVersionString();
|
||||
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
|
||||
try
|
||||
{
|
||||
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();
|
||||
}
|
||||
Version.init(e.getVersionProperties());
|
||||
e.getModMetadata().version = Version.fullVersionString();
|
||||
|
||||
for (ChestChangerType type : ChestChangerType.values())
|
||||
type.buildItem();
|
||||
ironChestBlock = new BlockIronChest();
|
||||
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
|
||||
|
||||
PacketHandler.INSTANCE.ordinal();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent evt)
|
||||
public void init(FMLInitializationEvent e)
|
||||
{
|
||||
for (IronChestType typ : IronChestType.values())
|
||||
{
|
||||
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest."+typ.name(), typ.name());
|
||||
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest." + typ.name(), typ.name());
|
||||
proxy.registerTileEntitySpecialRenderer(typ);
|
||||
}
|
||||
IronChestType.registerBlocksAndRecipes(ironChestBlock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue