SHOW:
|
|
- or go back to the newest paste.
1 | package com.chaosbeing.hivemined; | |
2 | ||
3 | import com.chaosbeing.hivemined.ai.HiveController; | |
4 | import com.chaosbeing.hivemined.ai.HiveSpawnControl; | |
5 | import com.chaosbeing.hivemined.blocks.BlockHive; | |
6 | import com.chaosbeing.hivemined.blocks.BlockHiveWebbing; | |
7 | ||
8 | import net.minecraft.block.Block; | |
9 | import net.minecraft.block.BlockRedstoneWire; | |
10 | import net.minecraft.block.material.Material; | |
11 | import net.minecraft.creativetab.CreativeTabs; | |
12 | import net.minecraft.init.Blocks; | |
13 | import net.minecraft.item.Item; | |
14 | import net.minecraft.item.ItemBlock; | |
15 | import net.minecraft.item.ItemStack; | |
16 | import net.minecraftforge.common.MinecraftForge; | |
17 | import net.minecraftforge.common.config.Configuration; | |
18 | import net.minecraftforge.common.config.Property; | |
19 | import cpw.mods.fml.common.Mod; | |
20 | import cpw.mods.fml.common.Mod.EventHandler; | |
21 | import cpw.mods.fml.common.Mod.Instance; | |
22 | import cpw.mods.fml.common.SidedProxy; | |
23 | import cpw.mods.fml.common.event.FMLInitializationEvent; | |
24 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; | |
25 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; | |
26 | import cpw.mods.fml.common.registry.EntityRegistry; | |
27 | import cpw.mods.fml.common.registry.GameRegistry; | |
28 | import cpw.mods.fml.common.registry.LanguageRegistry; | |
29 | ||
30 | - | @Mod(modid=HiveMined.MODID, name="Hive Mined", version="0.0.1 omgwtfbbq alpha") |
30 | + | @Mod(modid=HiveMined.MODID, name="Hive Mined", version="0.0.1 alpha") |
31 | - | //@NetworkMod(clientSideRequired=true) |
31 | + | |
32 | ||
33 | public static final String MODID = "hivemined"; | |
34 | ||
35 | public static CreativeTabs tabBlocks; | |
36 | ||
37 | public static Block blockHive; | |
38 | private static int blockHiveID; | |
39 | ||
40 | public static Block blockWebbing; | |
41 | private static int blockHiveWebbingID; | |
42 | ||
43 | ||
44 | // The instance of your mod that Forge uses. | |
45 | @Instance(value = MODID) | |
46 | public static HiveMined instance; | |
47 | ||
48 | // Says where the client and server 'proxy' code is loaded. | |
49 | @SidedProxy(clientSide="com.chaosbeing.hivemined.client.ClientProxy", serverSide="com.chaosbeing.hivemined.CommonProxy") | |
50 | public static CommonProxy proxy; | |
51 | ||
52 | @EventHandler | |
53 | public void preInit(FMLPreInitializationEvent event) { | |
54 | Configuration config = new Configuration(event.getSuggestedConfigurationFile()); | |
55 | ||
56 | Property property = config.get("Hive Spawning", "Frequency", 800); | |
57 | property.comment = "The average number of blocks between hives"; | |
58 | HiveSpawnControl.frequency = property.getInt(800); | |
59 | ||
60 | property = config.get("Hive Spawning", "Phase", 4); | |
61 | property.comment = "The average starting phase of a hive spawned by worldgen.\n(Does not effect hives created by queens.)"; | |
62 | HiveSpawnControl.phase = property.getInt(4); | |
63 | ||
64 | ||
65 | ||
66 | ||
67 | blockHiveID = config.get("Blocks", "Hive Wall", 1000).getInt(); | |
68 | blockHiveWebbingID = config.get("Blocks", "Hive Webbing", 1001).getInt(); | |
69 | ||
70 | config.save(); | |
71 | ||
72 | tabBlocks = new CreativeTabs("tabHiveminedBlocks") { | |
73 | @Override | |
74 | public Item getTabIconItem() { | |
75 | ||
76 | return new ItemBlock(Blocks.bedrock); | |
77 | } | |
78 | }; | |
79 | ||
80 | ||
81 | //TODO Fix all of these depreciated terms. | |
82 | ||
83 | ||
84 | //MinecraftForge.EVENT_BUS.register(new SoundHandler()); | |
85 | Block.SoundType slimeStepSound = new Block.SoundType("hive1", 1f, 1f); | |
86 | //LanguageRegistry.instance().addStringLocalization("itemGroup.tabHiveminedBlocks", "Hive Mined - Blocks"); | |
87 | ||
88 | blockHive = new BlockHive(Material.grass).setBlockName("hive_wall"); | |
89 | //blockHive.setStepSound(slimeStepSound); | |
90 | blockHive.setBlockTextureName("hivemined:hivechunk"); | |
91 | ||
92 | blockWebbing = new BlockHiveWebbing(Material.vine).setLightLevel(0.5F).setBlockName("hive_webbing"); | |
93 | //blockHiveWebbing.setStepSound(slimeStepSound); | |
94 | ||
95 | blockWebbing.setCreativeTab(tabBlocks); | |
96 | blockHive.setCreativeTab(tabBlocks); | |
97 | ||
98 | GameRegistry.registerBlock(blockHive, "blockHive"); | |
99 | ||
100 | GameRegistry.registerBlock(blockWebbing, "blockHiveWebbing"); | |
101 | ||
102 | EntityRegistry.registerModEntity(HiveController.class, "hive_controller", 1, this, 32, 3, false); | |
103 | } | |
104 | ||
105 | @EventHandler | |
106 | public void load(FMLInitializationEvent event) { | |
107 | proxy.registerRenderers(); | |
108 | ||
109 | GameRegistry.registerWorldGenerator(HiveSpawnControl.getController(0), 1000); | |
110 | } | |
111 | ||
112 | @EventHandler | |
113 | public void postInit(FMLPostInitializationEvent event) { | |
114 | ||
115 | } | |
116 | } |