From 148ff2956dad2377e6043173ad8b33d6acbc6ac6 Mon Sep 17 00:00:00 2001 From: Nico Spiske <64710705+Nilau1998@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:38:40 +0200 Subject: 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 Co-authored-by: boubou19 --- src/main/java/gregtech/loaders/misc/GT_Bees.java | 32 +++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/main/java/gregtech/loaders/misc/GT_Bees.java') 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"; + } + } } -- cgit