Move arboriculture items into PluginApiculture.items

This commit is contained in:
mezz committed 2015-11-19 01:04:32 -08:00
1 parent fe69452464
commit fc289c16d4
13 files changed
+98 -84

No files matched your search

@@ -25,7 +25,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.WeightedRandomChestContent;
@@ -128,7 +127,6 @@ import forestry.core.proxy.Proxies;
import forestry.core.recipes.RecipeUtil;
import forestry.core.recipes.ShapedRecipeCustom;
import forestry.core.tiles.MachineDefinition;
import forestry.core.tiles.TileAnalyzer;
import forestry.core.utils.EntityUtil;
import forestry.core.utils.Log;
import forestry.core.utils.Stack;
@@ -144,7 +142,7 @@ public class PluginApiculture extends ForestryPlugin {
private static float secondPrincessChance = 0;
public static final int ticksPerBeeWorkCycle = 550;
public static boolean fancyRenderedBees = false;
public static ItemRegistryApiculture items;
public static HiveRegistry hiveRegistry;
@@ -153,7 +151,6 @@ public class PluginApiculture extends ForestryPlugin {
private static MachineDefinition definitionChestLegacy;
private static MachineDefinition definitionChest;
private static MachineDefinition definitionBeehouse;
private static MachineDefinition definitionAnalyzer;
private final Map<String, String[]> defaultAcceptedFlowers = new HashMap<>();
private final Map<String, String[]> defaultPlantableFlowers = new HashMap<>();
@@ -248,9 +245,6 @@ public class PluginApiculture extends ForestryPlugin {
'C', "beeComb"))
.setFaces(0, 1, 2, 2, 4, 4, 0, 7));
definitionAnalyzer = ((BlockBase) ForestryBlock.core.block()).addDefinition(new MachineDefinition(Constants.DEFINITION_ANALYZER_META, "forestry.Analyzer", TileAnalyzer.class,
PluginApiculture.proxy.getRendererAnalyzer(Constants.TEXTURE_PATH_BLOCKS + "/analyzer_")));
// Add triggers
if (PluginManager.Module.BUILDCRAFT_STATEMENTS.isEnabled()) {
ApicultureTriggers.initialize();
@@ -775,32 +769,18 @@ public class PluginApiculture extends ForestryPlugin {
}
// ANALYZER
definitionAnalyzer.recipes = createAlyzerRecipes(ForestryBlock.core.block(), Constants.DEFINITION_ANALYZER_META);
definitionAnalyzer.register();
definitionApiary.register();
definitionBeehouse.register();
definitionChestLegacy.register();
definitionChest.register();
}
private static IRecipe[] createAlyzerRecipes(Block block, int meta) {
ArrayList<IRecipe> recipes = new ArrayList<>();
recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(block, 1, meta),
PluginCore.definitionAnalyzer.recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(ForestryBlock.core.block(), 1, Constants.DEFINITION_ANALYZER_META),
"XTX",
" Y ",
"X X",
'Y', PluginCore.items.sturdyCasing,
'T', items.beealyzer,
'X', "ingotBronze"));
recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(block, 1, meta),
"XTX",
" Y ",
"X X",
'Y', PluginCore.items.sturdyCasing,
'T', ForestryItem.treealyzer,
'X', "ingotBronze"));
return recipes.toArray(new IRecipe[recipes.size()]);
definitionApiary.register();
definitionBeehouse.register();
definitionChestLegacy.register();
definitionChest.register();
}
private static void registerBeehiveDrops() {
@@ -63,8 +63,7 @@ import forestry.arboriculture.genetics.alleles.AlleleGrowth;
import forestry.arboriculture.genetics.alleles.AlleleLeafEffect;
import forestry.arboriculture.items.ItemBlockLeaves;
import forestry.arboriculture.items.ItemBlockWood;
import forestry.arboriculture.items.ItemGermlingGE;
import forestry.arboriculture.items.ItemGrafter;
import forestry.arboriculture.items.ItemRegistryArboriculture;
import forestry.arboriculture.network.PacketRegistryArboriculture;
import forestry.arboriculture.proxy.ProxyArboriculture;
import forestry.arboriculture.tiles.TileArboristChest;
@@ -77,13 +76,10 @@ import forestry.core.blocks.BlockBase;
import forestry.core.config.Config;
import forestry.core.config.Constants;
import forestry.core.config.ForestryBlock;
import forestry.core.config.ForestryItem;
import forestry.core.fluids.Fluids;
import forestry.core.genetics.alleles.AllelePlantType;
import forestry.core.items.ItemBlockForestry;
import forestry.core.items.ItemFruit.EnumFruit;
import forestry.core.items.ItemWithGui;
import forestry.core.network.GuiId;
import forestry.core.network.IPacketRegistry;
import forestry.core.proxy.Proxies;
import forestry.core.recipes.RecipeUtil;
@@ -106,6 +102,8 @@ public class PluginArboriculture extends ForestryPlugin {
private static MachineDefinition definitionChest;
public static final List<Block> validFences = new ArrayList<>();
public static ItemRegistryArboriculture items;
@Override
protected void setupAPI() {
super.setupAPI();
@@ -129,18 +127,7 @@ public class PluginArboriculture extends ForestryPlugin {
@Override
protected void registerItemsAndBlocks() {
ForestryItem.sapling.registerItem(new ItemGermlingGE(EnumGermlingType.SAPLING), "sapling");
OreDictionary.registerOre("treeSapling", ForestryItem.sapling.getWildcard());
if (PluginManager.Module.APICULTURE.isEnabled()) {
ForestryItem.pollenFertile.registerItem(new ItemGermlingGE(EnumGermlingType.POLLEN), "pollenFertile");
Item treealyzer = new ItemWithGui(GuiId.TreealyzerGUI).setCreativeTab(Tabs.tabArboriculture);
ForestryItem.treealyzer.registerItem(treealyzer, "treealyzer");
}
ForestryItem.grafter.registerItem(new ItemGrafter(4), "grafter");
ForestryItem.grafterProven.registerItem(new ItemGrafter(149), "grafterProven");
items = new ItemRegistryArboriculture();
// Wood blocks
ForestryBlock.logs.registerBlock(new BlockLog(false), ItemBlockWood.class, "logs");
@@ -365,7 +352,7 @@ public class PluginArboriculture extends ForestryPlugin {
if (PluginManager.Module.FACTORY.isEnabled()) {
// Treealyzer
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, ForestryItem.treealyzer.getItemStack(), "X#X", "X#X", "RDR",
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, items.treealyzer.getItemStack(), "X#X", "X#X", "RDR",
'#', "paneGlass",
'X', "ingotCopper",
'R', "dustRedstone",
@@ -384,16 +371,25 @@ public class PluginArboriculture extends ForestryPlugin {
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{EnumFruit.PAPAYA.getStack()}, Fluids.JUICE.getFluid(juiceMultiplier * 3), mulch, (int) Math.floor(mulchMultiplier * 0.5f));
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{EnumFruit.DATES.getStack()}, Fluids.JUICE.getFluid((int) Math.floor(juiceMultiplier * 0.25)), mulch, mulchMultiplier);
RecipeUtil.addFermenterRecipes(ForestryItem.sapling.getItemStack(), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
RecipeUtil.addFermenterRecipes(items.sapling.getItemStack(), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
}
// Grafter
RecipeUtil.addRecipe(ForestryItem.grafter.getItemStack(),
RecipeUtil.addRecipe(items.grafter.getItemStack(),
" B",
" # ",
"# ",
'B', "ingotBronze",
'#', "stickWood");
// ANALYZER
PluginCore.definitionAnalyzer.recipes.add(ShapedRecipeCustom.createShapedRecipe(new ItemStack(ForestryBlock.core.block(), 1, Constants.DEFINITION_ANALYZER_META),
"XTX",
" Y ",
"X X",
'Y', PluginCore.items.sturdyCasing,
'T', items.treealyzer,
'X', "ingotBronze"));
}
private static void createAlleles() {
@@ -453,7 +449,7 @@ public class PluginArboriculture extends ForestryPlugin {
}
private static void registerDungeonLoot() {
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(ForestryItem.grafter.getItemStack(), 1, 1, 8));
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.grafter.getItemStack(), 1, 1, 8));
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Oak.getMemberStack(EnumGermlingType.SAPLING), 2, 3, 6));
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Spruce.getMemberStack(EnumGermlingType.SAPLING), 2, 3, 6));
@@ -473,7 +469,9 @@ public class PluginArboriculture extends ForestryPlugin {
private static class FuelHandler implements IFuelHandler {
@Override
public int getBurnTime(ItemStack fuel) {
if (ForestryItem.sapling.isItemEqual(fuel)) {
Item item = fuel.getItem();
if (items.sapling == item) {
return 100;
}
@@ -61,6 +61,7 @@ import forestry.core.recipes.RecipeUtil;
import forestry.core.recipes.ShapedRecipeCustom;
import forestry.core.recipes.ShapelessRecipeCustom;
import forestry.core.tiles.MachineDefinition;
import forestry.core.tiles.TileAnalyzer;
import forestry.core.tiles.TileEscritoire;
import forestry.core.utils.ClimateUtil;
import forestry.core.utils.ForestryModEnvWarningCallable;
@@ -72,6 +73,7 @@ public class PluginCore extends ForestryPlugin {
public static final RootCommand rootCommand = new RootCommand();
public static ItemRegistryCore items;
static MachineDefinition definitionAnalyzer;
@Override
protected void setupAPI() {
@@ -128,6 +130,9 @@ public class PluginCore extends ForestryPlugin {
definitionEscritoire = ((BlockBase) ForestryBlock.core.block()).addDefinition(new MachineDefinition(Constants.DEFINITION_ESCRITOIRE_META, "forestry.Escritoire", TileEscritoire.class,
Proxies.render.getRenderEscritoire()));
definitionAnalyzer = ((BlockBase) ForestryBlock.core.block()).addDefinition(new MachineDefinition(Constants.DEFINITION_ANALYZER_META, "forestry.Analyzer", TileAnalyzer.class,
PluginApiculture.proxy.getRendererAnalyzer(Constants.TEXTURE_PATH_BLOCKS + "/analyzer_")));
}
@Override
@@ -145,6 +150,13 @@ public class PluginCore extends ForestryPlugin {
RecipeSorter.register("forestry:shapelessrecipecustom", ShapelessRecipeCustom.class, RecipeSorter.Category.SHAPELESS, "before:minecraft:shapeless");
}
@Override
protected void postInit() {
super.postInit();
definitionAnalyzer.register();
}
@Override
public boolean isAvailable() {
return true;