ironbarrels/src/main/java/cpw/mods/ironchest/IronChest.java

63 lines
2.7 KiB
Java
Raw Normal View History

/*******************************************************************************
* 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;
2016-03-24 03:51:54 +01:00
import cpw.mods.ironchest.client.IronChestEventHandler;
2014-12-02 21:25:03 +01:00
import net.minecraftforge.common.MinecraftForge;
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@[12.16.0.1819,)", acceptedMinecraftVersions = "[1.9]")
public class IronChest
2014-09-26 01:40:09 +02:00
{
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;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
Version.init(event.getVersionProperties());
event.getModMetadata().version = Version.fullVersionString();
}
@EventHandler
public void load(FMLInitializationEvent evt)
{
// Registration has been moved to init to account for the registration of inventory models
// Minecraft.getRenderItem() returns null before this stage
2014-09-26 01:40:09 +02:00
ChestChangerType.buildItems();
ironChestBlock = new BlockIronChest();
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
for (IronChestType typ : IronChestType.values())
{
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest." + typ.name(), typ.name());
2016-01-12 23:27:56 +01:00
proxy.registerTileEntitySpecialRenderer(typ.clazz);
}
2014-09-26 02:03:18 +02:00
IronChestType.registerBlocksAndRecipes(ironChestBlock);
ChestChangerType.generateRecipes();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
proxy.registerRenderInformation();
2014-12-02 21:25:03 +01:00
MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler());
2016-03-24 03:51:54 +01:00
MinecraftForge.EVENT_BUS.register(IronChestEventHandler.INSTANCE);
}
}