79 lines
3.3 KiB
Java
79 lines
3.3 KiB
Java
|
/*******************************************************************************
|
||
|
* Copyright (c) 2012 cpw.
|
||
|
* All rights reserved. This program and the accompanying materials
|
||
|
* are made available under the terms of the GNU Public License v3.0
|
||
|
* which accompanies this distribution, and is available at
|
||
|
* http://www.gnu.org/licenses/gpl.html
|
||
|
*
|
||
|
* Contributors:
|
||
|
* cpw - initial API and implementation
|
||
|
******************************************************************************/
|
||
|
package cpw.mods.ironchest;
|
||
|
|
||
|
import net.minecraft.init.Blocks;
|
||
|
import net.minecraftforge.fml.common.Mod;
|
||
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||
|
import net.minecraftforge.fml.common.Mod.Instance;
|
||
|
import net.minecraftforge.fml.common.SidedProxy;
|
||
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||
|
import net.minecraftforge.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)
|
||
|
{
|
||
|
Version.init(event.getVersionProperties());
|
||
|
event.getModMetadata().version = Version.fullVersionString();
|
||
|
/*TODO 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();
|
||
|
}*/
|
||
|
ironChestBlock = new BlockIronChest();
|
||
|
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
|
||
|
PacketHandler.INSTANCE.ordinal();
|
||
|
}
|
||
|
|
||
|
@EventHandler
|
||
|
public void load(FMLInitializationEvent evt)
|
||
|
{
|
||
|
for (IronChestType typ : IronChestType.values())
|
||
|
{
|
||
|
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest."+typ.name(), typ.name());
|
||
|
proxy.registerTileEntitySpecialRenderer(typ);
|
||
|
}
|
||
|
//OreDictionary.registerOre("chestWood", Blocks.chest);
|
||
|
IronChestType.registerBlocksAndRecipes(ironChestBlock);
|
||
|
ChestChangerType.generateRecipes();
|
||
|
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
|
||
|
proxy.registerRenderInformation();
|
||
|
// if (OCELOTS_SITONCHESTS)
|
||
|
// {
|
||
|
// MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler());
|
||
|
// }
|
||
|
}
|
||
|
}
|