summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java
blob: a1c6227d57a5516f8cf579ee21e068d3f893eb90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
 * Mod made by DarkKnight during the Modjam 3
 * It's an awesome mod
 * I love me! :D
 */
package darkknight.jewelrycraft;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.commands.JewelrycraftCommands;
import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.curses.CurseList;
import darkknight.jewelrycraft.entities.EntityList;
import darkknight.jewelrycraft.events.EventList;
import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.network.PacketHandler;
import darkknight.jewelrycraft.proxy.CommonProxy;
import darkknight.jewelrycraft.recipes.CraftingRecipes;
import darkknight.jewelrycraft.util.Variables;
import darkknight.jewelrycraft.worldGen.village.VillageHandler;

@Mod (modid = Variables.MODID, name = Variables.MODNAME, version = Variables.VERSION, guiFactory = Variables.CONFIG_GUI, acceptedMinecraftVersions = "[1.7.10,1.8)")
public class JewelrycraftMod
{
    @Instance (Variables.MODID)
    public static JewelrycraftMod instance;
    @SidedProxy (clientSide = Variables.CLIENT_PROXY, serverSide = Variables.SERVER_PROXY)
    public static CommonProxy proxy;
    public static final Logger logger = Logger.getLogger(Variables.MODNAME);
    public static File dir;
    public static CreativeTabs jewelrycraft = new CreativeTabs(Variables.MODID){
        @Override
        public Item getTabIconItem()
        {
            return Item.getItemFromBlock(BlockList.jewelCraftingTable);
        }
    };
    public static CreativeTabs liquids = new CreativeTabLiquids("Liquids");
    public static NBTTagCompound saveData = new NBTTagCompound();
    public static NBTTagCompound clientData = new NBTTagCompound();
    public static File liquidsConf;
    public static SimpleNetworkWrapper netWrapper;
    public static boolean fancyRender;
    List<String> authorList = new ArrayList<String>();
    
    /**
     * Pre initialization of mod stuff.
     *
     * @param e FMLPreInitializationEvent
     * @throws IOException Signals that an I/O exception has occurred.
     */
    @EventHandler
    public void preInit(FMLPreInitializationEvent e) throws IOException
    {
        ModMetadata metadata = e.getModMetadata();
        dir = e.getModConfigurationDirectory();
        ConfigHandler.INSTANCE.loadConfig(e);
        BlockList.preInit(e);
        ItemList.preInit(e);
        CraftingRecipes.preInit(e);
        CurseList.preInit(e);
        PacketHandler.preInit(e);
        EntityList.preInit(e);
        VillageHandler.preInit(e);
        EventList.preInit(e);
        authorList.add("OnyxDarkKnight");
        metadata.autogenerated = false;
        metadata.authorList = authorList;
        metadata.description = "Jewelrycraft 2 is a mod about creating jewellery and imbuing them with mystical powers. However, they have both positives and negatives. There are also curses, some good, some bad. Maybe acquiring some wouldn't be that bad.";
        metadata.credits = "domi1819, MrCompost, pau101, bspkrs";
        metadata.url = "https://github.com/sor1n/Jewelrycraft";
    }
    
    @EventHandler
    public void init(FMLInitializationEvent e)
    {
        EventList.init(e);
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent e)
    {
        EventList.postInit(e);
    }
    
    @Mod.EventHandler
    public void serverLoad(FMLServerStartingEvent event)
    {
        event.registerServerCommand(new JewelrycraftCommands());
    }
}