2012-08-11 07:46:49 +02:00
|
|
|
package cpw.mods.ironchest;
|
|
|
|
|
|
2012-08-13 07:24:25 +02:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2012-08-11 07:46:49 +02:00
|
|
|
import cpw.mods.fml.common.Mod;
|
2013-07-02 19:54:03 +02:00
|
|
|
import cpw.mods.fml.common.Mod.EventHandler;
|
2012-08-11 07:46:49 +02:00
|
|
|
import cpw.mods.fml.common.Mod.Instance;
|
|
|
|
|
import cpw.mods.fml.common.SidedProxy;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
|
|
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
|
|
|
|
|
2014-08-03 23:56:42 +02:00
|
|
|
@Mod(modid = IronChest.modid, name = IronChest.name)
|
2012-08-11 07:46:49 +02:00
|
|
|
public class IronChest {
|
2014-08-03 23:56:42 +02:00
|
|
|
public static final String modid = "IronChest", name = "Iron Chests";
|
2014-08-03 23:48:02 +02:00
|
|
|
|
2014-08-03 23:56:42 +02:00
|
|
|
@Instance(modid)
|
|
|
|
|
public static IronChest instance;
|
2014-08-03 23:48:02 +02:00
|
|
|
|
2014-08-03 23:56:42 +02:00
|
|
|
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
|
|
|
|
|
public static CommonProxy proxy;
|
|
|
|
|
|
|
|
|
|
public static BlockIronChest ironChestBlock;
|
2012-08-11 07:46:49 +02:00
|
|
|
|
2013-07-02 19:54:03 +02:00
|
|
|
@EventHandler
|
2014-08-03 23:48:02 +02:00
|
|
|
public void preInit(FMLPreInitializationEvent e)
|
2012-12-18 17:22:21 +01:00
|
|
|
{
|
2014-08-03 23:48:02 +02:00
|
|
|
Version.init(e.getVersionProperties());
|
|
|
|
|
e.getModMetadata().version = Version.fullVersionString();
|
|
|
|
|
|
|
|
|
|
for (ChestChangerType type : ChestChangerType.values())
|
|
|
|
|
type.buildItem();
|
2014-02-05 19:06:35 +01:00
|
|
|
ironChestBlock = new BlockIronChest();
|
2013-07-02 19:54:03 +02:00
|
|
|
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
|
2014-08-03 23:48:02 +02:00
|
|
|
|
2014-02-05 19:06:35 +01:00
|
|
|
PacketHandler.INSTANCE.ordinal();
|
2012-12-18 17:22:21 +01:00
|
|
|
}
|
2012-08-11 07:46:49 +02:00
|
|
|
|
2013-07-02 19:54:03 +02:00
|
|
|
@EventHandler
|
2014-08-03 23:48:02 +02:00
|
|
|
public void init(FMLInitializationEvent e)
|
2012-12-18 17:22:21 +01:00
|
|
|
{
|
|
|
|
|
for (IronChestType typ : IronChestType.values())
|
|
|
|
|
{
|
2014-08-03 23:56:42 +02:00
|
|
|
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, modid + "." + typ.name(), typ.name());
|
2012-12-18 17:22:21 +01:00
|
|
|
proxy.registerTileEntitySpecialRenderer(typ);
|
|
|
|
|
}
|
2013-04-11 14:43:34 +02:00
|
|
|
IronChestType.registerBlocksAndRecipes(ironChestBlock);
|
2012-12-18 17:22:21 +01:00
|
|
|
ChestChangerType.generateRecipes();
|
2014-02-05 19:06:35 +01:00
|
|
|
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
|
2012-12-18 17:22:21 +01:00
|
|
|
proxy.registerRenderInformation();
|
|
|
|
|
MinecraftForge.EVENT_BUS.register(this);
|
|
|
|
|
}
|
|
|
|
|
|
2012-08-11 07:46:49 +02:00
|
|
|
}
|