aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/bees/GT_Bee_Mutation.java
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-08-14 15:50:44 +0200
committerGitHub <noreply@github.com>2021-08-14 15:50:44 +0200
commitb8e7bce3d1730db515b98129aeaf113b7a089f79 (patch)
tree36bbc4537e72370b7055baa30fd4042d3c4c8519 /src/main/java/gregtech/common/bees/GT_Bee_Mutation.java
parent5451998388b35d89d3496ae3e16694983a31f6cb (diff)
parent3ade6e9c5669fc03edb83b8ac28d73a86da9d3c7 (diff)
downloadGT5-Unofficial-b8e7bce3d1730db515b98129aeaf113b7a089f79.tar.gz
GT5-Unofficial-b8e7bce3d1730db515b98129aeaf113b7a089f79.tar.bz2
GT5-Unofficial-b8e7bce3d1730db515b98129aeaf113b7a089f79.zip
Merge pull request #639 from D-Cysteine/fix-bee-mutations
Update bee mutations to handle modified climate
Diffstat (limited to 'src/main/java/gregtech/common/bees/GT_Bee_Mutation.java')
-rw-r--r--src/main/java/gregtech/common/bees/GT_Bee_Mutation.java7
1 files changed, 4 insertions, 3 deletions
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<IMutationCondition> 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;
}