-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLM_Main.java
More file actions
154 lines (133 loc) · 6.99 KB
/
LM_Main.java
File metadata and controls
154 lines (133 loc) · 6.99 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package LiquidMetals;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
import buildcraft.BuildCraftTransport;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
import LiquidMetals.Blocks.BlockCraftingTable;
import LiquidMetals.Blocks.BlockFurnace;
import LiquidMetals.Blocks.BlockGrinder1;
import LiquidMetals.Blocks.BlockGrinder2;
import LiquidMetals.Blocks.BlockGrinder3;
import LiquidMetals.Blocks.BlockIngotFormer;
import LiquidMetals.Blocks.DEBUGLiquidGen;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
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.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* This is the main mod class. This is basically just an event handler which passes
* off events to different classes as needed to get things loaded correctly.
*
* This class also holds references to all our blocks and items that get added to the game.
*/
@Mod(modid = "LiquidMetals", useMetadata = true, dependencies="required-after:BuildCraft|Silicon; required-after:BuildCraft|Core; required-after:BuildCraft|Transport; required-after:BuildCraft|Factory; required-after:BuildCraft|Energy; required-after:BuildCraft|Builders;")
@NetworkMod(serverSideRequired = true, clientSideRequired = true)
public class LM_Main {
@Instance("LiquidMetals")
public static LM_Main instance = new LM_Main();
public static GuiHandler guiHandler = new GuiHandler();
@SidedProxy(clientSide = "LiquidMetals.ClientProxy", serverSide = "LiquidMetals.CommonProxy")
public static CommonProxy proxy;
//start
public static Item molten;
public static Item bucketMolten;
public static Item gravel;
public static Item sand;
public static Item dust;
public static Item marker;
public static LiquidStack liquid;
//end
//start blocks
public static BlockGrinder1 blockGrinder1;
public static BlockGrinder2 blockGrinder2;
public static BlockGrinder3 blockGrinder3;
public static BlockFurnace blockFurnace;
public static BlockIngotFormer blockIngotFormer;
public static BlockCraftingTable blockCrafting;
public static DEBUGLiquidGen blockDebugLiquidGen;
//start tabs
public static CreativeTabs tabItems;
public static CreativeTabs tabBlocks;
/**
* The mod's pre-initialisation event hook. Deals with reading and/or initialising the configuration file
* and registering all our blocks and items (which has to be done here so that they're in the
* system before statistics and achievements are initialised - or it borks!).
*
* @param event The event details.
*/
@PreInit
public void preInitialise(FMLPreInitializationEvent event) {
DEFAULT_SETTINGS.readConfig(event.getSuggestedConfigurationFile());
DEFAULT_SETTINGS.setup();
DEFAULT_SETTINGS.initTabs();
DEFAULT_SETTINGS.initBlocks();
DEFAULT_SETTINGS.initItems();
DEFAULT_SETTINGS.setupLiquids();
proxy.registerEventHandlers();
}
/**
* The mod's initialisation event hook (previously the 'load' function). Deals with registration of generic
* recipes, pre-loading of textures, initialisation of rendering functionality and GUI handler registration.
*
* @param event The event details.
*/
@Init
public void initialise(FMLInitializationEvent event) {
NetworkRegistry.instance().registerGuiHandler(instance, guiHandler);
proxy.registerRenderers();
proxy.registerTextureFX();
DEFAULT_SETTINGS.setupOreDict();
}
/**
* The mod's post-initialisation event hook (previously 'modsLoaded'). Deals with integration into other
* (now initialised) mods, including - but not limited to - registration of mod-reliant recipes.
*
* @param event The event details.
*/
@PostInit
public void postInitialise(FMLPostInitializationEvent event) {
DEFAULT_SETTINGS.addGrinderRecipes();
DEFAULT_SETTINGS.addArcFurnaceRecipes();
DEFAULT_SETTINGS.addIngotFormerRecipes();
DEFAULT_SETTINGS.fixLiquids();
if(DEFAULT_SETTINGS.tweakRp2Alloy) {
DEFAULT_SETTINGS.editRp2Recipes();
}
if(DEFAULT_SETTINGS.grindingVersion) {
GameRegistry.addRecipe(new ItemStack(blockGrinder1), "#@#", "$%$", "###", '#', Item.ingotIron, '$', Block.pistonBase, '%', Block.blockSteel, '@', BuildCraftTransport.pipePowerWood);
GameRegistry.addRecipe(new ItemStack(blockGrinder2), "#@#", "$%$", "###", '#', Item.ingotGold, '$', BuildCraftCore.ironGearItem, '%', blockGrinder1, '@', BuildCraftTransport.pipePowerStone);
GameRegistry.addRecipe(new ItemStack(blockGrinder3), "#@#", "$%$", "###", '#', Item.diamond, '$', BuildCraftCore.goldGearItem, '%', blockGrinder2, '@', BuildCraftTransport.pipePowerGold);
}
GameRegistry.addRecipe(new ItemStack(blockIngotFormer), "!@!", "!#!", "!!!", '!', Item.ingotIron, '@', BuildCraftFactory.tankBlock, '#', BuildCraftCore.goldGearItem);
GameRegistry.addRecipe(new ItemStack(blockFurnace), "#@#", "#%#", "#*#", '#', Item.ingotIron, '@', BuildCraftCore.diamondGearItem, '%', Block.blockSteel, '*', BuildCraftTransport.pipePowerGold);
GameRegistry.addRecipe(new ItemStack(blockCrafting), "#$#", "#%#", "(@(", '#', Item.ingotGold, '$', Item.diamond, '%', this.blockIngotFormer, '(', Item.ingotIron, '@', BuildCraftTransport.pipePowerGold);
GameRegistry.addRecipe(new ItemStack(marker, 2, 0), "!", "@", "#", '!', new ItemStack(Item.dyePowder, 1, 1), '@', Item.ingotGold, '#', Item.paper);
GameRegistry.addRecipe(new ItemStack(marker, 2, 1), "!", "@", "#", '!', new ItemStack(Item.dyePowder, 1, 2), '@', Item.ingotGold, '#', Item.paper);
GameRegistry.addRecipe(new ItemStack(marker, 2, 2), "!", "@", "#", '!', new ItemStack(Item.dyePowder, 1, 4), '@', Item.ingotGold, '#', Item.paper);
GameRegistry.addShapelessRecipe(new ItemStack(marker, 1, 0), new ItemStack(marker, 1, 1), new ItemStack(Item.dyePowder, 1, 1));
GameRegistry.addShapelessRecipe(new ItemStack(marker, 1, 0), new ItemStack(marker, 1, 2), new ItemStack(Item.dyePowder, 1, 1));
GameRegistry.addShapelessRecipe(new ItemStack(marker, 1, 1), new ItemStack(marker, 1, 0), new ItemStack(Item.dyePowder, 1, 2));
GameRegistry.addShapelessRecipe(new ItemStack(marker, 1, 1), new ItemStack(marker, 1, 2), new ItemStack(Item.dyePowder, 1, 2));
GameRegistry.addShapelessRecipe(new ItemStack(marker, 1, 2), new ItemStack(marker, 1, 0), new ItemStack(Item.dyePowder, 1, 4));
GameRegistry.addShapelessRecipe(new ItemStack(marker, 1, 2), new ItemStack(marker, 1, 1), new ItemStack(Item.dyePowder, 1, 4));
//DEFAULT_SETTINGS.readOreDict();
}
}