From 045a3a9ccd90ee65a29a344d2a17341efb7751a5 Mon Sep 17 00:00:00 2001 From: mezz Date: Tue, 11 Aug 2015 23:09:51 -0700 Subject: [PATCH] Fix #743 Add config option for pollination on Vanilla trees --- lang | 2 +- src/main/java/forestry/core/config/Config.java | 4 +++- src/main/java/forestry/core/utils/GeneticsUtil.java | 11 +++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lang b/lang index 5f63e97bb..c7d8010d7 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 5f63e97bb8093cd9bad5a20c6fc814d447ba9a8d +Subproject commit c7d8010d75ba787d643e4c783748925a7dba7f99 diff --git a/src/main/java/forestry/core/config/Config.java b/src/main/java/forestry/core/config/Config.java index 413cb35f2..874bbd591 100755 --- a/src/main/java/forestry/core/config/Config.java +++ b/src/main/java/forestry/core/config/Config.java @@ -57,6 +57,7 @@ public class Config { // Genetics public static boolean clearInvalidChromosomes = false; + public static boolean pollinateVanillaTrees = true; public static float researchMutationBoostMultiplier = 1.5f; public static float maxResearchMutationBoostPercent = 5.0f; @@ -177,7 +178,7 @@ public class Config { private static void loadNewConfigCommon(File configFileCommon) { - configCommon = new LocalizedConfiguration(configFileCommon, "1.0.0"); + configCommon = new LocalizedConfiguration(configFileCommon, "1.1.0"); gameMode = configCommon.getStringLocalized("difficulty", "game.mode", "EASY", new String[]{"OP, EASY, NORMAL, HARD"}); @@ -243,6 +244,7 @@ public class Config { } clearInvalidChromosomes = configCommon.getBooleanLocalized("genetics", "clear.invalid.chromosomes", clearInvalidChromosomes); + pollinateVanillaTrees = configCommon.getBooleanLocalized("genetics", "pollinate.vanilla.trees", pollinateVanillaTrees); researchMutationBoostMultiplier = configCommon.getFloatLocalized("genetics.research.boost", "multiplier", researchMutationBoostMultiplier, 1.0f, 1000.f); maxResearchMutationBoostPercent = configCommon.getFloatLocalized("genetics.research.boost", "max.percent", maxResearchMutationBoostPercent, 0.0f, 100.0f); diff --git a/src/main/java/forestry/core/utils/GeneticsUtil.java b/src/main/java/forestry/core/utils/GeneticsUtil.java index 6d631ee61..ef6cc3e72 100644 --- a/src/main/java/forestry/core/utils/GeneticsUtil.java +++ b/src/main/java/forestry/core/utils/GeneticsUtil.java @@ -39,6 +39,7 @@ import forestry.api.lepidopterology.IButterflyNursery; import forestry.arboriculture.genetics.CheckPollinatable; import forestry.arboriculture.genetics.CheckPollinatableTree; import forestry.arboriculture.genetics.ICheckPollinatable; +import forestry.core.config.Config; import forestry.core.genetics.ItemGE; public class GeneticsUtil { @@ -118,10 +119,12 @@ public class GeneticsUtil { return (IPollinatable) tile; } - ITree pollen = getErsatzPollen(world, x, y, z); - if (pollen != null) { - pollen.setLeaves(world, owner, x, y, z); - return (IPollinatable) world.getTileEntity(x, y, z); + if (Config.pollinateVanillaTrees) { + ITree pollen = getErsatzPollen(world, x, y, z); + if (pollen != null) { + pollen.setLeaves(world, owner, x, y, z); + return (IPollinatable) world.getTileEntity(x, y, z); + } } return null;