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

71 lines
3.0 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
2016-05-19 01:47:25 +02:00
* <p>
* Contributors:
2016-05-19 01:47:25 +02:00
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest;
2016-05-19 01:47:25 +02:00
import java.util.Properties;
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.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;
@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:Forge@[12.17.0.1909,)", acceptedMinecraftVersions = "[1.9.4]")
public class IronChest
2014-09-26 01:40:09 +02:00
{
2016-05-19 01:47:25 +02:00
public static final String MOD_ID = "IronChest";
@Instance(IronChest.MOD_ID)
public static IronChest instance;
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
public static CommonProxy proxy;
2016-05-19 01:47:25 +02:00
public static BlockIronChest ironChestBlock;
public static ItemIronChest ironChestItemBlock;
@EventHandler
2016-05-19 01:47:25 +02:00
public void preInit(FMLPreInitializationEvent event)
{
2016-05-19 01:47:25 +02:00
Properties properties = event.getVersionProperties();
2016-05-19 01:47:25 +02:00
if (properties != null)
{
String major = properties.getProperty("IronChest.build.major.number");
String minor = properties.getProperty("IronChest.build.minor.number");
String rev = properties.getProperty("IronChest.build.revision.number");
String build = properties.getProperty("IronChest.build.number");
// String mcversion = properties.getProperty("IronChest.build.mcversion");
event.getModMetadata().version = String.format("%s.%s.%s build %s", major, minor, rev, build);
}
2016-05-19 01:47:25 +02:00
ChestChangerType.buildItems();
ironChestBlock = GameRegistry.register(new BlockIronChest());
ironChestItemBlock = GameRegistry.register(new ItemIronChest(ironChestBlock));
2016-05-19 01:47:25 +02:00
for (IronChestType typ : IronChestType.VALUES)
{
2016-05-19 01:47:25 +02:00
GameRegistry.registerTileEntity(typ.clazz, "IronChest." + typ.name());
}
2016-05-19 01:47:25 +02:00
2014-09-26 02:03:18 +02:00
IronChestType.registerBlocksAndRecipes(ironChestBlock);
ChestChangerType.generateRecipes();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
proxy.registerRenderInformation();
2016-05-19 01:47:25 +02:00
// FIXME: MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler());
2016-03-24 03:51:54 +01:00
MinecraftForge.EVENT_BUS.register(IronChestEventHandler.INSTANCE);
}
}