From c5f2368e1d22260bfcd2311ce8c449426c9cc7ea Mon Sep 17 00:00:00 2001 From: Nedelosk Date: Mon, 31 Jul 2017 12:27:36 +0200 Subject: [PATCH] Move Botany Gardening Items --- src/main/java/binnie/botany/Botany.java | 55 +++--- .../binnie/botany/ceramic/CeramicColor.java | 2 +- .../botany/ceramic/CeramicDesignSystem.java | 2 +- .../botany/ceramic/CeramicTileRecipe.java | 10 +- .../binnie/botany/ceramic/PigmentRecipe.java | 2 +- .../binnie/botany/ceramic/TileCeramic.java | 2 +- .../ceramic/brick/CeramicBrickPair.java | 2 +- .../ceramic/brick/CeramicBrickType.java | 14 +- .../ceramic/brick/TileCeramicBrick.java | 2 +- .../binnie/botany/core/BotanyTexture.java | 37 ---- .../java/binnie/botany/farm/GardenLogic.java | 6 +- .../botany/flower/TileEntityFlower.java | 2 +- .../binnie/botany/gardening/BlockSoil.java | 4 +- .../binnie/botany/gardening/Gardening.java | 6 +- .../botany/gardening/ModuleGardening.java | 159 ++++++++++-------- .../binnie/botany/gardening/PlantType.java | 2 +- .../botany/genetics/ModuleGenetics.java | 2 +- .../java/binnie/botany/items/BotanyItems.java | 2 +- .../extratrees/carpentry/GlassType.java | 2 +- .../extratrees/machines/DesignerType.java | 2 +- .../extratrees/worldgen/VillageHopeField.java | 3 +- .../gui/analyst/flower/AnalystPageSoil.java | 4 +- .../integration/jei/GeneticsJeiPlugin.java | 18 +- 23 files changed, 155 insertions(+), 185 deletions(-) delete mode 100644 src/main/java/binnie/botany/core/BotanyTexture.java diff --git a/src/main/java/binnie/botany/Botany.java b/src/main/java/binnie/botany/Botany.java index 51068314..39bb7c1d 100644 --- a/src/main/java/binnie/botany/Botany.java +++ b/src/main/java/binnie/botany/Botany.java @@ -1,5 +1,7 @@ package binnie.botany; +import com.google.common.base.Preconditions; + import javax.annotation.Nullable; import net.minecraft.block.Block; @@ -30,32 +32,20 @@ import binnie.botany.api.IBlockSoil; import binnie.botany.api.IFlower; import binnie.botany.api.IFlowerRoot; import binnie.botany.api.IGardeningManager; -import binnie.botany.ceramic.BlockCeramic; -import binnie.botany.ceramic.BlockCeramicPatterned; -import binnie.botany.ceramic.BlockStainedGlass; -import binnie.botany.ceramic.brick.BlockCeramicBrick; import binnie.botany.core.BotanyCore; import binnie.botany.core.BotanyGUI; import binnie.botany.core.ModuleCore; import binnie.botany.flower.BlockFlower; import binnie.botany.flower.ItemBotany; -import binnie.botany.flower.ItemInsulatedTube; import binnie.botany.flower.TileEntityFlower; -import binnie.botany.gardening.BlockPlant; -import binnie.botany.gardening.BlockSoil; -import binnie.botany.gardening.ItemSoilMeter; -import binnie.botany.gardening.ItemTrowel; import binnie.botany.gardening.ModuleGardening; import binnie.botany.genetics.ItemDictionary; import binnie.botany.genetics.ModuleGenetics; -import binnie.botany.items.ItemClay; -import binnie.botany.items.ItemPigment; import binnie.botany.network.PacketID; import binnie.botany.proxy.Proxy; import binnie.core.AbstractMod; import binnie.core.BinnieCore; import binnie.core.gui.IBinnieGUID; -import binnie.core.item.ItemMisc; import binnie.core.network.BinniePacketHandler; import binnie.core.network.IPacketID; import binnie.core.proxy.IProxyCore; @@ -80,31 +70,14 @@ public class Botany extends AbstractMod { public static ItemBotany seed; public static ItemBotany pollen; public static ItemDictionary database; - /* MODULE GARDENING */ - public static BlockPlant plant; - public static ItemTrowel trowelWood; - public static ItemTrowel trowelStone; - public static ItemTrowel trowelIron; - public static ItemTrowel trowelDiamond; - public static ItemTrowel trowelGold; - public static BlockSoil soil; - public static BlockSoil loam; - public static BlockSoil flowerbed; - public static BlockSoil soilNoWeed; - public static BlockSoil loamNoWeed; - public static BlockSoil flowerbedNoWeed; - public static ItemInsulatedTube insulatedTube; - public static ItemSoilMeter soilMeter; - public static ItemMisc misc; - public static ItemPigment pigment; - public static ItemClay clay; - public static BlockCeramic ceramic; - public static BlockCeramicPatterned ceramicTile; - public static BlockStainedGlass stained; - public static BlockCeramicBrick ceramicBrick; @Nullable public static Item botanistBackpack; + @Nullable + private static ModuleGardening gardening; + @Nullable + private static ModuleGenetics genetics; + @Mod.EventHandler public void preInit(FMLPreInitializationEvent evt) { preInit(); @@ -123,8 +96,18 @@ public class Botany extends AbstractMod { @Override protected void registerModules() { addModule(new ModuleCore()); - addModule(new ModuleGenetics()); - addModule(new ModuleGardening()); + addModule(genetics = new ModuleGenetics()); + addModule(gardening = new ModuleGardening()); + } + + public static ModuleGardening gardening() { + Preconditions.checkState(gardening != null); + return gardening; + } + + public static ModuleGenetics genetics() { + Preconditions.checkState(genetics != null); + return genetics; } @Override diff --git a/src/main/java/binnie/botany/ceramic/CeramicColor.java b/src/main/java/binnie/botany/ceramic/CeramicColor.java index 28b79511..34abd0e4 100644 --- a/src/main/java/binnie/botany/ceramic/CeramicColor.java +++ b/src/main/java/binnie/botany/ceramic/CeramicColor.java @@ -31,7 +31,7 @@ public class CeramicColor implements IDesignMaterial { @Override public ItemStack getStack() { - return TileEntityMetadata.getItemStack(Botany.ceramic, color.ordinal()); + return TileEntityMetadata.getItemStack(Botany.gardening().ceramic, color.ordinal()); } @Override diff --git a/src/main/java/binnie/botany/ceramic/CeramicDesignSystem.java b/src/main/java/binnie/botany/ceramic/CeramicDesignSystem.java index e73497dd..07e158c2 100644 --- a/src/main/java/binnie/botany/ceramic/CeramicDesignSystem.java +++ b/src/main/java/binnie/botany/ceramic/CeramicDesignSystem.java @@ -103,7 +103,7 @@ public class CeramicDesignSystem implements IDesignSystem { @Override @Nullable public IDesignMaterial getMaterial(ItemStack itemStack) { - return (itemStack.getItem() == Item.getItemFromBlock(Botany.ceramic)) + return (itemStack.getItem() == Item.getItemFromBlock(Botany.gardening().ceramic)) ? getMaterial(itemStack.getItemDamage()) : null; } diff --git a/src/main/java/binnie/botany/ceramic/CeramicTileRecipe.java b/src/main/java/binnie/botany/ceramic/CeramicTileRecipe.java index 17b5db57..62f246bf 100644 --- a/src/main/java/binnie/botany/ceramic/CeramicTileRecipe.java +++ b/src/main/java/binnie/botany/ceramic/CeramicTileRecipe.java @@ -14,6 +14,7 @@ import net.minecraftforge.common.ForgeHooks; import binnie.botany.Botany; import binnie.botany.ceramic.brick.CeramicBrickType; +import binnie.botany.gardening.ModuleGardening; public class CeramicTileRecipe implements IRecipe { private ItemStack cached = ItemStack.EMPTY; @@ -26,10 +27,11 @@ public class CeramicTileRecipe implements IRecipe { @Override public ItemStack getCraftingResult(InventoryCrafting inv) { - Item ceramicBlock = Item.getItemFromBlock(Botany.ceramic); - Item ceramicTile = Item.getItemFromBlock(Botany.ceramicTile); - Item ceramicBrick = Item.getItemFromBlock(Botany.ceramicBrick); - Item mortar = Botany.misc; + ModuleGardening gardening = Botany.gardening(); + Item ceramicBlock = Item.getItemFromBlock(gardening.ceramic); + Item ceramicTile = Item.getItemFromBlock(gardening.ceramicTile); + Item ceramicBrick = Item.getItemFromBlock(gardening.ceramicBrick); + Item mortar = gardening.misc; List stacks = new ArrayList<>(); int ix = -1; int iy = -1; diff --git a/src/main/java/binnie/botany/ceramic/PigmentRecipe.java b/src/main/java/binnie/botany/ceramic/PigmentRecipe.java index b5af86af..7c64bede 100644 --- a/src/main/java/binnie/botany/ceramic/PigmentRecipe.java +++ b/src/main/java/binnie/botany/ceramic/PigmentRecipe.java @@ -36,7 +36,7 @@ public class PigmentRecipe implements IRecipe { if (Binnie.GENETICS.getFlowerRoot().isMember(stackInSlot)) { IFlower flower = Binnie.GENETICS.getFlowerRoot().getMember(stackInSlot); if (flower != null && flower.getAge() >= 1) { - stack = new ItemStack(Botany.pigment, 1, flower.getGenome().getPrimaryColor().getID()); + stack = new ItemStack(Botany.gardening().pigment, 1, flower.getGenome().getPrimaryColor().getID()); } } } diff --git a/src/main/java/binnie/botany/ceramic/TileCeramic.java b/src/main/java/binnie/botany/ceramic/TileCeramic.java index 20e01c12..76d1f88d 100644 --- a/src/main/java/binnie/botany/ceramic/TileCeramic.java +++ b/src/main/java/binnie/botany/ceramic/TileCeramic.java @@ -39,6 +39,6 @@ public class TileCeramic extends TileEntity { if (color != null) { ID = color.getFlowerColorAllele().getID(); } - return new ItemStack(Botany.ceramic, amount, ID); + return new ItemStack(Botany.gardening().ceramic, amount, ID); } } diff --git a/src/main/java/binnie/botany/ceramic/brick/CeramicBrickPair.java b/src/main/java/binnie/botany/ceramic/brick/CeramicBrickPair.java index bf744042..197a4582 100644 --- a/src/main/java/binnie/botany/ceramic/brick/CeramicBrickPair.java +++ b/src/main/java/binnie/botany/ceramic/brick/CeramicBrickPair.java @@ -42,7 +42,7 @@ public class CeramicBrickPair { } public ItemStack getStack(int i) { - return new ItemStack(Botany.ceramicBrick, i, ordinal()); + return new ItemStack(Botany.gardening().ceramicBrick, i, ordinal()); } public String getName() { diff --git a/src/main/java/binnie/botany/ceramic/brick/CeramicBrickType.java b/src/main/java/binnie/botany/ceramic/brick/CeramicBrickType.java index c2f0302c..5deaf7df 100644 --- a/src/main/java/binnie/botany/ceramic/brick/CeramicBrickType.java +++ b/src/main/java/binnie/botany/ceramic/brick/CeramicBrickType.java @@ -30,7 +30,7 @@ public enum CeramicBrickType implements IStringSerializable { if (isMortar(stack)) { ++mortars; } else { - if (stack.getItem() != Item.getItemFromBlock(Botany.ceramic)) { + if (stack.getItem() != Item.getItemFromBlock(Botany.gardening().ceramic)) { return ItemStack.EMPTY; } ++blocks; @@ -82,7 +82,7 @@ public enum CeramicBrickType implements IStringSerializable { int a = 0; int b = 0; for (ItemStack stack4 : stacks) { - if (stack4.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) { + if (stack4.getItem() != Item.getItemFromBlock(Botany.gardening().ceramicBrick)) { return ItemStack.EMPTY; } CeramicBrickPair type4 = new CeramicBrickPair(stack4); @@ -122,7 +122,7 @@ public enum CeramicBrickType implements IStringSerializable { int altCounter = 0; for (ItemStack stack2 : stacks) { int alt = (altCounter != 0 && altCounter != 3) ? 1 : 0; - if (stack2.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) { + if (stack2.getItem() != Item.getItemFromBlock(Botany.gardening().ceramicBrick)) { return ItemStack.EMPTY; } CeramicBrickPair type = new CeramicBrickPair(stack2); @@ -148,7 +148,7 @@ public enum CeramicBrickType implements IStringSerializable { } int[] colors = {-1, -1}; for (ItemStack stack2 : stacks) { - if (stack2.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) { + if (stack2.getItem() != Item.getItemFromBlock(Botany.gardening().ceramicBrick)) { return ItemStack.EMPTY; } CeramicBrickPair type2 = new CeramicBrickPair(stack2); @@ -177,7 +177,7 @@ public enum CeramicBrickType implements IStringSerializable { } int[] colors = {-1, -1}; for (ItemStack stack2 : stacks) { - if (stack2.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) { + if (stack2.getItem() != Item.getItemFromBlock(Botany.gardening().ceramicBrick)) { return ItemStack.EMPTY; } CeramicBrickPair type2 = new CeramicBrickPair(stack2); @@ -290,7 +290,7 @@ public enum CeramicBrickType implements IStringSerializable { int[] colors = {-1, -1}; for (int index2 = 0; index2 < stacks.size(); ++index2) { ItemStack stack4 = stacks.get(index2); - if (stack4.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) { + if (stack4.getItem() != Item.getItemFromBlock(Botany.gardening().ceramicBrick)) { return ItemStack.EMPTY; } @@ -319,7 +319,7 @@ public enum CeramicBrickType implements IStringSerializable { } protected boolean isMortar(ItemStack stack) { - return stack.getItem() == Botany.misc && stack.getItemDamage() == BotanyItems.MORTAR.ordinal(); + return stack.getItem() == Botany.gardening().misc && stack.getItemDamage() == BotanyItems.MORTAR.ordinal(); } @Override diff --git a/src/main/java/binnie/botany/ceramic/brick/TileCeramicBrick.java b/src/main/java/binnie/botany/ceramic/brick/TileCeramicBrick.java index 7048739e..0998f75b 100644 --- a/src/main/java/binnie/botany/ceramic/brick/TileCeramicBrick.java +++ b/src/main/java/binnie/botany/ceramic/brick/TileCeramicBrick.java @@ -22,7 +22,7 @@ public class TileCeramicBrick extends TileEntity { } public ItemStack getStack(int i) { - ItemStack s = TileEntityMetadata.getItemStack(Botany.ceramicBrick, ordinal()); + ItemStack s = TileEntityMetadata.getItemStack(Botany.gardening().ceramicBrick, ordinal()); s.setCount(i); return s; } diff --git a/src/main/java/binnie/botany/core/BotanyTexture.java b/src/main/java/binnie/botany/core/BotanyTexture.java deleted file mode 100644 index 57538892..00000000 --- a/src/main/java/binnie/botany/core/BotanyTexture.java +++ /dev/null @@ -1,37 +0,0 @@ -package binnie.botany.core; - -import javax.annotation.Nullable; - -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import binnie.Binnie; -import binnie.botany.Botany; -import binnie.core.resource.BinnieResource; -import binnie.core.resource.IBinnieTexture; -import binnie.core.resource.ResourceType; - -// TODO unused enum? -public enum BotanyTexture implements IBinnieTexture { - ; - String texture; - ResourceType type; - - @SideOnly(Side.CLIENT) - @Nullable - private BinnieResource resource; - - BotanyTexture(ResourceType base, String texture) { - this.texture = texture; - type = base; - } - - @Override - @SideOnly(Side.CLIENT) - public BinnieResource getTexture() { - if (resource == null) { - resource = Binnie.RESOURCE.getPNG(Botany.instance, type, texture); - } - return resource; - } -} diff --git a/src/main/java/binnie/botany/farm/GardenLogic.java b/src/main/java/binnie/botany/farm/GardenLogic.java index f52c918e..120a3e21 100644 --- a/src/main/java/binnie/botany/farm/GardenLogic.java +++ b/src/main/java/binnie/botany/farm/GardenLogic.java @@ -113,7 +113,7 @@ public class GardenLogic extends FarmLogic { } } - if (getBlock(world, position.up()) == Botany.plant) { + if (getBlock(world, position.up()) == Botany.gardening().plant) { world.setBlockToAir(position.up()); } else { if (acidity != null && gardening.isSoil(getBlock(world, position))) { @@ -231,7 +231,7 @@ public class GardenLogic extends FarmLogic { for (EnumMoisture moist : moistures) { for (EnumAcidity acid : acidities) { - for (Block type : new Block[]{Botany.flowerbed, Botany.loam, Botany.soil}) { + for (Block type : new Block[]{Botany.gardening().flowerbed, Botany.gardening().loam, Botany.gardening().soil}) { int meta = acid.ordinal() * 3 + moist.ordinal(); NonNullList resources = NonNullList.create(); ItemStack resourceStack = new ItemStack(type, 1, meta); @@ -263,7 +263,7 @@ public class GardenLogic extends FarmLogic { } if (loam.getItem() == Item.getItemFromBlock(Blocks.DIRT)) { - loam = new ItemStack(Botany.soil, 1, 4); + loam = new ItemStack(Botany.gardening().soil, 1, 4); } setBlock(world, position, ((ItemBlock) loam.getItem()).getBlock(), loam.getItemDamage()); diff --git a/src/main/java/binnie/botany/flower/TileEntityFlower.java b/src/main/java/binnie/botany/flower/TileEntityFlower.java index 0ad576dd..3667697d 100644 --- a/src/main/java/binnie/botany/flower/TileEntityFlower.java +++ b/src/main/java/binnie/botany/flower/TileEntityFlower.java @@ -462,7 +462,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt public void kill() { if (flower.getAge() > 0) { - world.setBlockState(pos, Botany.plant.getStateFromMeta(PlantType.DEAD_FLOWER.ordinal()), 2); + world.setBlockState(pos, Botany.gardening().plant.getStateFromMeta(PlantType.DEAD_FLOWER.ordinal()), 2); } else { world.setBlockToAir(pos); } diff --git a/src/main/java/binnie/botany/gardening/BlockSoil.java b/src/main/java/binnie/botany/gardening/BlockSoil.java index 827a569c..0970fada 100644 --- a/src/main/java/binnie/botany/gardening/BlockSoil.java +++ b/src/main/java/binnie/botany/gardening/BlockSoil.java @@ -223,7 +223,7 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister { if (!world.isAirBlock(pos)) { return; } - world.setBlockState(pos, Botany.plant.getStateFromMeta(PlantType.WEEDS.ordinal()), 2); + world.setBlockState(pos, Botany.gardening().plant.getStateFromMeta(PlantType.WEEDS.ordinal()), 2); } } @@ -298,7 +298,7 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister { return true; } - if (plant.getBlock() == Botany.plant) { + if (plant.getBlock() == Botany.gardening().plant) { return !weedKilled || !BlockPlant.isWeed(world, pos); } return world instanceof World && Blocks.DIRT.canSustainPlant(state, world, pos, direction, plantable); diff --git a/src/main/java/binnie/botany/gardening/Gardening.java b/src/main/java/binnie/botany/gardening/Gardening.java index f17c63c9..e36f98bc 100644 --- a/src/main/java/binnie/botany/gardening/Gardening.java +++ b/src/main/java/binnie/botany/gardening/Gardening.java @@ -233,12 +233,12 @@ public class Gardening implements IGardeningManager { public Block getSoilBlock(EnumSoilType type, boolean weedKill) { switch (type) { case FLOWERBED: - return weedKill ? Botany.flowerbedNoWeed : Botany.flowerbed; + return weedKill ? Botany.gardening().flowerbedNoWeed : Botany.gardening().flowerbed; case LOAM: - return weedKill ? Botany.loamNoWeed : Botany.loam; + return weedKill ? Botany.gardening().loamNoWeed : Botany.gardening().loam; } - return weedKill ? Botany.soilNoWeed : Botany.soil; + return weedKill ? Botany.gardening().soilNoWeed : Botany.gardening().soil; } @Override diff --git a/src/main/java/binnie/botany/gardening/ModuleGardening.java b/src/main/java/binnie/botany/gardening/ModuleGardening.java index d89cb23d..b847cf7e 100644 --- a/src/main/java/binnie/botany/gardening/ModuleGardening.java +++ b/src/main/java/binnie/botany/gardening/ModuleGardening.java @@ -51,66 +51,87 @@ public class ModuleGardening implements IInitializable { public static final HashMap queuedAlkalineFertilisers = new HashMap<>(); public static final HashMap queuedNutrientFertilisers = new HashMap<>(); + public BlockPlant plant; + public ItemTrowel trowelWood; + public ItemTrowel trowelStone; + public ItemTrowel trowelIron; + public ItemTrowel trowelDiamond; + public ItemTrowel trowelGold; + public BlockSoil soil; + public BlockSoil loam; + public BlockSoil flowerbed; + public BlockSoil soilNoWeed; + public BlockSoil loamNoWeed; + public BlockSoil flowerbedNoWeed; + public ItemInsulatedTube insulatedTube; + public ItemSoilMeter soilMeter; + public ItemMisc misc; + public ItemPigment pigment; + public ItemClay clay; + public BlockCeramic ceramic; + public BlockCeramicPatterned ceramicTile; + public BlockStainedGlass stained; + public BlockCeramicBrick ceramicBrick; + @Override public void preInit() { - // TODO migrate static into BotanyItems - Botany.plant = new BlockPlant(); - Botany.soil = new BlockSoil(EnumSoilType.SOIL, "soil", false); - Botany.loam = new BlockSoil(EnumSoilType.LOAM, "loam", false); - Botany.flowerbed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed", false); - Botany.soilNoWeed = new BlockSoil(EnumSoilType.SOIL, "soil_no_weed", true); - Botany.loamNoWeed = new BlockSoil(EnumSoilType.LOAM, "loam_no_weed", true); - Botany.flowerbedNoWeed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed_no_weed", true); - Botany.soilMeter = new ItemSoilMeter(); - Botany.insulatedTube = new ItemInsulatedTube(); - Botany.trowelWood = new ItemTrowel(Item.ToolMaterial.WOOD, "wood"); - Botany.trowelStone = new ItemTrowel(Item.ToolMaterial.STONE, "stone"); - Botany.trowelIron = new ItemTrowel(Item.ToolMaterial.IRON, "iron"); - Botany.trowelDiamond = new ItemTrowel(Item.ToolMaterial.DIAMOND, "diamond"); - Botany.trowelGold = new ItemTrowel(Item.ToolMaterial.GOLD, "gold"); - Botany.misc = new ItemMisc(CreativeTabBotany.instance, BotanyItems.values()); - Botany.pigment = new ItemPigment(); - Botany.clay = new ItemClay(); - Botany.ceramic = new BlockCeramic(); - Botany.stained = new BlockStainedGlass(); - Botany.ceramicTile = new BlockCeramicPatterned(); - Botany.ceramicBrick = new BlockCeramicBrick(); + plant = new BlockPlant(); + soil = new BlockSoil(EnumSoilType.SOIL, "soil", false); + loam = new BlockSoil(EnumSoilType.LOAM, "loam", false); + flowerbed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed", false); + soilNoWeed = new BlockSoil(EnumSoilType.SOIL, "soil_no_weed", true); + loamNoWeed = new BlockSoil(EnumSoilType.LOAM, "loam_no_weed", true); + flowerbedNoWeed = new BlockSoil(EnumSoilType.FLOWERBED, "flowerbed_no_weed", true); + soilMeter = new ItemSoilMeter(); + insulatedTube = new ItemInsulatedTube(); + trowelWood = new ItemTrowel(Item.ToolMaterial.WOOD, "wood"); + trowelStone = new ItemTrowel(Item.ToolMaterial.STONE, "stone"); + trowelIron = new ItemTrowel(Item.ToolMaterial.IRON, "iron"); + trowelDiamond = new ItemTrowel(Item.ToolMaterial.DIAMOND, "diamond"); + trowelGold = new ItemTrowel(Item.ToolMaterial.GOLD, "gold"); + misc = new ItemMisc(CreativeTabBotany.instance, BotanyItems.values()); + pigment = new ItemPigment(); + clay = new ItemClay(); + ceramic = new BlockCeramic(); + stained = new BlockStainedGlass(); + ceramicTile = new BlockCeramicPatterned(); + ceramicBrick = new BlockCeramicBrick(); - Botany.proxy.registerBlock(Botany.plant, new ItemWeed(Botany.plant)); - Botany.proxy.registerBlock(Botany.soil, new ItemSoil(Botany.soil)); - Botany.proxy.registerBlock(Botany.loam, new ItemSoil(Botany.loam)); - Botany.proxy.registerBlock(Botany.flowerbed, new ItemSoil(Botany.flowerbed)); - Botany.proxy.registerBlock(Botany.soilNoWeed, new ItemSoil(Botany.soilNoWeed)); - Botany.proxy.registerBlock(Botany.loamNoWeed, new ItemSoil(Botany.loamNoWeed)); - Botany.proxy.registerBlock(Botany.flowerbedNoWeed, new ItemSoil(Botany.flowerbedNoWeed)); - Botany.proxy.registerItem(Botany.soilMeter); - Botany.proxy.registerItem(Botany.insulatedTube); - Botany.proxy.registerItem(Botany.trowelWood); - Botany.proxy.registerItem(Botany.trowelStone); - Botany.proxy.registerItem(Botany.trowelIron); - Botany.proxy.registerItem(Botany.trowelDiamond); - Botany.proxy.registerItem(Botany.trowelGold); - Botany.proxy.registerItem(Botany.misc); - Botany.proxy.registerItem(Botany.pigment); - Botany.proxy.registerItem(Botany.clay); - Botany.proxy.registerBlock(Botany.ceramic, new ItemCeramic(Botany.ceramic)); - Botany.proxy.registerBlock(Botany.stained, new ItemStainedGlass(Botany.stained)); - Botany.proxy.registerBlock(Botany.ceramicTile, new ItemDesign(Botany.ceramicTile)); - Botany.proxy.registerBlock(Botany.ceramicBrick, new ItemCeramicBrick(Botany.ceramicBrick)); + Botany.proxy.registerBlock(plant, new ItemWeed(plant)); + Botany.proxy.registerBlock(soil, new ItemSoil(soil)); + Botany.proxy.registerBlock(loam, new ItemSoil(loam)); + Botany.proxy.registerBlock(flowerbed, new ItemSoil(flowerbed)); + Botany.proxy.registerBlock(soilNoWeed, new ItemSoil(soilNoWeed)); + Botany.proxy.registerBlock(loamNoWeed, new ItemSoil(loamNoWeed)); + Botany.proxy.registerBlock(flowerbedNoWeed, new ItemSoil(flowerbedNoWeed)); + Botany.proxy.registerItem(soilMeter); + Botany.proxy.registerItem(insulatedTube); + Botany.proxy.registerItem(trowelWood); + Botany.proxy.registerItem(trowelStone); + Botany.proxy.registerItem(trowelIron); + Botany.proxy.registerItem(trowelDiamond); + Botany.proxy.registerItem(trowelGold); + Botany.proxy.registerItem(misc); + Botany.proxy.registerItem(pigment); + Botany.proxy.registerItem(clay); + Botany.proxy.registerBlock(ceramic, new ItemCeramic(ceramic)); + Botany.proxy.registerBlock(stained, new ItemStainedGlass(stained)); + Botany.proxy.registerBlock(ceramicTile, new ItemDesign(ceramicTile)); + Botany.proxy.registerBlock(ceramicBrick, new ItemCeramicBrick(ceramicBrick)); BinnieCore.getBinnieProxy().registerTileEntity(TileCeramic.class, "botany.tile.ceramic"); - //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramic), new ItemMetadataRenderer()); - //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.stained), new ItemMetadataRenderer()); + //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ceramic), new ItemMetadataRenderer()); + //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(stained), new ItemMetadataRenderer()); BinnieCore.getBinnieProxy().registerTileEntity(TileCeramicBrick.class, "botany.tile.ceramicBrick"); - //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicTile), new MultipassItemRenderer()); - //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(Botany.ceramicBrick), new MultipassItemRenderer()); + //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ceramicTile), new MultipassItemRenderer()); + //BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ceramicBrick), new MultipassItemRenderer()); - OreDictionary.registerOre("pigment", Botany.pigment); - OreDictionary.registerOre("toolTrowel", Botany.trowelWood); - OreDictionary.registerOre("toolTrowel", Botany.trowelStone); - OreDictionary.registerOre("toolTrowel", Botany.trowelIron); - OreDictionary.registerOre("toolTrowel", Botany.trowelGold); - OreDictionary.registerOre("toolTrowel", Botany.trowelDiamond); + OreDictionary.registerOre("pigment", pigment); + OreDictionary.registerOre("toolTrowel", trowelWood); + OreDictionary.registerOre("toolTrowel", trowelStone); + OreDictionary.registerOre("toolTrowel", trowelIron); + OreDictionary.registerOre("toolTrowel", trowelGold); + OreDictionary.registerOre("toolTrowel", trowelDiamond); } @Override @@ -135,10 +156,10 @@ public class ModuleGardening implements IInitializable { if (fertilised) { insulate += 3; } - new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 128 * insulate), icon); - new CircuitGarden(moist, EnumAcidity.ACID, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 1 + 128 * insulate), icon); - new CircuitGarden(moist, EnumAcidity.NEUTRAL, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 2 + 128 * insulate), icon); - new CircuitGarden(moist, EnumAcidity.ALKALINE, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 3 + 128 * insulate), icon); + new CircuitGarden(moist, null, manual, fertilised, new ItemStack(insulatedTube, 1, 128 * insulate), icon); + new CircuitGarden(moist, EnumAcidity.ACID, manual, fertilised, new ItemStack(insulatedTube, 1, 1 + 128 * insulate), icon); + new CircuitGarden(moist, EnumAcidity.NEUTRAL, manual, fertilised, new ItemStack(insulatedTube, 1, 2 + 128 * insulate), icon); + new CircuitGarden(moist, EnumAcidity.ALKALINE, manual, fertilised, new ItemStack(insulatedTube, 1, 3 + 128 * insulate), icon); } } } @@ -150,7 +171,7 @@ public class ModuleGardening implements IInitializable { GameRegistry.addRecipe(new CeramicTileRecipe()); for (int mat = 0; mat < 4; ++mat) { for (int insulate = 0; insulate < 6; ++insulate) { - ItemStack tubes = new ItemStack(Botany.insulatedTube, 2, mat + 128 * insulate); + ItemStack tubes = new ItemStack(insulatedTube, 2, mat + 128 * insulate); ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes); ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionic_tubes"), 1, mat); GameRegistry.addShapelessRecipe(tubes, forestryTube, forestryTube, insulateStack); @@ -158,7 +179,7 @@ public class ModuleGardening implements IInitializable { } GameRegistry.addRecipe(new ShapedOreRecipe( - Botany.trowelWood, + trowelWood, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", @@ -166,7 +187,7 @@ public class ModuleGardening implements IInitializable { ); GameRegistry.addRecipe(new ShapedOreRecipe( - Botany.trowelStone, + trowelStone, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", @@ -174,7 +195,7 @@ public class ModuleGardening implements IInitializable { )); GameRegistry.addRecipe(new ShapedOreRecipe( - Botany.trowelIron, + trowelIron, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", @@ -182,7 +203,7 @@ public class ModuleGardening implements IInitializable { )); GameRegistry.addRecipe(new ShapedOreRecipe( - Botany.trowelGold, + trowelGold, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", @@ -190,7 +211,7 @@ public class ModuleGardening implements IInitializable { )); GameRegistry.addRecipe(new ShapedOreRecipe( - Botany.trowelDiamond, + trowelDiamond, "d ", " x ", " s", 'd', Blocks.DIRT, 's', "stickWood", @@ -198,7 +219,7 @@ public class ModuleGardening implements IInitializable { )); GameRegistry.addRecipe(new ShapedOreRecipe( - Botany.soilMeter, + soilMeter, " gg", " rg", "i ", 'g', "ingotGold", 'r', "dustRedstone", @@ -244,7 +265,7 @@ public class ModuleGardening implements IInitializable { )); GameRegistry.addRecipe(new ShapelessOreRecipe( - new ItemStack(Botany.pigment, 2, EnumFlowerColor.Black.ordinal()), + new ItemStack(pigment, 2, EnumFlowerColor.Black.ordinal()), "pigment", "pigment", "dyeBlack" )); @@ -276,11 +297,11 @@ public class ModuleGardening implements IInitializable { GameRegistry.addRecipe(BotanyItems.MORTAR.get(6), " c ", "cgc", " c ", 'c', Items.CLAY_BALL, 'g', Blocks.GRAVEL); for (EnumFlowerColor c : EnumFlowerColor.values()) { - ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal()); - ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal()); + ItemStack clay = new ItemStack(this.clay, 1, c.ordinal()); + ItemStack pigment = new ItemStack(this.pigment, 1, c.ordinal()); GameRegistry.addShapelessRecipe(clay, Items.CLAY_BALL, Items.CLAY_BALL, Items.CLAY_BALL, pigment); - GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(Botany.ceramic, c.ordinal()), 0.0f); - ItemStack glass = TileEntityMetadata.getItemStack(Botany.stained, c.ordinal()); + GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(ceramic, c.ordinal()), 0.0f); + ItemStack glass = TileEntityMetadata.getItemStack(stained, c.ordinal()); glass.setCount(4); GameRegistry.addShapedRecipe( diff --git a/src/main/java/binnie/botany/gardening/PlantType.java b/src/main/java/binnie/botany/gardening/PlantType.java index 49696cbc..12a904a6 100644 --- a/src/main/java/binnie/botany/gardening/PlantType.java +++ b/src/main/java/binnie/botany/gardening/PlantType.java @@ -29,7 +29,7 @@ public enum PlantType implements IStringSerializable { } public ItemStack get() { - return new ItemStack(Botany.plant, 1, ordinal()); + return new ItemStack(Botany.gardening().plant, 1, ordinal()); } public boolean isWeed() { diff --git a/src/main/java/binnie/botany/genetics/ModuleGenetics.java b/src/main/java/binnie/botany/genetics/ModuleGenetics.java index 121b6f19..567f495c 100644 --- a/src/main/java/binnie/botany/genetics/ModuleGenetics.java +++ b/src/main/java/binnie/botany/genetics/ModuleGenetics.java @@ -102,7 +102,7 @@ public class ModuleGenetics implements IInitializable { "X#X", '#', Blocks.WOOL, 'X', Items.STRING, - 'V', Botany.soilMeter, + 'V', Botany.gardening().soilMeter, 'Z', "toolTrowel", 'Y', "chestWood" ); diff --git a/src/main/java/binnie/botany/items/BotanyItems.java b/src/main/java/binnie/botany/items/BotanyItems.java index 19a74fc3..600f72d3 100644 --- a/src/main/java/binnie/botany/items/BotanyItems.java +++ b/src/main/java/binnie/botany/items/BotanyItems.java @@ -42,7 +42,7 @@ public enum BotanyItems implements IItemMiscProvider { @Override public ItemStack get(int size) { - return new ItemStack(Botany.misc, size, ordinal()); + return new ItemStack(Botany.gardening().misc, size, ordinal()); } @Override diff --git a/src/main/java/binnie/extratrees/carpentry/GlassType.java b/src/main/java/binnie/extratrees/carpentry/GlassType.java index 861d69ac..cad5b7a4 100644 --- a/src/main/java/binnie/extratrees/carpentry/GlassType.java +++ b/src/main/java/binnie/extratrees/carpentry/GlassType.java @@ -63,7 +63,7 @@ public class GlassType implements IDesignMaterial { if (this.id < 128) { return new ItemStack(Blocks.STAINED_GLASS, 1, this.id); } - return TileEntityMetadata.getItemStack(Botany.stained, this.id - 128); + return TileEntityMetadata.getItemStack(Botany.gardening().stained, this.id - 128); } @Override diff --git a/src/main/java/binnie/extratrees/machines/DesignerType.java b/src/main/java/binnie/extratrees/machines/DesignerType.java index 47b1acca..437969a5 100644 --- a/src/main/java/binnie/extratrees/machines/DesignerType.java +++ b/src/main/java/binnie/extratrees/machines/DesignerType.java @@ -64,7 +64,7 @@ public enum DesignerType { return ExtraTrees.carpentry().blockPanel; } case Tileworker: { - return Botany.ceramicTile; + return Botany.gardening().ceramicTile; } default: { return ExtraTrees.carpentry().blockCarpentry; diff --git a/src/main/java/binnie/extratrees/worldgen/VillageHopeField.java b/src/main/java/binnie/extratrees/worldgen/VillageHopeField.java index 1aaae1c9..7096514d 100644 --- a/src/main/java/binnie/extratrees/worldgen/VillageHopeField.java +++ b/src/main/java/binnie/extratrees/worldgen/VillageHopeField.java @@ -98,7 +98,8 @@ public class VillageHopeField extends StructureVillagePieces.Village { return Blocks.WHEAT; } } - + + @SuppressWarnings("deprecation") public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { if (this.averageGroundLvl < 0) { diff --git a/src/main/java/binnie/genetics/gui/analyst/flower/AnalystPageSoil.java b/src/main/java/binnie/genetics/gui/analyst/flower/AnalystPageSoil.java index 211de12c..f81cd31a 100644 --- a/src/main/java/binnie/genetics/gui/analyst/flower/AnalystPageSoil.java +++ b/src/main/java/binnie/genetics/gui/analyst/flower/AnalystPageSoil.java @@ -83,7 +83,7 @@ public class AnalystPageSoil extends ControlAnalystPage { recomPH = EnumAcidity.ALKALINE; } } - ItemStack stack = new ItemStack(Botany.soil, 1, BlockSoil.getMeta(recomPH, recomMoisture)); + ItemStack stack = new ItemStack(Botany.gardening().soil, 1, BlockSoil.getMeta(recomPH, recomMoisture)); ControlItemDisplay recomSoil = new ControlItemDisplay(this, (width() - 24) / 2, y, 24); recomSoil.setItemStack(stack); recomSoil.setTooltip(); @@ -94,7 +94,7 @@ public class AnalystPageSoil extends ControlAnalystPage { for (EnumAcidity a : EnumSet.range(EnumAcidity.ACID, EnumAcidity.ALKALINE)) { for (EnumMoisture b : EnumSet.range(EnumMoisture.DRY, EnumMoisture.DAMP)) { if (Tolerance.canTolerate(pH, a, pHTol) && Tolerance.canTolerate(moisture, b, moistureTol) && (a != recomPH || b != recomMoisture)) { - stacks.add(new ItemStack(Botany.soil, 1, BlockSoil.getMeta(a, b))); + stacks.add(new ItemStack(Botany.gardening().soil, 1, BlockSoil.getMeta(a, b))); } } } diff --git a/src/main/java/binnie/genetics/integration/jei/GeneticsJeiPlugin.java b/src/main/java/binnie/genetics/integration/jei/GeneticsJeiPlugin.java index 28625371..cc8e47ba 100644 --- a/src/main/java/binnie/genetics/integration/jei/GeneticsJeiPlugin.java +++ b/src/main/java/binnie/genetics/integration/jei/GeneticsJeiPlugin.java @@ -76,15 +76,15 @@ public class GeneticsJeiPlugin extends BlankModPlugin { new DatabaseRecipeCategory() ); - registry.addRecipeCategoryCraftingItem(LaboratoryMachine.Incubator.get(1), RecipeUids.INCUBATOR, RecipeUids.INCUBATOR_LARVAE); - registry.addRecipeCategoryCraftingItem(GeneticMachine.Isolator.get(1), RecipeUids.ISOLATOR); - registry.addRecipeCategoryCraftingItem(GeneticMachine.Polymeriser.get(1), RecipeUids.POLYMERISER); - registry.addRecipeCategoryCraftingItem(GeneticMachine.Sequencer.get(1), RecipeUids.SEQUENCER); - registry.addRecipeCategoryCraftingItem(GeneticMachine.Inoculator.get(1), RecipeUids.INOCULATOR); - registry.addRecipeCategoryCraftingItem(AdvGeneticMachine.Splicer.get(1), RecipeUids.SPLICER); - registry.addRecipeCategoryCraftingItem(LaboratoryMachine.Genepool.get(1), RecipeUids.GENEPOOL); - registry.addRecipeCategoryCraftingItem(new ItemStack(Genetics.items().database), RecipeUids.DATABASE); - registry.addRecipeCategoryCraftingItem(new ItemStack(Genetics.items().database, 1, 1), RecipeUids.DATABASE); + registry.addRecipeCatalyst(LaboratoryMachine.Incubator.get(1), RecipeUids.INCUBATOR, RecipeUids.INCUBATOR_LARVAE); + registry.addRecipeCatalyst(GeneticMachine.Isolator.get(1), RecipeUids.ISOLATOR); + registry.addRecipeCatalyst(GeneticMachine.Polymeriser.get(1), RecipeUids.POLYMERISER); + registry.addRecipeCatalyst(GeneticMachine.Sequencer.get(1), RecipeUids.SEQUENCER); + registry.addRecipeCatalyst(GeneticMachine.Inoculator.get(1), RecipeUids.INOCULATOR); + registry.addRecipeCatalyst(AdvGeneticMachine.Splicer.get(1), RecipeUids.SPLICER); + registry.addRecipeCatalyst(LaboratoryMachine.Genepool.get(1), RecipeUids.GENEPOOL); + registry.addRecipeCatalyst(new ItemStack(Genetics.items().database), RecipeUids.DATABASE); + registry.addRecipeCatalyst(new ItemStack(Genetics.items().database, 1, 1), RecipeUids.DATABASE); registry.addRecipes(Incubator.getRecipes(), RecipeUids.INCUBATOR); registry.addRecipes(LarvaeIncubatorRecipeMaker.create(Incubator.getLarvaeRecipe()), RecipeUids.INCUBATOR);