mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 11:19:28 +00:00
Move inventory code to their own files, refactor, cleanup.
Register items and blocks before the rest of preInit.
This commit is contained in:
1 parent
f1afca664b
commit
411b4959f2
229 files changed
+4628
-5271
No files matched your search
@@ -87,11 +87,19 @@ public class PluginFarming extends ForestryPlugin {
|
||||
public static ItemStack farmFertilizer;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
protected void registerItemsAndBlocks() {
|
||||
super.registerItemsAndBlocks();
|
||||
|
||||
ForestryBlock.mushroom.registerBlock(new BlockMushroom(), ItemBlockTyped.class, "mushroom");
|
||||
|
||||
ForestryBlock.farm.registerBlock(new BlockFarm(), ItemBlockFarm.class, "ffarm");
|
||||
ForestryBlock.farm.block().setHarvestLevel("pickaxe", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
Farmables.farmables.put("farmArboreal", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmArboreal").add(new FarmableVanillaSapling());
|
||||
if (PluginManager.Module.ARBORICULTURE.isEnabled()) {
|
||||
@@ -128,11 +136,6 @@ public class PluginFarming extends ForestryPlugin {
|
||||
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(Items.potato), Blocks.potatoes, 7));
|
||||
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(Items.carrot), Blocks.carrots, 7));
|
||||
|
||||
ForestryBlock.farm.registerBlock(new BlockFarm(), ItemBlockFarm.class, "ffarm");
|
||||
/*Item.itemsList[ForestryBlock.farm] = null;
|
||||
Item.itemsList[ForestryBlock.farm] = (new ItemBlockFarm(ForestryBlock.farm - 256, "ffarm"));*/
|
||||
ForestryBlock.farm.block().setHarvestLevel("pickaxe", 0);
|
||||
|
||||
proxy.initializeRendering();
|
||||
|
||||
// Layouts
|
||||
@@ -151,6 +154,8 @@ public class PluginFarming extends ForestryPlugin {
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
farmFertilizer = ForestryItem.fertilizerCompound.getItemStack();
|
||||
|
||||
GameRegistry.registerTileEntity(TileFarmPlain.class, "forestry.Farm");
|
||||
GameRegistry.registerTileEntity(TileGearbox.class, "forestry.FarmGearbox");
|
||||
GameRegistry.registerTileEntity(TileHatch.class, "forestry.FarmHatch");
|
||||
@@ -178,12 +183,6 @@ public class PluginFarming extends ForestryPlugin {
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandlerFarming());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
super.postInit();
|
||||
farmFertilizer = ForestryItem.fertilizerCompound.getItemStack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
|
||||
|
||||
Reference in new issue
Block a user