From ebe6580aaf2b35a25d94d53503c65b124721bbdb Mon Sep 17 00:00:00 2001 From: Nedelosk Date: Fri, 11 May 2018 11:01:02 +0200 Subject: [PATCH] Fix #2130 Can't insert Immersive engineering industrial hemp into crop multifarm block --- .../cultivation/tiles/TileArboretum.java | 4 +- .../forestry/cultivation/tiles/TileBog.java | 3 +- .../cultivation/tiles/TileFarmCrops.java | 4 +- .../cultivation/tiles/TileFarmEnder.java | 4 +- .../cultivation/tiles/TileFarmGourd.java | 4 +- .../cultivation/tiles/TileFarmMushroom.java | 4 +- .../cultivation/tiles/TileFarmNether.java | 4 +- .../cultivation/tiles/TilePlantation.java | 4 +- .../java/forestry/farming/ModuleFarming.java | 45 ++++++++++--------- .../farming/logic/ForestryFarmIdentifier.java | 17 +++++++ .../multiblock/FakeFarmController.java | 3 +- .../farming/multiblock/FarmController.java | 3 +- .../plugins/PluginActuallyAdditions.java | 3 +- .../plugins/PluginBetterWithMods.java | 3 +- .../plugins/PluginExtraUtilities.java | 7 +-- .../forestry/plugins/PluginHarvestCraft.java | 23 +++++----- src/main/java/forestry/plugins/PluginIC2.java | 5 ++- .../plugins/PluginImmersiveEngineering.java | 4 +- .../plugins/PluginMysticalAgriculture.java | 5 ++- .../java/forestry/plugins/PluginNatura.java | 11 ++--- .../java/forestry/plugins/PluginRoots.java | 3 +- .../java/forestry/plugins/PluginRustic.java | 7 +-- .../forestry/plugins/PluginTechReborn.java | 3 +- 23 files changed, 109 insertions(+), 64 deletions(-) create mode 100644 src/main/java/forestry/farming/logic/ForestryFarmIdentifier.java diff --git a/src/main/java/forestry/cultivation/tiles/TileArboretum.java b/src/main/java/forestry/cultivation/tiles/TileArboretum.java index 549e53340..3fdcdc515 100644 --- a/src/main/java/forestry/cultivation/tiles/TileArboretum.java +++ b/src/main/java/forestry/cultivation/tiles/TileArboretum.java @@ -5,9 +5,11 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import forestry.farming.logic.ForestryFarmIdentifier; + public class TileArboretum extends TilePlanter { public TileArboretum() { - super("farmArboreal"); + super(ForestryFarmIdentifier.ARBOREAL); } @Override diff --git a/src/main/java/forestry/cultivation/tiles/TileBog.java b/src/main/java/forestry/cultivation/tiles/TileBog.java index 12a654363..6fc1c2039 100644 --- a/src/main/java/forestry/cultivation/tiles/TileBog.java +++ b/src/main/java/forestry/cultivation/tiles/TileBog.java @@ -4,10 +4,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import forestry.core.ModuleCore; +import forestry.farming.logic.ForestryFarmIdentifier; public class TileBog extends TilePlanter { public TileBog() { - super("farmPeat"); + super(ForestryFarmIdentifier.PEAT); } @Override diff --git a/src/main/java/forestry/cultivation/tiles/TileFarmCrops.java b/src/main/java/forestry/cultivation/tiles/TileFarmCrops.java index 6ef256889..6923b12fc 100644 --- a/src/main/java/forestry/cultivation/tiles/TileFarmCrops.java +++ b/src/main/java/forestry/cultivation/tiles/TileFarmCrops.java @@ -5,9 +5,11 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import forestry.farming.logic.ForestryFarmIdentifier; + public class TileFarmCrops extends TilePlanter { public TileFarmCrops() { - super("farmCrops"); + super(ForestryFarmIdentifier.CROPS); } @Override diff --git a/src/main/java/forestry/cultivation/tiles/TileFarmEnder.java b/src/main/java/forestry/cultivation/tiles/TileFarmEnder.java index 1d6916586..1e799d416 100644 --- a/src/main/java/forestry/cultivation/tiles/TileFarmEnder.java +++ b/src/main/java/forestry/cultivation/tiles/TileFarmEnder.java @@ -5,9 +5,11 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import forestry.farming.logic.ForestryFarmIdentifier; + public class TileFarmEnder extends TilePlanter { public TileFarmEnder() { - super("farmEnder"); + super(ForestryFarmIdentifier.ENDER); } @Override diff --git a/src/main/java/forestry/cultivation/tiles/TileFarmGourd.java b/src/main/java/forestry/cultivation/tiles/TileFarmGourd.java index e99abd04c..60e3ab689 100644 --- a/src/main/java/forestry/cultivation/tiles/TileFarmGourd.java +++ b/src/main/java/forestry/cultivation/tiles/TileFarmGourd.java @@ -4,9 +4,11 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import forestry.farming.logic.ForestryFarmIdentifier; + public class TileFarmGourd extends TilePlanter { public TileFarmGourd() { - super("farmGourd"); + super(ForestryFarmIdentifier.GOURD); } @Override diff --git a/src/main/java/forestry/cultivation/tiles/TileFarmMushroom.java b/src/main/java/forestry/cultivation/tiles/TileFarmMushroom.java index 5ae5f36f7..ab42b561f 100644 --- a/src/main/java/forestry/cultivation/tiles/TileFarmMushroom.java +++ b/src/main/java/forestry/cultivation/tiles/TileFarmMushroom.java @@ -4,9 +4,11 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import forestry.farming.logic.ForestryFarmIdentifier; + public class TileFarmMushroom extends TilePlanter { public TileFarmMushroom() { - super("farmShroom"); + super(ForestryFarmIdentifier.SHROOM); } @Override diff --git a/src/main/java/forestry/cultivation/tiles/TileFarmNether.java b/src/main/java/forestry/cultivation/tiles/TileFarmNether.java index be8c5f29c..2a63a4896 100644 --- a/src/main/java/forestry/cultivation/tiles/TileFarmNether.java +++ b/src/main/java/forestry/cultivation/tiles/TileFarmNether.java @@ -5,9 +5,11 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import forestry.farming.logic.ForestryFarmIdentifier; + public class TileFarmNether extends TilePlanter { public TileFarmNether() { - super("farmInfernal"); + super(ForestryFarmIdentifier.INFERNAL); } @Override diff --git a/src/main/java/forestry/cultivation/tiles/TilePlantation.java b/src/main/java/forestry/cultivation/tiles/TilePlantation.java index 23fb31822..fe7ea371c 100644 --- a/src/main/java/forestry/cultivation/tiles/TilePlantation.java +++ b/src/main/java/forestry/cultivation/tiles/TilePlantation.java @@ -3,10 +3,12 @@ package forestry.cultivation.tiles; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; +import forestry.farming.logic.ForestryFarmIdentifier; + public class TilePlantation extends TilePlanter { public TilePlantation() { - super("farmRubber"); + super(ForestryFarmIdentifier.RUBBER); } @Override diff --git a/src/main/java/forestry/farming/ModuleFarming.java b/src/main/java/forestry/farming/ModuleFarming.java index 683232207..2eb806c20 100644 --- a/src/main/java/forestry/farming/ModuleFarming.java +++ b/src/main/java/forestry/farming/ModuleFarming.java @@ -72,6 +72,7 @@ import forestry.farming.logic.FarmLogicOrchard; import forestry.farming.logic.FarmLogicPeat; import forestry.farming.logic.FarmLogicReeds; import forestry.farming.logic.FarmLogicSucculent; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.farming.logic.farmables.FarmableChorus; import forestry.farming.logic.farmables.FarmableGE; @@ -129,33 +130,33 @@ public class ModuleFarming extends BlankForestryModule { MinecraftForge.EVENT_BUS.register(this); IFarmRegistry registry = ForestryAPI.farmRegistry; - registry.registerFarmables("farmArboreal", new FarmableVanillaSapling()); + registry.registerFarmables(ForestryFarmIdentifier.ARBOREAL, new FarmableVanillaSapling()); if (ModuleHelper.isEnabled(ForestryModuleUids.ARBORICULTURE)) { - registry.registerFarmables("farmArboreal", new FarmableGE()); + registry.registerFarmables(ForestryFarmIdentifier.ARBOREAL, new FarmableGE()); } - registry.registerFarmables("farmCrops", + registry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(new ItemStack(Items.WHEAT_SEEDS), Blocks.WHEAT, BlockCrops.AGE, 7, 0), new FarmableAgingCrop(new ItemStack(Items.POTATO), Blocks.POTATOES, BlockCrops.AGE, 7, 0), new FarmableAgingCrop(new ItemStack(Items.CARROT), Blocks.CARROTS, BlockCrops.AGE, 7, 0), new FarmableAgingCrop(new ItemStack(Items.BEETROOT_SEEDS), Blocks.BEETROOTS, BlockBeetroot.BEETROOT_AGE, 3, 0)); IBlockState plantedBrownMushroom = blocks.mushroom.getDefaultState().withProperty(BlockMushroom.VARIANT, BlockMushroom.MushroomType.BROWN); - registry.registerFarmables("farmShroom", new FarmableVanillaMushroom(new ItemStack(Blocks.BROWN_MUSHROOM), plantedBrownMushroom, Blocks.BROWN_MUSHROOM_BLOCK)); + registry.registerFarmables(ForestryFarmIdentifier.SHROOM, new FarmableVanillaMushroom(new ItemStack(Blocks.BROWN_MUSHROOM), plantedBrownMushroom, Blocks.BROWN_MUSHROOM_BLOCK)); IBlockState plantedRedMushroom = blocks.mushroom.getDefaultState().withProperty(BlockMushroom.VARIANT, BlockMushroom.MushroomType.RED); - registry.registerFarmables("farmShroom", new FarmableVanillaMushroom(new ItemStack(Blocks.RED_MUSHROOM), plantedRedMushroom, Blocks.RED_MUSHROOM_BLOCK)); + registry.registerFarmables(ForestryFarmIdentifier.SHROOM, new FarmableVanillaMushroom(new ItemStack(Blocks.RED_MUSHROOM), plantedRedMushroom, Blocks.RED_MUSHROOM_BLOCK)); - registry.registerFarmables("farmGourd", new FarmableGourd(new ItemStack(Items.PUMPKIN_SEEDS), Blocks.PUMPKIN_STEM, Blocks.PUMPKIN)); - registry.registerFarmables("farmGourd", new FarmableGourd(new ItemStack(Items.MELON_SEEDS), Blocks.MELON_STEM, Blocks.MELON_BLOCK)); + registry.registerFarmables(ForestryFarmIdentifier.GOURD, new FarmableGourd(new ItemStack(Items.PUMPKIN_SEEDS), Blocks.PUMPKIN_STEM, Blocks.PUMPKIN)); + registry.registerFarmables(ForestryFarmIdentifier.GOURD, new FarmableGourd(new ItemStack(Items.MELON_SEEDS), Blocks.MELON_STEM, Blocks.MELON_BLOCK)); - registry.registerFarmables("farmInfernal", new FarmableAgingCrop(new ItemStack(Items.NETHER_WART), Blocks.NETHER_WART, BlockNetherWart.AGE, 3)); + registry.registerFarmables(ForestryFarmIdentifier.INFERNAL, new FarmableAgingCrop(new ItemStack(Items.NETHER_WART), Blocks.NETHER_WART, BlockNetherWart.AGE, 3)); - registry.registerFarmables("farmPoales", new FarmableStacked(new ItemStack(Items.REEDS), Blocks.REEDS, 3)); + registry.registerFarmables(ForestryFarmIdentifier.POALES, new FarmableStacked(new ItemStack(Items.REEDS), Blocks.REEDS, 3)); - registry.registerFarmables("farmSucculentes", new FarmableStacked(new ItemStack(Blocks.CACTUS), Blocks.CACTUS, 3)); + registry.registerFarmables(ForestryFarmIdentifier.SUCCULENTES, new FarmableStacked(new ItemStack(Blocks.CACTUS), Blocks.CACTUS, 3)); - registry.registerFarmables("farmEnder", FarmableChorus.INSTANCE); + registry.registerFarmables(ForestryFarmIdentifier.ENDER, FarmableChorus.INSTANCE); //Forestry fertilizer registry.registerFertilizer(new ItemStack(coreItems.fertilizerCompound, 1, OreDictionary.WILDCARD_VALUE), 500); @@ -192,17 +193,17 @@ public class ModuleFarming extends BlankForestryModule { IFarmRegistry registry = FarmRegistry.getInstance(); BlockRegistryCore coreBlocks = ModuleCore.getBlocks(); - IFarmProperties arborealFarm = registry.registerLogic("farmArboreal", FarmLogicArboreal::new); - IFarmProperties cropsFarm = registry.registerLogic("farmCrops", FarmLogicCrops::new); - IFarmProperties mushroomFarm = registry.registerLogic("farmShroom", FarmLogicMushroom::new); - IFarmProperties succulentFarm = registry.registerLogic("farmSucculentes", FarmLogicSucculent::new); - IFarmProperties peatFarm = registry.registerLogic("farmPeat", FarmLogicPeat::new); - IFarmProperties infernalFarm = registry.registerLogic("farmInfernal", FarmLogicInfernal::new); - IFarmProperties poalesFarm = registry.registerLogic("farmPoales", FarmLogicReeds::new); - IFarmProperties orchardFarm = registry.registerLogic("farmOrchard", FarmLogicOrchard::new); - IFarmProperties gourdFarm = registry.registerLogic("farmGourd", FarmLogicGourd::new); - IFarmProperties cocoaFarm = registry.registerLogic("farmCocoa", FarmLogicCocoa::new); - IFarmProperties enderFarm = registry.registerLogic("farmEnder", FarmLogicEnder::new); + IFarmProperties arborealFarm = registry.registerLogic(ForestryFarmIdentifier.ARBOREAL, FarmLogicArboreal::new); + IFarmProperties cropsFarm = registry.registerLogic(ForestryFarmIdentifier.CROPS, FarmLogicCrops::new); + IFarmProperties mushroomFarm = registry.registerLogic(ForestryFarmIdentifier.SHROOM, FarmLogicMushroom::new); + IFarmProperties succulentFarm = registry.registerLogic(ForestryFarmIdentifier.SUCCULENTES, FarmLogicSucculent::new); + IFarmProperties peatFarm = registry.registerLogic(ForestryFarmIdentifier.PEAT, FarmLogicPeat::new); + IFarmProperties infernalFarm = registry.registerLogic(ForestryFarmIdentifier.INFERNAL, FarmLogicInfernal::new); + IFarmProperties poalesFarm = registry.registerLogic(ForestryFarmIdentifier.POALES, FarmLogicReeds::new); + IFarmProperties orchardFarm = registry.registerLogic(ForestryFarmIdentifier.ORCHARD, FarmLogicOrchard::new); + IFarmProperties gourdFarm = registry.registerLogic(ForestryFarmIdentifier.GOURD, FarmLogicGourd::new); + IFarmProperties cocoaFarm = registry.registerLogic(ForestryFarmIdentifier.COCOA, FarmLogicCocoa::new); + IFarmProperties enderFarm = registry.registerLogic(ForestryFarmIdentifier.ENDER, FarmLogicEnder::new); Circuits.farmArborealManaged = new CircuitFarmLogic("managedArboreal", arborealFarm, false); Circuits.farmArborealManual = new CircuitFarmLogic("manualArboreal", arborealFarm, true); diff --git a/src/main/java/forestry/farming/logic/ForestryFarmIdentifier.java b/src/main/java/forestry/farming/logic/ForestryFarmIdentifier.java new file mode 100644 index 000000000..d5b0cad1f --- /dev/null +++ b/src/main/java/forestry/farming/logic/ForestryFarmIdentifier.java @@ -0,0 +1,17 @@ +package forestry.farming.logic; + +public class ForestryFarmIdentifier { + public static final String CROPS = "farmCrops"; + public static final String GOURD = "farmGourd"; + public static final String SHROOM = "farmShroom"; + public static final String INFERNAL = "farmInfernal"; + public static final String POALES = "farmPoales"; + public static final String SUCCULENTES = "farmSucculentes"; + public static final String ENDER = "farmEnder"; + public static final String ARBOREAL = "farmArboreal"; + public static final String PEAT = "farmPeat"; + public static final String ORCHARD = "farmOrchard"; + public static final String COCOA = "farmCocoa"; + public static final String RUBBER = "farmRubber"; + public static final String ORCHID ="farmOrchid"; +} diff --git a/src/main/java/forestry/farming/multiblock/FakeFarmController.java b/src/main/java/forestry/farming/multiblock/FakeFarmController.java index 34fc79620..c0a4474f5 100644 --- a/src/main/java/forestry/farming/multiblock/FakeFarmController.java +++ b/src/main/java/forestry/farming/multiblock/FakeFarmController.java @@ -32,6 +32,7 @@ import forestry.core.inventory.IInventoryAdapter; import forestry.core.multiblock.FakeMultiblockController; import forestry.farming.FarmRegistry; import forestry.farming.gui.IFarmLedgerDelegate; +import forestry.farming.logic.ForestryFarmIdentifier; public class FakeFarmController extends FakeMultiblockController implements IFarmControllerInternal { public static final FakeFarmController instance = new FakeFarmController(); @@ -87,7 +88,7 @@ public class FakeFarmController extends FakeMultiblockController implements IFar @Override public IFarmLogic getFarmLogic(FarmDirection direction) { - return FarmRegistry.getInstance().getProperties("farmArboreal").getLogic(false); + return FarmRegistry.getInstance().getProperties(ForestryFarmIdentifier.ARBOREAL).getLogic(false); } @Override diff --git a/src/main/java/forestry/farming/multiblock/FarmController.java b/src/main/java/forestry/farming/multiblock/FarmController.java index e9f899b58..e4f152f47 100755 --- a/src/main/java/forestry/farming/multiblock/FarmController.java +++ b/src/main/java/forestry/farming/multiblock/FarmController.java @@ -77,6 +77,7 @@ import forestry.farming.FarmHelper.Stage; import forestry.farming.FarmRegistry; import forestry.farming.FarmTarget; import forestry.farming.gui.IFarmLedgerDelegate; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.tiles.TileFarmGearbox; import forestry.farming.tiles.TileFarmPlain; @@ -630,7 +631,7 @@ public class FarmController extends RectangularMultiblockControllerBase implemen @Override public void resetFarmLogic(FarmDirection direction) { - setFarmLogic(direction, FarmRegistry.getInstance().getProperties("farmArboreal").getLogic(false)); + setFarmLogic(direction, FarmRegistry.getInstance().getProperties(ForestryFarmIdentifier.ARBOREAL).getLogic(false)); } @Override diff --git a/src/main/java/forestry/plugins/PluginActuallyAdditions.java b/src/main/java/forestry/plugins/PluginActuallyAdditions.java index faac25616..b3354110b 100644 --- a/src/main/java/forestry/plugins/PluginActuallyAdditions.java +++ b/src/main/java/forestry/plugins/PluginActuallyAdditions.java @@ -15,6 +15,7 @@ import forestry.api.core.ForestryAPI; import forestry.api.modules.ForestryModule; import forestry.api.recipes.RecipeManagers; import forestry.core.fluids.Fluids; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.modules.ForestryModuleUids; import forestry.modules.ModuleHelper; @@ -75,7 +76,7 @@ public class PluginActuallyAdditions extends CompatPlugin { Block plantBlock = getBlock(blockName); if (plantBlock != null) { FarmableAgingCrop crop = new FarmableAgingCrop(new ItemStack(seedItem), plantBlock, BlockCrops.AGE, 7, 0); - ForestryAPI.farmRegistry.registerFarmables("farmCrops", crop); + ForestryAPI.farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, crop); } } } diff --git a/src/main/java/forestry/plugins/PluginBetterWithMods.java b/src/main/java/forestry/plugins/PluginBetterWithMods.java index 9bd4f9175..998ff8f09 100644 --- a/src/main/java/forestry/plugins/PluginBetterWithMods.java +++ b/src/main/java/forestry/plugins/PluginBetterWithMods.java @@ -13,6 +13,7 @@ import forestry.api.modules.ForestryModule; import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.fluids.Fluids; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableDoubleCrop; import forestry.modules.ForestryModuleUids; @@ -38,7 +39,7 @@ public class PluginBetterWithMods extends CompatPlugin { IBlockState mature = defaultState.withProperty(AGE, 7).withProperty(TOP, false); IBlockState topMature = defaultState.withProperty(AGE, 7).withProperty(TOP, true); - farmRegistry.registerFarmables("farmCrops", new FarmableDoubleCrop(hempSeed, planted, mature, topMature, true)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableDoubleCrop(hempSeed, planted, mature, topMature, true)); RecipeManagers.squeezerManager.addRecipe(10, hempSeed, Fluids.SEED_OIL.getFluid(seedAmount)); } diff --git a/src/main/java/forestry/plugins/PluginExtraUtilities.java b/src/main/java/forestry/plugins/PluginExtraUtilities.java index 78d5f6ac2..edae1c270 100644 --- a/src/main/java/forestry/plugins/PluginExtraUtilities.java +++ b/src/main/java/forestry/plugins/PluginExtraUtilities.java @@ -37,6 +37,7 @@ import forestry.core.utils.Log; import forestry.farming.FarmRegistry; import forestry.farming.circuits.CircuitFarmLogic; import forestry.farming.logic.FarmLogicRedOrchid; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.modules.ForestryModuleUids; @@ -57,9 +58,9 @@ public class PluginExtraUtilities extends CompatPlugin { if (Config.isExUtilRedOrchidEnabled() && redOrchid != null) { Item item = Item.getItemFromBlock(redOrchid); - registerFarmable(redOrchid, item, "farmOrchid"); + registerFarmable(redOrchid, item, ForestryFarmIdentifier.ORCHID); - IFarmProperties orchidFarm = FarmRegistry.getInstance().registerLogic("farmOrchid", FarmLogicRedOrchid::new); + IFarmProperties orchidFarm = FarmRegistry.getInstance().registerLogic(ForestryFarmIdentifier.ORCHID, FarmLogicRedOrchid::new); orchidFarm.registerSoil(new ItemStack(Blocks.REDSTONE_ORE), Blocks.REDSTONE_ORE.getDefaultState()); orchidFarm.registerSoil(new ItemStack(Blocks.LIT_REDSTONE_ORE), Blocks.LIT_REDSTONE_ORE.getDefaultState()); @@ -71,7 +72,7 @@ public class PluginExtraUtilities extends CompatPlugin { if (Config.isExUtilEnderLilyEnabled() && enderLilly != null) { Item item = Item.getItemFromBlock(enderLilly); - registerFarmable(enderLilly, item, "farmEnder"); + registerFarmable(enderLilly, item, ForestryFarmIdentifier.ENDER); } } diff --git a/src/main/java/forestry/plugins/PluginHarvestCraft.java b/src/main/java/forestry/plugins/PluginHarvestCraft.java index a1ea27aec..6b6f85dd6 100644 --- a/src/main/java/forestry/plugins/PluginHarvestCraft.java +++ b/src/main/java/forestry/plugins/PluginHarvestCraft.java @@ -29,6 +29,7 @@ import forestry.core.config.Constants; import forestry.core.fluids.Fluids; import forestry.core.items.ItemRegistryCore; import forestry.core.recipes.RecipeUtil; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.modules.ForestryModuleUids; import forestry.modules.ModuleHelper; @@ -199,7 +200,7 @@ public class PluginHarvestCraft extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, berrySeed, Fluids.SEED_OIL.getFluid(seedamount)); } if (farmingModuleEnabled && berrySeed != null && berryBlock != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(berrySeed, berryBlock, plantAGE, 3, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(berrySeed, berryBlock, plantAGE, 3, 0)); } plants.add(berryName); } @@ -216,7 +217,7 @@ public class PluginHarvestCraft extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, fruitSeed, Fluids.SEED_OIL.getFluid(seedamount)); } if (farmingModuleEnabled && fruitSeed != null && fruitBlock != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(fruitSeed, fruitBlock, plantAGE, 3, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(fruitSeed, fruitBlock, plantAGE, 3, 0)); } plants.add(fruitName); } @@ -234,7 +235,7 @@ public class PluginHarvestCraft extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, vegetableSeed, Fluids.SEED_OIL.getFluid(seedamount)); } if (farmingModuleEnabled && vegetableSeed != null && vegetableBlock != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(vegetableSeed, vegetableBlock, plantAGE, 3, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(vegetableSeed, vegetableBlock, plantAGE, 3, 0)); } plants.add(vegetableName); } @@ -253,7 +254,7 @@ public class PluginHarvestCraft extends CompatPlugin { RecipeManagers.moistenerManager.addRecipe(grainSeed, new ItemStack(Blocks.MYCELIUM), 5000); } if (farmingModuleEnabled && grainSeed != null && grainBlock != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(grainSeed, grainBlock, plantAGE, 3, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(grainSeed, grainBlock, plantAGE, 3, 0)); } plants.add(grainName); } @@ -262,7 +263,7 @@ public class PluginHarvestCraft extends CompatPlugin { ItemStack treeFruit = getItemStack(treeFruitName + "item"); Block treeFruitBlock = getBlock("pam" + treeFruitName); if (farmingModuleEnabled && treeFruitBlock != null) { - farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, treeFruitBlock, fruitAGE, 2, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.ORCHARD, new FarmableAgingCrop(ItemStack.EMPTY, treeFruitBlock, fruitAGE, 2, 0)); } if (treeFruit != null) { RecipeManagers.squeezerManager.addRecipe(10, treeFruit, Fluids.JUICE.getFluid(juiceAmount)); @@ -273,7 +274,7 @@ public class PluginHarvestCraft extends CompatPlugin { for (String treeName : trees) { Block fruitBlock = getBlock("pam" + treeName); if (farmingModuleEnabled && fruitBlock != null) { - farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.ORCHARD, new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0)); } plants.add(treeName); } @@ -281,7 +282,7 @@ public class PluginHarvestCraft extends CompatPlugin { for (String treeName : treesSpecial) { Block fruitBlock = getBlock("pam" + treeName); if (farmingModuleEnabled && fruitBlock != null) { - farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.ORCHARD, new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0)); } } @@ -299,7 +300,7 @@ public class PluginHarvestCraft extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, genericCropSeed, Fluids.SEED_OIL.getFluid(seedamount)); } if (farmingModuleEnabled && genericCropSeed != null && genericCropBlock != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(genericCropSeed, genericCropBlock, plantAGE, 3, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(genericCropSeed, genericCropBlock, plantAGE, 3, 0)); } plants.add(cropName); } @@ -310,7 +311,7 @@ public class PluginHarvestCraft extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, mustardCropSeed, Fluids.SEED_OIL.getFluid(seedamount)); } if (farmingModuleEnabled && mustardCropSeed != null && mustardCropBlock != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(mustardCropSeed, mustardCropBlock, plantAGE, 3, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(mustardCropSeed, mustardCropBlock, plantAGE, 3, 0)); } if (mustardFruit != null) { RecipeUtil.addFermenterRecipes(mustardFruit, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); @@ -331,7 +332,7 @@ public class PluginHarvestCraft extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, cropnutSeed, Fluids.SEED_OIL.getFluid(seedamount)); } if (farmingModuleEnabled && cropnutSeed != null && cropnutBlock != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(cropnutSeed, cropnutBlock, plantAGE, 3, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(cropnutSeed, cropnutBlock, plantAGE, 3, 0)); } if (cropnut != null) { RecipeManagers.squeezerManager.addRecipe(20, cropnut, Fluids.SEED_OIL.getFluid(12 * seedamount)); @@ -342,7 +343,7 @@ public class PluginHarvestCraft extends CompatPlugin { ItemStack nut = getItemStack(nutName + "item"); Block nutBlock = getBlock("pam" + nutName); if (farmingModuleEnabled && nutBlock != null) { - farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, nutBlock, fruitAGE, 2, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.ORCHARD, new FarmableAgingCrop(ItemStack.EMPTY, nutBlock, fruitAGE, 2, 0)); } if (nut != null) { RecipeManagers.squeezerManager.addRecipe(20, nut, Fluids.SEED_OIL.getFluid(15 * seedamount)); diff --git a/src/main/java/forestry/plugins/PluginIC2.java b/src/main/java/forestry/plugins/PluginIC2.java index 4e7dd05ec..ee050cd94 100644 --- a/src/main/java/forestry/plugins/PluginIC2.java +++ b/src/main/java/forestry/plugins/PluginIC2.java @@ -63,6 +63,7 @@ import forestry.energy.circuits.CircuitElectricEfficiency; import forestry.farming.FarmRegistry; import forestry.farming.circuits.CircuitFarmLogic; import forestry.farming.logic.FarmLogicRubber; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableBasicIC2Crop; import forestry.modules.BlankForestryModule; import forestry.modules.ForestryModuleUids; @@ -130,7 +131,7 @@ public class PluginIC2 extends BlankForestryModule { rubber = IC2Items.getItem("crafting", "rubber"); fertilizer = IC2Items.getItem("crop_res","fertilizer"); - IFarmProperties rubberFarm = FarmRegistry.getInstance().registerLogic("farmRubber", FarmLogicRubber::new); + IFarmProperties rubberFarm = FarmRegistry.getInstance().registerLogic(ForestryFarmIdentifier.RUBBER, FarmLogicRubber::new); Circuits.farmRubberManual = new CircuitFarmLogic("manualRubber", rubberFarm, true); @@ -302,7 +303,7 @@ public class PluginIC2 extends BlankForestryModule { ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.RUBBER, 1), Circuits.farmRubberManual); } - FarmRegistry.getInstance().registerFarmables("farmOrchard", new FarmableBasicIC2Crop()); + FarmRegistry.getInstance().registerFarmables(ForestryFarmIdentifier.ORCHARD, new FarmableBasicIC2Crop()); } diff --git a/src/main/java/forestry/plugins/PluginImmersiveEngineering.java b/src/main/java/forestry/plugins/PluginImmersiveEngineering.java index c97bf05fd..5e188140b 100644 --- a/src/main/java/forestry/plugins/PluginImmersiveEngineering.java +++ b/src/main/java/forestry/plugins/PluginImmersiveEngineering.java @@ -22,6 +22,7 @@ import forestry.api.modules.ForestryModule; import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.fluids.Fluids; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableDoubleCrop; import forestry.modules.ForestryModuleUids; @@ -53,8 +54,7 @@ public class PluginImmersiveEngineering extends CompatPlugin { IBlockState mature = defaultState.withProperty(age, (Comparable) bottom4.get()); IBlockState topMature = defaultState.withProperty(age, (Comparable) top0.get()); - farmRegistry.registerFarmables("farmWheat", new FarmableDoubleCrop(hempSeed, planted, mature, topMature, false)); - farmRegistry.registerFarmables("farmOrchard", new FarmableDoubleCrop(hempSeed, planted, mature, topMature, true)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableDoubleCrop(hempSeed, planted, mature, topMature, true)); RecipeManagers.squeezerManager.addRecipe(10, hempSeed, Fluids.SEED_OIL.getFluid(seedAmount)); } diff --git a/src/main/java/forestry/plugins/PluginMysticalAgriculture.java b/src/main/java/forestry/plugins/PluginMysticalAgriculture.java index d5c633827..3e023f773 100644 --- a/src/main/java/forestry/plugins/PluginMysticalAgriculture.java +++ b/src/main/java/forestry/plugins/PluginMysticalAgriculture.java @@ -12,6 +12,7 @@ import forestry.api.modules.ForestryModule; import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.fluids.Fluids; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.modules.ForestryModuleUids; import forestry.modules.ModuleHelper; @@ -162,7 +163,7 @@ public class PluginMysticalAgriculture extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, seeds, Fluids.SEED_OIL.getFluid(seedAmount)); } if (seeds != null && block != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(seeds, block, BlockCrops.AGE, 7, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(seeds, block, BlockCrops.AGE, 7, 0)); } } for(int i = 1;i <= 5;i++){ @@ -172,7 +173,7 @@ public class PluginMysticalAgriculture extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, seeds, Fluids.SEED_OIL.getFluid(seedAmount)); } if (seeds != null && block != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(seeds, block, BlockCrops.AGE, 7, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(seeds, block, BlockCrops.AGE, 7, 0)); } } } diff --git a/src/main/java/forestry/plugins/PluginNatura.java b/src/main/java/forestry/plugins/PluginNatura.java index c8eabe43b..9dde7be14 100644 --- a/src/main/java/forestry/plugins/PluginNatura.java +++ b/src/main/java/forestry/plugins/PluginNatura.java @@ -51,6 +51,7 @@ import forestry.core.utils.ItemStackUtil; import forestry.core.utils.Log; import forestry.core.utils.ModUtil; import forestry.farming.FarmRegistry; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.farming.logic.farmables.FarmableSapling; import forestry.farming.logic.farmables.FarmableVanillaMushroom; @@ -127,7 +128,7 @@ public class PluginNatura extends BlankForestryModule { windfall = new ItemStack[]{potashApple}; } - FarmRegistry.getInstance().registerFarmables("farmArboreal", new FarmableSapling( + FarmRegistry.getInstance().registerFarmables(ForestryFarmIdentifier.ARBOREAL, new FarmableSapling( new ItemStack(item), windfall )); @@ -153,7 +154,7 @@ public class PluginNatura extends BlankForestryModule { // block representing planted glowshroom final Block smallShroomBlock = Block.getBlockFromItem(subItem.getItem()); - FarmRegistry.getInstance().registerFarmables("farmShroom", new FarmableVanillaMushroom( + FarmRegistry.getInstance().registerFarmables(ForestryFarmIdentifier.SHROOM, new FarmableVanillaMushroom( subItem, smallShroomBlock.getStateFromMeta(subItem.getMetadata()), largeShroomBlock @@ -291,7 +292,7 @@ public class PluginNatura extends BlankForestryModule { return; } - FarmRegistry.getInstance().registerFarmables("farmCrops", + FarmRegistry.getInstance().registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop( seedItem, block, @@ -342,8 +343,8 @@ public class PluginNatura extends BlankForestryModule { @Override public void postInit() { IFarmRegistry registry = FarmRegistry.getInstance(); - IFarmProperties mushroomFarm = registry.getProperties("farmShroom"); - IFarmProperties farmArboreal = registry.getProperties("farmArboreal"); + IFarmProperties mushroomFarm = registry.getProperties(ForestryFarmIdentifier.SHROOM); + IFarmProperties farmArboreal = registry.getProperties(ForestryFarmIdentifier.ARBOREAL); if (farmArboreal != null) { farmArboreal.registerSoil(new ItemStack(Blocks.NETHERRACK), Blocks.NETHERRACK.getDefaultState()); } diff --git a/src/main/java/forestry/plugins/PluginRoots.java b/src/main/java/forestry/plugins/PluginRoots.java index 157381a9b..87e3e1ce3 100644 --- a/src/main/java/forestry/plugins/PluginRoots.java +++ b/src/main/java/forestry/plugins/PluginRoots.java @@ -12,6 +12,7 @@ import forestry.api.modules.ForestryModule; import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.fluids.Fluids; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.modules.ForestryModuleUids; @@ -57,7 +58,7 @@ public class PluginRoots extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, fruit, Fluids.JUICE.getFluid(juiceAmount)); } if (seed != null && block != null) { - farmRegistry.registerFarmables("farmCrops", new FarmableAgingCrop(seed, block, BlockCrops.AGE, 7, 0)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.CROPS, new FarmableAgingCrop(seed, block, BlockCrops.AGE, 7, 0)); } } } diff --git a/src/main/java/forestry/plugins/PluginRustic.java b/src/main/java/forestry/plugins/PluginRustic.java index 405825de7..a116018db 100644 --- a/src/main/java/forestry/plugins/PluginRustic.java +++ b/src/main/java/forestry/plugins/PluginRustic.java @@ -12,6 +12,7 @@ import forestry.api.modules.ForestryModule; import forestry.api.recipes.RecipeManagers; import forestry.core.config.Constants; import forestry.core.fluids.Fluids; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableAgingCrop; import forestry.farming.logic.farmables.FarmableRusticGrape; import forestry.farming.logic.farmables.FarmableRusticSapling; @@ -50,14 +51,14 @@ public class PluginRustic extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, grapes, Fluids.JUICE.getFluid(juiceAmount / 12)); } if (grapeLeaves != null) { - farmRegistry.registerFarmables("farmOrchard", new FarmableRusticGrape(grapeLeaves)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.ORCHARD, new FarmableRusticGrape(grapeLeaves)); } ItemStack sapling = getItemStack("sapling"); ItemStack ironBerries = getItemStack("ironberries"); ItemStack olives = getItemStack("olives"); if (sapling != null && ironBerries != null && olives != null) { - farmRegistry.registerFarmables("farmArboreal", new FarmableRusticSapling(sapling.getItem(), new ItemStack[]{ironBerries, olives})); + farmRegistry.registerFarmables(ForestryFarmIdentifier.ARBOREAL, new FarmableRusticSapling(sapling.getItem(), new ItemStack[]{ironBerries, olives})); } for (int i = 0; i < fruits.size(); i++) { @@ -72,7 +73,7 @@ public class PluginRustic extends CompatPlugin { RecipeManagers.squeezerManager.addRecipe(10, fruit, Fluids.JUICE.getFluid(juiceAmount / 25)); } if (seeds != null && block != null) { - farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(seeds, block, cropAge, 3, 2)); + farmRegistry.registerFarmables(ForestryFarmIdentifier.ORCHARD, new FarmableAgingCrop(seeds, block, cropAge, 3, 2)); } } } diff --git a/src/main/java/forestry/plugins/PluginTechReborn.java b/src/main/java/forestry/plugins/PluginTechReborn.java index 4bf2fb3a6..3ae0dbae8 100644 --- a/src/main/java/forestry/plugins/PluginTechReborn.java +++ b/src/main/java/forestry/plugins/PluginTechReborn.java @@ -33,6 +33,7 @@ import forestry.core.utils.ModUtil; import forestry.farming.FarmRegistry; import forestry.farming.circuits.CircuitFarmLogic; import forestry.farming.logic.FarmLogicRubber; +import forestry.farming.logic.ForestryFarmIdentifier; import forestry.farming.logic.farmables.FarmableSapling; import forestry.modules.ForestryModuleUids; import forestry.modules.ModuleHelper; @@ -61,7 +62,7 @@ public class PluginTechReborn extends CompatPlugin { @Override public void preInit() { - IFarmProperties rubberFarm = FarmRegistry.getInstance().registerLogic("farmRubber", FarmLogicRubber::new); + IFarmProperties rubberFarm = FarmRegistry.getInstance().registerLogic(ForestryFarmIdentifier.RUBBER, FarmLogicRubber::new); Circuits.farmRubberManual = new CircuitFarmLogic("manualRubber", rubberFarm, true); }