From bddb7a81cc3a8da321dcbd58b3247ceb9cbdf1e2 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Wed, 11 Aug 2021 23:42:52 -0600 Subject: Update bee mutations to handle modified climate --- src/main/java/gregtech/common/bees/GT_Bee_Mutation.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech') diff --git a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java index b088f724f5..a4a162ddae 100644 --- a/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java +++ b/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java @@ -1,6 +1,7 @@ package gregtech.common.bees; import forestry.api.apiculture.*; +import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; @@ -37,7 +38,7 @@ public class GT_Bee_Mutation extends BeeMutation { int y = housingCoordinates != null ? housingCoordinates.posY : 0; int z = housingCoordinates != null ? housingCoordinates.posZ : 0; - float processedChance = getBasicChance(world, x, y, z, allele0, allele1, genome0, genome1); + float processedChance = getBasicChance(world, x, y, z, allele0, allele1, genome0, genome1, housing); if (processedChance <= 0f) { return 0f; @@ -53,7 +54,7 @@ public class GT_Bee_Mutation extends BeeMutation { } @SuppressWarnings("unchecked") - private float getBasicChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) { + private float getBasicChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) { float mutationChance = this.getBaseChance(); List mutationConditions = null; Field f = FieldUtils.getDeclaredField(Mutation.class, "mutationConditions", true); @@ -69,7 +70,7 @@ public class GT_Bee_Mutation extends BeeMutation { if (mutationConditions != null) for (IMutationCondition mutationCondition : mutationConditions) { - mutationChance *= mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1); + mutationChance *= mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1, climate); if (mutationChance == 0) { return 0; } -- cgit From c3d45e1c7d595c40b3647ed743633fd30126142d Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:16:41 -0600 Subject: Fix some overlooked overrides --- src/main/java/gregtech/loaders/misc/GT_Bees.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech') diff --git a/src/main/java/gregtech/loaders/misc/GT_Bees.java b/src/main/java/gregtech/loaders/misc/GT_Bees.java index 0e08ac3de6..a6b8399cb6 100644 --- a/src/main/java/gregtech/loaders/misc/GT_Bees.java +++ b/src/main/java/gregtech/loaders/misc/GT_Bees.java @@ -2,6 +2,7 @@ package gregtech.loaders.misc; import cpw.mods.fml.common.Loader; import forestry.api.apiculture.EnumBeeChromosome; +import forestry.api.core.IClimateProvider; import forestry.api.genetics.*; import forestry.core.genetics.alleles.Allele; import forestry.core.utils.StringUtil; @@ -133,7 +134,7 @@ public class GT_Bees { } @Override - public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0,IGenome genome1) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) { if(world.provider.dimensionId == dimID)return 1; return 0; } @@ -156,8 +157,8 @@ public class GT_Bees { } @Override - public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0,IGenome genome1) { - if(world.getBiomeGenForCoords(x, z).biomeID == biomeID) return 1; + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0,IGenome genome1, IClimateProvider climate) { + if(climate.getBiome().biomeID == biomeID) return 1; return 0; } -- cgit From 3ade6e9c5669fc03edb83b8ac28d73a86da9d3c7 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Thu, 12 Aug 2021 15:33:58 -0600 Subject: Add a space --- src/main/java/gregtech/loaders/misc/GT_Bees.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech') diff --git a/src/main/java/gregtech/loaders/misc/GT_Bees.java b/src/main/java/gregtech/loaders/misc/GT_Bees.java index a6b8399cb6..1d8441e4d6 100644 --- a/src/main/java/gregtech/loaders/misc/GT_Bees.java +++ b/src/main/java/gregtech/loaders/misc/GT_Bees.java @@ -157,7 +157,7 @@ public class GT_Bees { } @Override - public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0,IGenome genome1, IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) { if(climate.getBiome().biomeID == biomeID) return 1; return 0; } -- cgit