package com.yolp900.itsjustacharm;
import com.yolp900.itsjustacharm.api.IJCConstants;
import com.yolp900.itsjustacharm.common.CommonProxy;
import com.yolp900.itsjustacharm.common.blocks.ModBlocks;
import com.yolp900.itsjustacharm.reference.LibLocations;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import javax.annotation.Nonnull;
@Mod(modid = IJCConstants.MOD_ID, name = IJCConstants.MOD_NAME, version = IJCConstants.MOD_VERSION, guiFactory = LibLocations.LOCATION_GUI_FACTORY, dependencies = IJCConstants.DEPENDENCIES)
public class ItsJustaCharm {
@Mod.Instance
public static ItsJustaCharm instance;
@SidedProxy (modId = IJCConstants.MOD_ID, serverSide = LibLocations.LOCATION_COMMON_PROXY, clientSide = LibLocations.LOCATION_CLIENT_PROXY)
public static CommonProxy proxy;
public static CreativeTabs creativeTab = new ModCreativeTab();
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
proxy.preInit(event);
}
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
proxy.init(event);
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit(event);
}
private static class ModCreativeTab extends CreativeTabs {
ModCreativeTab() {
super(IJCConstants.MOD_ID);
}
@Override
@Nonnull
public Item getTabIconItem() {
Item icon = Items.ENCHANTED_BOOK;
Item itemblock = Item.getItemFromBlock(ModBlocks.ConstructionTable);
if (itemblock != null) {
icon = itemblock;
}
return icon;
}
}
}