aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/loaders/misc/GT_Bees.java
diff options
context:
space:
mode:
authorNico Spiske <64710705+Nilau1998@users.noreply.github.com>2024-09-01 14:38:40 +0200
committerGitHub <noreply@github.com>2024-09-01 14:38:40 +0200
commit148ff2956dad2377e6043173ad8b33d6acbc6ac6 (patch)
tree409cd58d3b847a0450efd8af7239b1860750e6c5 /src/main/java/gregtech/loaders/misc/GT_Bees.java
parent784fc5aaca22995a9652ca228484c1833c962db0 (diff)
downloadGT5-Unofficial-148ff2956dad2377e6043173ad8b33d6acbc6ac6.tar.gz
GT5-Unofficial-148ff2956dad2377e6043173ad8b33d6acbc6ac6.tar.bz2
GT5-Unofficial-148ff2956dad2377e6043173ad8b33d6acbc6ac6.zip
Add bee in courtesy to DaddyDiddy (#2507)
* [major] new effect, comb, flower, mutation condition * [minor] imports * Update GT_BeeDefinition.java * [minor] fancier processing * [patch] bs * Update ItemComb.java * Update SifterRecipes.java * [minor] nuked machine booster effect * Added back the effect but now with tick throttling. Right now it is set so the effect only gets triggered every 30 seconds. * SA & BS * [minor] add dynamic authority * rename comb type and bee reduce speed to super speed * update bs + sa * changed to fastest because super speed was 2x blinding (wired naming) --------- Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gregtech/loaders/misc/GT_Bees.java')
-rw-r--r--src/main/java/gregtech/loaders/misc/GT_Bees.java32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/main/java/gregtech/loaders/misc/GT_Bees.java b/src/main/java/gregtech/loaders/misc/GT_Bees.java
index 497105d75c..a8246360cf 100644
--- a/src/main/java/gregtech/loaders/misc/GT_Bees.java
+++ b/src/main/java/gregtech/loaders/misc/GT_Bees.java
@@ -4,6 +4,7 @@ import static gregtech.api.enums.Mods.Forestry;
import static gregtech.api.enums.Mods.GalaxySpace;
import static gregtech.api.enums.Mods.TwilightForest;
+import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
@@ -20,13 +21,16 @@ import forestry.api.genetics.IMutationCondition;
import forestry.core.genetics.alleles.Allele;
import forestry.core.utils.StringUtil;
import gregtech.GT_Mod;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.common.bees.GT_AlleleHelper;
import gregtech.common.items.ItemComb;
import gregtech.common.items.ItemDrop;
import gregtech.common.items.ItemPollen;
import gregtech.common.items.ItemPropolis;
import gregtech.loaders.misc.bees.GT_AlleleEffect;
+import gregtech.loaders.misc.bees.GT_EffectMachineBoost;
import gregtech.loaders.misc.bees.GT_EffectTreeTwister;
+import gregtech.loaders.misc.bees.GT_Flowers;
public class GT_Bees {
@@ -47,6 +51,7 @@ public class GT_Bees {
public static IAlleleInteger superLife;
public static IAlleleBeeEffect treetwisterEffect;
+ public static IAlleleBeeEffect machineBoostEffect;
public static ItemPropolis propolis;
public static ItemPollen pollen;
@@ -57,7 +62,7 @@ public class GT_Bees {
if (!(Forestry.isModLoaded() && GT_Mod.gregtechproxy.mGTBees)) {
return;
}
-
+ GT_Flowers.doInit();
GT_AlleleHelper.initialisation();
setupGTAlleles();
propolis = new ItemPropolis();
@@ -91,6 +96,7 @@ public class GT_Bees {
blinkLife = new AlleleInteger("lifeBlink", 2, false, EnumBeeChromosome.LIFESPAN);
superLife = new AlleleInteger("lifeEon", 600, false, EnumBeeChromosome.LIFESPAN);
+ machineBoostEffect = new GT_EffectMachineBoost();
if (GalaxySpace.isModLoaded() && TwilightForest.isModLoaded()) {
GT_Mod.GT_FML_LOGGER.info("treetwisterEffect: GalaxySpace and TwilightForest loaded, using default impl");
@@ -198,4 +204,28 @@ public class GT_Bees {
return "";
}
}
+
+ public static class ActiveGTMachineMutationCondition implements IMutationCondition {
+
+ public ActiveGTMachineMutationCondition() {
+
+ }
+
+ @Override
+ public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0,
+ IGenome genome1, IClimateProvider climate) {
+ TileEntity tileEntity = world.getTileEntity(x, y - 1, z);
+ if (tileEntity instanceof BaseMetaTileEntity machine) {
+ if (machine.isActive()) {
+ return 1;
+ }
+ }
+ return 0;
+ }
+
+ @Override
+ public String getDescription() {
+ return "Needs a running GT Machine below to breed";
+ }
+ }
}