mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-16 01:54:42 +00:00
Breaking effect alleles and flower providers into their own namespace.
Cleaned up effect & flower provider alleles. Added basic genome template for Botanical, Blossoming, Floral bees. Added FlowerProviderBotania to grow Mystical Flowers.
This commit is contained in:
1 parent
eeb6cb356d
commit
7afda32063
23 files changed
+604
-690
No files matched your search
@@ -1,7 +1,20 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import magicbees.bees.allele.effect.AlleleEffectCrumbling;
|
||||
import magicbees.bees.allele.effect.AlleleEffectCure;
|
||||
import magicbees.bees.allele.effect.AlleleEffectPotion;
|
||||
import magicbees.bees.allele.effect.AlleleEffectSpawnMob;
|
||||
import magicbees.bees.allele.effect.AlleleEffectSpawnMobWeighted;
|
||||
import magicbees.bees.allele.effect.AlleleEffectSpawnWisp;
|
||||
import magicbees.bees.allele.effect.AlleleEffectTransmuting;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderArsMagicaFlower;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderAuraNode;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderBookshelf;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderBotania;
|
||||
import magicbees.bees.allele.flowerProvider.FlowerProviderThaumcraftFlower;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.ArsMagicaHelper;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import magicbees.main.utils.compat.ThermalExpansionHelper;
|
||||
import net.minecraft.potion.Potion;
|
||||
@@ -13,17 +26,17 @@ import forestry.api.genetics.IAlleleEffect;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.IAlleleRegistry;
|
||||
|
||||
public class Allele implements IAllele
|
||||
{
|
||||
public class Allele implements IAllele {
|
||||
public static AlleleFloat speedBlinding;
|
||||
|
||||
|
||||
public static IAlleleBeeEffect forestryBaseEffect;
|
||||
|
||||
|
||||
public static IAlleleFlowers flowerBookshelf;
|
||||
public static IAlleleFlowers flowerThaumcraft;
|
||||
public static IAlleleFlowers flowerArsMagica;
|
||||
public static IAlleleFlowers flowerAuraNode;
|
||||
|
||||
public static IAlleleFlowers flowerBotania;
|
||||
|
||||
public static IAlleleEffect effectCleansing;
|
||||
public static IAlleleEffect effectDigSpeed;
|
||||
public static IAlleleEffect effectMoveSpeed;
|
||||
@@ -32,7 +45,7 @@ public class Allele implements IAllele
|
||||
public static IAlleleEffect effectTransmuting;
|
||||
public static IAlleleEffect effectCrumbling;
|
||||
public static IAlleleEffect effectInvisibility;
|
||||
|
||||
|
||||
public static IAlleleEffect spawnBrainyZombie;
|
||||
public static IAlleleEffect spawnWisp;
|
||||
public static IAlleleEffect spawnBats;
|
||||
@@ -42,70 +55,65 @@ public class Allele implements IAllele
|
||||
public static IAlleleEffect spawnBlizz;
|
||||
public static IAlleleEffect spawnManaDrainer;
|
||||
public static IAlleleEffect spawnWispOrHecate;
|
||||
|
||||
/*public static IAlleleEffect effectNodeAttract;
|
||||
public static IAlleleEffect effectNodePurify;
|
||||
public static IAlleleEffect effectNodeFlux;
|
||||
public static IAlleleEffect effectNodeCharge;*/
|
||||
|
||||
public static void setupAdditionalAlleles()
|
||||
{
|
||||
forestryBaseEffect = (IAlleleBeeEffect)getBaseAllele("effectNone");
|
||||
|
||||
|
||||
public static void setupAdditionalAlleles() {
|
||||
forestryBaseEffect = (IAlleleBeeEffect) getBaseAllele("effectNone");
|
||||
|
||||
Allele.speedBlinding = new AlleleFloat("speedBlinding", 2f, false);
|
||||
|
||||
|
||||
Allele.flowerBookshelf = new AlleleFlower("Bookshelf", new FlowerProviderBookshelf(), true);
|
||||
|
||||
if (ThaumcraftHelper.isActive())
|
||||
{
|
||||
|
||||
if (ThaumcraftHelper.isActive()) {
|
||||
Allele.flowerThaumcraft = new AlleleFlower("ThaumcraftPlant", new FlowerProviderThaumcraftFlower(), false);
|
||||
Allele.flowerAuraNode = new AlleleFlower("AuraNode", new FlowerProviderAuraNode(), true);
|
||||
|
||||
Allele.spawnBrainyZombie = new AlleleEffectSpawnMob("Brainy", false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID)
|
||||
.setAggrosPlayerOnSpawn().setThrottle(800).setSpawnsOnPlayerNear(null).setMaxMobsInSpawnZone(2);
|
||||
.setAggrosPlayerOnSpawn()
|
||||
.setThrottle(800)
|
||||
.setSpawnsOnPlayerNear(null)
|
||||
.setMaxMobsInSpawnZone(2);
|
||||
|
||||
Allele.spawnBats = new AlleleEffectSpawnMob("Batty", false, ThaumcraftHelper.Entity.FIREBAT.entityID)
|
||||
.setThrottle(300).setSpawnsOnPlayerNear("Bat");
|
||||
.setThrottle(300)
|
||||
.setSpawnsOnPlayerNear("Bat");
|
||||
|
||||
Allele.spawnWisp = new AlleleEffectSpawnWisp("Wispy", false, ThaumcraftHelper.Entity.WISP.entityID, "thaumcraft.wisplive")
|
||||
.setThrottle(1800).setChanceToSpawn(79);
|
||||
}
|
||||
else
|
||||
{
|
||||
Allele.flowerThaumcraft = Allele.flowerAuraNode = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
|
||||
}
|
||||
|
||||
if (ArsMagicaHelper.isActive())
|
||||
{
|
||||
Allele.flowerArsMagica = new AlleleFlower("flowerArsMagicaPlant", new FlowerProviderArsMagicaFlower(), false);
|
||||
//String id, boolean isDominant, int throttle, String[] mobs, int[] chance
|
||||
Allele.spawnManaDrainer = new AlleleEffectSpawnMobWeighted("ManaDrain", true, 20,
|
||||
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" },
|
||||
new int[] { 60, 2 });
|
||||
|
||||
Allele.spawnWispOrHecate = new AlleleEffectSpawnMobWeighted("AMWisp", true, 20,
|
||||
new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" },
|
||||
new int[] { 40, 3 });
|
||||
}
|
||||
else
|
||||
{
|
||||
Allele.flowerArsMagica = (IAlleleFlowers)Allele.getBaseAllele("flowersVanilla");
|
||||
Allele.spawnManaDrainer = Allele.spawnWispOrHecate = (IAlleleEffect)Allele.getBaseAllele("effectNone");
|
||||
.setThrottle(1800)
|
||||
.setChanceToSpawn(79);
|
||||
} else {
|
||||
Allele.flowerThaumcraft = Allele.flowerAuraNode = (IAlleleFlowers) Allele.getBaseAllele("flowersVanilla");
|
||||
}
|
||||
|
||||
/*Allele.effectNodeAttract = new AlleleEffectAuraNodeAttract("NodeAttract", false, 400);
|
||||
Allele.effectNodePurify = new AlleleEffectAuraNodePurify("NodePurify", false, 600, 150);
|
||||
Allele.effectNodeFlux = new AlleleEffectAuraNodeFlux("NodeFlux", true, 300, 300);
|
||||
Allele.effectNodeCharge = new AlleleEffectAuraNodeCharge("NodeCharge", true, 1200);*/
|
||||
|
||||
if (ThermalExpansionHelper.isActive())
|
||||
{
|
||||
Allele.spawnBlizz = new AlleleEffectSpawnMob("TEBlizzy", true, ThermalExpansionHelper.Entity.BLIZZ.entityID)
|
||||
.setThrottle(100).setChanceToSpawn(80);
|
||||
if (BotaniaHelper.isActive()) {
|
||||
Allele.flowerBotania = new AlleleFlower("flowerBotania", new FlowerProviderBotania(), true);
|
||||
} else {
|
||||
Allele.flowerBotania = (IAlleleFlowers) Allele.getBaseAllele("flowersVanilla");
|
||||
}
|
||||
else
|
||||
{
|
||||
Allele.spawnBlizz = (IAlleleEffect)Allele.getBaseAllele("effectNone");
|
||||
|
||||
if (ArsMagicaHelper.isActive()) {
|
||||
Allele.flowerArsMagica = new AlleleFlower("flowerArsMagicaPlant", new FlowerProviderArsMagicaFlower(), false);
|
||||
// String id, boolean isDominant, int throttle, String[] mobs, int[]
|
||||
// chance
|
||||
Allele.spawnManaDrainer = new AlleleEffectSpawnMobWeighted("ManaDrain", true, 20,
|
||||
new String[] { ArsMagicaHelper.Name + ".MobManaCreeper", ArsMagicaHelper.Name + ".ManaVortex" },
|
||||
new int[] { 60, 2 }
|
||||
);
|
||||
|
||||
Allele.spawnWispOrHecate = new AlleleEffectSpawnMobWeighted("AMWisp", true, 20,
|
||||
new String[] { ArsMagicaHelper.Name + ".MobWisp", ArsMagicaHelper.Name + ".MobHecate" },
|
||||
new int[] { 40, 3 }
|
||||
);
|
||||
} else {
|
||||
Allele.flowerArsMagica = (IAlleleFlowers) Allele.getBaseAllele("flowersVanilla");
|
||||
Allele.spawnManaDrainer = Allele.spawnWispOrHecate = (IAlleleEffect) Allele.getBaseAllele("effectNone");
|
||||
}
|
||||
|
||||
if (ThermalExpansionHelper.isActive()) {
|
||||
Allele.spawnBlizz = new AlleleEffectSpawnMob("TEBlizzy", true, ThermalExpansionHelper.Entity.BLIZZ.entityID)
|
||||
.setThrottle(100)
|
||||
.setChanceToSpawn(80);
|
||||
} else {
|
||||
Allele.spawnBlizz = (IAlleleEffect) Allele.getBaseAllele("effectNone");
|
||||
}
|
||||
|
||||
Allele.effectCleansing = new AlleleEffectCure("Curative", false);
|
||||
@@ -113,156 +121,147 @@ public class Allele implements IAllele
|
||||
Allele.effectMoveSpeed = new AlleleEffectPotion("MoveSpeed", Potion.moveSpeed, 10, false);
|
||||
Allele.effectSlowSpeed = new AlleleEffectPotion("SlowSpeed", Potion.moveSlowdown, 3, false).setMalicious();
|
||||
Allele.effectWithering = new AlleleEffectPotion("Withering", Potion.wither, 10, false).setMalicious();
|
||||
|
||||
|
||||
Allele.effectTransmuting = new AlleleEffectTransmuting("Transmuting", true);
|
||||
Allele.effectCrumbling = new AlleleEffectCrumbling("Crumbling", true);
|
||||
|
||||
|
||||
Allele.effectInvisibility = new AlleleEffectPotion("Invisibility", Potion.invisibility, 10, false);
|
||||
|
||||
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan")
|
||||
.setThrottle(2060).setChanceToSpawn(10).setMaxMobsInSpawnZone(1);
|
||||
|
||||
Allele.spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step")
|
||||
.setThrottle(400).setChanceToSpawn(70).setMaxMobsInSpawnZone(4);
|
||||
|
||||
Allele.spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe")
|
||||
.setThrottle(800).setChanceToSpawn(60).setMaxMobsInSpawnZone(2);
|
||||
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghastly", false, "Ghast", "mob.ghast.moan").setThrottle(2060).setChanceToSpawn(10)
|
||||
.setMaxMobsInSpawnZone(1);
|
||||
|
||||
Allele.spawnSpider = new AlleleEffectSpawnMob("Spidery", false, "Spider", "mob.spider.step").setThrottle(400).setChanceToSpawn(70)
|
||||
.setMaxMobsInSpawnZone(4);
|
||||
|
||||
Allele.spawnBlaze = new AlleleEffectSpawnMob("Ablaze", false, "Blaze", "mob.blaze.breathe").setThrottle(800).setChanceToSpawn(60)
|
||||
.setMaxMobsInSpawnZone(2);
|
||||
}
|
||||
|
||||
public static void registerDeprecatedAlleleReplacements()
|
||||
{
|
||||
|
||||
public static void registerDeprecatedAlleleReplacements() {
|
||||
IAlleleRegistry registry = AlleleManager.alleleRegistry;
|
||||
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.fertilityHighDominant", Allele.getBaseAllele("fertilityHigh"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.flowerflowerBookshelf", flowerBookshelf);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speedBlinding", speedBlinding);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectCurative", effectCleansing);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectDigSpeed", effectDigSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectMoveSpeed", effectMoveSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectSlowSpeed", effectSlowSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.Ghast", spawnGhast);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.Spider", spawnSpider);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEsoteric", BeeSpecies.ESOTERIC);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMysterious", BeeSpecies.MYSTERIOUS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArcane", BeeSpecies.ARCANE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCharmed", BeeSpecies.CHARMED);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEnchanted", BeeSpecies.ENCHANTED);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSupernatural", BeeSpecies.SUPERNATURAL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPupil", BeeSpecies.PUPIL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesScholarly", BeeSpecies.SCHOLARLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSavant", BeeSpecies.SAVANT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAware", BeeSpecies.AWARE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpirit", BeeSpecies.SPIRIT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSoul", BeeSpecies.SOUL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSkulking", BeeSpecies.SKULKING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGhastly", BeeSpecies.GHASTLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpidery", BeeSpecies.SPIDERY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTimely", BeeSpecies.TIMELY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLordly", BeeSpecies.LORDLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDoctoral", BeeSpecies.DOCTORAL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIron", BeeSpecies.IRON);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGold", BeeSpecies.GOLD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCopper", BeeSpecies.COPPER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTin", BeeSpecies.TIN);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSilver", BeeSpecies.SILVER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLead", BeeSpecies.LEAD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDiamond", BeeSpecies.DIAMOND);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEmerald", BeeSpecies.EMERALD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesApatite", BeeSpecies.APATITE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStark", BeeSpecies.TC_CHAOS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAura", BeeSpecies.TC_AIR);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIgnis", BeeSpecies.TC_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAqua", BeeSpecies.TC_WATER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSolum", BeeSpecies.TC_EARTH);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPraecantatio", BeeSpecies.TC_ORDER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVis", BeeSpecies.TC_VIS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPure", BeeSpecies.TC_PURE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFlux", BeeSpecies.TC_TAINT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesNode", BeeSpecies.TC_ATTRACT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesRejuvenating", BeeSpecies.TC_REJUVENATING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBrainy", BeeSpecies.TC_BRAINY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGossamer", BeeSpecies.TC_WISPY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWispy", BeeSpecies.TC_WISPY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBatty", BeeSpecies.TC_BATTY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesChicken", BeeSpecies.TC_CHICKEN);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBeef", BeeSpecies.TC_BEEF);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPork", BeeSpecies.TC_PORK);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMinium", BeeSpecies.EE_MINIUM);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEssence", BeeSpecies.AM_ESSENCE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesQuintessence", BeeSpecies.AM_QUINTESSENCE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesErde", BeeSpecies.AM_EARTH);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLuft", BeeSpecies.AM_AIR);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFeuer", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWasser", BeeSpecies.AM_WATER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBlitz", BeeSpecies.AM_LIGHTNING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStaude", BeeSpecies.AM_PLANT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEis", BeeSpecies.AM_ICE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArkanen", BeeSpecies.AM_ARCANE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVortex", BeeSpecies.AM_VORTEX);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWight", BeeSpecies.AM_WIGHT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.fertilityHighDominant", Allele.getBaseAllele("fertilityHigh"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.flowerflowerBookshelf", flowerBookshelf);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speedBlinding", speedBlinding);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeAttract", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodePurify", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeFlux", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.effectNodeCharge", Allele.getBaseAllele("effectBeatific"));
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effectCurative", effectCleansing);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectDigSpeed", effectDigSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectMoveSpeed", effectMoveSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.effecteffectSlowSpeed", effectSlowSpeed);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.Ghast", spawnGhast);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.Spider", spawnSpider);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEsoteric", BeeSpecies.ESOTERIC);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMysterious", BeeSpecies.MYSTERIOUS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArcane", BeeSpecies.ARCANE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCharmed", BeeSpecies.CHARMED);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEnchanted", BeeSpecies.ENCHANTED);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSupernatural", BeeSpecies.SUPERNATURAL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPupil", BeeSpecies.PUPIL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesScholarly", BeeSpecies.SCHOLARLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSavant", BeeSpecies.SAVANT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAware", BeeSpecies.AWARE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpirit", BeeSpecies.SPIRIT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSoul", BeeSpecies.SOUL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSkulking", BeeSpecies.SKULKING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGhastly", BeeSpecies.GHASTLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSpidery", BeeSpecies.SPIDERY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTimely", BeeSpecies.TIMELY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLordly", BeeSpecies.LORDLY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDoctoral", BeeSpecies.DOCTORAL);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIron", BeeSpecies.IRON);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGold", BeeSpecies.GOLD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesCopper", BeeSpecies.COPPER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesTin", BeeSpecies.TIN);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSilver", BeeSpecies.SILVER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLead", BeeSpecies.LEAD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesDiamond", BeeSpecies.DIAMOND);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEmerald", BeeSpecies.EMERALD);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesApatite", BeeSpecies.APATITE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStark", BeeSpecies.TC_CHAOS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAura", BeeSpecies.TC_AIR);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesIgnis", BeeSpecies.TC_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesAqua", BeeSpecies.TC_WATER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesSolum", BeeSpecies.TC_EARTH);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPraecantatio", BeeSpecies.TC_ORDER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVis", BeeSpecies.TC_VIS);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPure", BeeSpecies.TC_PURE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFlux", BeeSpecies.TC_TAINT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesNode", BeeSpecies.TC_ATTRACT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesRejuvenating", BeeSpecies.TC_REJUVENATING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBrainy", BeeSpecies.TC_BRAINY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesGossamer", BeeSpecies.TC_WISPY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWispy", BeeSpecies.TC_WISPY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBatty", BeeSpecies.TC_BATTY);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesChicken", BeeSpecies.TC_CHICKEN);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBeef", BeeSpecies.TC_BEEF);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesPork", BeeSpecies.TC_PORK);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMinium", BeeSpecies.EE_MINIUM);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEssence", BeeSpecies.AM_ESSENCE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesQuintessence", BeeSpecies.AM_QUINTESSENCE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesErde", BeeSpecies.AM_EARTH);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesLuft", BeeSpecies.AM_AIR);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesFeuer", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWasser", BeeSpecies.AM_WATER);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBlitz", BeeSpecies.AM_LIGHTNING);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStaude", BeeSpecies.AM_PLANT);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEis", BeeSpecies.AM_ICE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("magicbees.speciesMagma", BeeSpecies.AM_FIRE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArkanen", BeeSpecies.AM_ARCANE);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVortex", BeeSpecies.AM_VORTEX);
|
||||
registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWight", BeeSpecies.AM_WIGHT);
|
||||
}
|
||||
|
||||
public static IAlleleBeeSpecies getBaseSpecies(String name)
|
||||
{
|
||||
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
|
||||
public static IAlleleBeeSpecies getBaseSpecies(String name) {
|
||||
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
|
||||
}
|
||||
|
||||
public static IAlleleBeeSpecies getExtraSpecies(String name)
|
||||
{
|
||||
return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()).toString());
|
||||
|
||||
public static IAlleleBeeSpecies getExtraSpecies(String name) {
|
||||
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase())
|
||||
.toString());
|
||||
}
|
||||
|
||||
public static IAllele getBaseAllele(String name)
|
||||
{
|
||||
|
||||
public static IAllele getBaseAllele(String name) {
|
||||
return AlleleManager.alleleRegistry.getAllele("forestry." + name);
|
||||
}
|
||||
|
||||
public static IAllele getAllele(String name)
|
||||
{
|
||||
|
||||
public static IAllele getAllele(String name) {
|
||||
return AlleleManager.alleleRegistry.getAllele(name);
|
||||
}
|
||||
|
||||
|
||||
private String uid;
|
||||
private boolean dominant;
|
||||
|
||||
public Allele(String id, boolean isDominant)
|
||||
{
|
||||
public Allele(String id, boolean isDominant) {
|
||||
this.uid = "magicbees." + id;
|
||||
this.dominant = isDominant;
|
||||
AlleleManager.alleleRegistry.registerAllele(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID()
|
||||
{
|
||||
public String getUID() {
|
||||
return this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant()
|
||||
{
|
||||
public boolean isDominant() {
|
||||
return this.dominant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
public String getName() {
|
||||
return LocalizationManager.getLocalizedString(getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName()
|
||||
{
|
||||
public String getUnlocalizedName() {
|
||||
return this.uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import magicbees.item.ItemArmorApiarist;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
|
||||
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
|
||||
{
|
||||
|
||||
private byte[] wispTypes = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 };
|
||||
|
||||
public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay)
|
||||
{
|
||||
super(id, isDominant, mobToSpawn, soundToPlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate)
|
||||
{
|
||||
boolean spawnedFlag = false;
|
||||
|
||||
EntityLiving mob;
|
||||
if (spawnAlternate && this.alternateMob != null)
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
|
||||
}
|
||||
else
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
|
||||
}
|
||||
|
||||
if (mob != null)
|
||||
{
|
||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
||||
.expand(8.0D, 4.0D, 8.0D)).size();
|
||||
|
||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||
|
||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
|
||||
{
|
||||
// Try some Reflection on TC code. This could be dangerous.
|
||||
try
|
||||
{
|
||||
Class wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName());
|
||||
Field type = wispEntity.getDeclaredField("type");
|
||||
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{ /*Last time I had a request to post error messages, I regretted it.*/ }
|
||||
|
||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||
if (this.aggosOnPlayer && player != null)
|
||||
{
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
|
||||
{
|
||||
// Protect fully suited player from initial murder intent.
|
||||
mob.setAttackTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return spawnedFlag;
|
||||
}
|
||||
}
|
||||
@@ -1297,6 +1297,7 @@ public class BeeGenomeManager {
|
||||
IAllele[] genome = getTemplateBotaniaBase();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_BOTANIC;
|
||||
genome[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = Allele.flowerBotania;
|
||||
|
||||
return genome;
|
||||
}
|
||||
@@ -1305,6 +1306,8 @@ public class BeeGenomeManager {
|
||||
IAllele[] genome = getTemplateBotBotanic();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_BLOSSOM;
|
||||
genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityMaximum");
|
||||
genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringFaster");
|
||||
|
||||
return genome;
|
||||
}
|
||||
@@ -1313,6 +1316,8 @@ public class BeeGenomeManager {
|
||||
IAllele[] genome = getTemplateBotBlossom();
|
||||
|
||||
genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.BOT_FLORAL;
|
||||
genome[EnumBeeChromosome.FERTILITY.ordinal()] = Allele.getBaseAllele("fertilityHigh");
|
||||
genome[EnumBeeChromosome.FLOWERING.ordinal()] = Allele.getBaseAllele("floweringMaximum");
|
||||
|
||||
return genome;
|
||||
}
|
||||
|
||||
@@ -453,8 +453,6 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
BOT_VAZBEE.setInactive();
|
||||
}
|
||||
|
||||
|
||||
AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBlitz", AM_LIGHTNING);
|
||||
|
||||
// Oredict bees
|
||||
if (OreDictionary.getOres("ingotCopper").size() <= 0)
|
||||
@@ -839,6 +837,20 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider
|
||||
.setGenome(BeeGenomeManager.getTemplateAMWight())
|
||||
.register();
|
||||
|
||||
BOT_BOTANIC
|
||||
.setGenome(BeeGenomeManager.getTemplateBotBotanic())
|
||||
.register();
|
||||
|
||||
BOT_BLOSSOM
|
||||
.setGenome(BeeGenomeManager.getTemplateBotBlossom())
|
||||
.register();
|
||||
|
||||
BOT_FLORAL.setGenome(BeeGenomeManager.getTemplateBotFloral())
|
||||
.register();
|
||||
|
||||
BOT_VAZBEE.setGenome(BeeGenomeManager.getTemplateBotVazbee())
|
||||
.register();
|
||||
|
||||
if (OreDictionary.getOres("ingotBronze").size() <= 0)
|
||||
{
|
||||
TE_BRONZE.setInactive();
|
||||
|
||||
+24
-36
@@ -1,7 +1,8 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -11,31 +12,25 @@ import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectCrumbling extends AlleleEffect
|
||||
{
|
||||
public class AlleleEffectCrumbling extends AlleleEffect {
|
||||
private static HashMap<ItemStack, ItemStack> crumbleMap = new HashMap<ItemStack, ItemStack>();
|
||||
|
||||
public static void addPairToMap(ItemStack source, ItemStack target)
|
||||
{
|
||||
public static void addPairToMap(ItemStack source, ItemStack target) {
|
||||
boolean add = true;
|
||||
for (ItemStack i : crumbleMap.keySet())
|
||||
{
|
||||
if (OreDictionary.itemMatches(i, source, false))
|
||||
{
|
||||
for (ItemStack i : crumbleMap.keySet()) {
|
||||
if (OreDictionary.itemMatches(i, source, false)) {
|
||||
add = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (add)
|
||||
{
|
||||
if (add) {
|
||||
crumbleMap.put(source, target);
|
||||
}
|
||||
}
|
||||
|
||||
public AlleleEffectCrumbling(String id, boolean isDominant)
|
||||
{
|
||||
|
||||
public AlleleEffectCrumbling(String id, boolean isDominant) {
|
||||
super(id, isDominant, 600);
|
||||
|
||||
|
||||
addPairToMap(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone));
|
||||
addPairToMap(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone));
|
||||
addPairToMap(new ItemStack(Blocks.stonebrick, 1, 0), new ItemStack(Blocks.stonebrick, 1, 2));
|
||||
@@ -45,47 +40,40 @@ public class AlleleEffectCrumbling extends AlleleEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData)) {
|
||||
storedData = new magicbees.bees.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
// Get random coords within territory
|
||||
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
int xRange = (int) (housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int) (housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int) (housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
|
||||
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||
int zCoord = housing.getZCoord() + world.rand.nextInt(zRange) - zRange / 2;
|
||||
|
||||
|
||||
Block block = world.getBlock(xCoord, yCoord, zCoord);
|
||||
if (block != null)
|
||||
{
|
||||
if (block != null) {
|
||||
ItemStack source = new ItemStack(block, 1, world.getBlockMetadata(xCoord, yCoord, zCoord));
|
||||
for (ItemStack key : crumbleMap.keySet())
|
||||
{
|
||||
if (OreDictionary.itemMatches(source, key, false))
|
||||
{
|
||||
for (ItemStack key : crumbleMap.keySet()) {
|
||||
if (OreDictionary.itemMatches(source, key, false)) {
|
||||
ItemStack target = crumbleMap.get(key);
|
||||
world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()),
|
||||
target.getItemDamage(), 2);
|
||||
|
||||
world.setBlock(xCoord, yCoord, zCoord, Block.getBlockFromItem(target.getItem()), target.getItemDamage(), 2);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
+13
-18
@@ -1,7 +1,9 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.EffectData;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -10,39 +12,32 @@ import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectCure extends AlleleEffect
|
||||
{
|
||||
public class AlleleEffectCure extends AlleleEffect {
|
||||
|
||||
public AlleleEffectCure(String id, boolean isDominant)
|
||||
{
|
||||
public AlleleEffectCure(String id, boolean isDominant) {
|
||||
super(id, isDominant, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null)
|
||||
{
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null) {
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
|
||||
|
||||
for (Entity e : entityList)
|
||||
{
|
||||
if (e instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer)e;
|
||||
|
||||
for (Entity e : entityList) {
|
||||
if (e instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) e;
|
||||
player.curePotionEffects(new ItemStack(Items.milk_bucket));
|
||||
}
|
||||
}
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
+20
-30
@@ -1,7 +1,9 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.EffectData;
|
||||
import magicbees.item.ItemArmorApiarist;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -11,64 +13,52 @@ import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectPotion extends AlleleEffect
|
||||
{
|
||||
public class AlleleEffectPotion extends AlleleEffect {
|
||||
private int potionId;
|
||||
private int duration;
|
||||
private boolean isMalicious;
|
||||
|
||||
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant)
|
||||
{
|
||||
|
||||
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant) {
|
||||
super(name, isDominant, 200);
|
||||
this.potionId = potionApplied.id;
|
||||
this.duration = 20 * effectDuration;
|
||||
this.isMalicious = false;
|
||||
}
|
||||
|
||||
public AlleleEffectPotion setMalicious()
|
||||
{
|
||||
|
||||
public AlleleEffectPotion setMalicious() {
|
||||
this.isMalicious = true;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null)
|
||||
{
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null) {
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
List<Entity> entityList = this.getEntitiesWithinRange(genome, housing);
|
||||
|
||||
for (Entity e : entityList)
|
||||
{
|
||||
if (e instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer)e;
|
||||
if (this.isMalicious)
|
||||
{
|
||||
|
||||
for (Entity e : entityList) {
|
||||
if (e instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) e;
|
||||
if (this.isMalicious) {
|
||||
int armorPieces = ItemArmorApiarist.getNumberPiecesWorn(player);
|
||||
int finalDuration = this.duration / 4 * (4 - armorPieces);
|
||||
if (finalDuration > 0)
|
||||
{
|
||||
if (finalDuration > 0) {
|
||||
player.addPotionEffect(new PotionEffect(this.potionId, finalDuration, 0));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
player.addPotionEffect(new PotionEffect(this.potionId, this.duration, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
|
||||
return storedData;
|
||||
}
|
||||
}
|
||||
+67
-101
@@ -1,7 +1,9 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.EffectData;
|
||||
import magicbees.item.ItemArmorApiarist;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
@@ -13,8 +15,7 @@ import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectSpawnMob extends AlleleEffect
|
||||
{
|
||||
public class AlleleEffectSpawnMob extends AlleleEffect {
|
||||
protected boolean aggosOnPlayer;
|
||||
protected boolean spawnsWhilePlayerNear;
|
||||
protected String alternateMob;
|
||||
@@ -23,13 +24,11 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
||||
protected int chanceToSpawn;
|
||||
protected int maxMobsInArea;
|
||||
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn)
|
||||
{
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn) {
|
||||
this(id, isDominant, mobToSpawn, null);
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx)
|
||||
{
|
||||
|
||||
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn, String mobSoundFx) {
|
||||
super(id, isDominant, 200);
|
||||
this.aggosOnPlayer = false;
|
||||
this.mobName = mobToSpawn;
|
||||
@@ -39,10 +38,8 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData)) {
|
||||
// Throttle; Ready to spawn
|
||||
storedData = new EffectData(1, 1, 0);
|
||||
}
|
||||
@@ -50,154 +47,123 @@ public class AlleleEffectSpawnMob extends AlleleEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
// Check if we're ready to spawn the mob.
|
||||
if (storedData.getBoolean(0))
|
||||
{
|
||||
if (storedData.getBoolean(0)) {
|
||||
World w = housing.getWorld();
|
||||
|
||||
|
||||
int roll = w.rand.nextInt(100);
|
||||
|
||||
if (roll <= this.chanceToSpawn)
|
||||
{
|
||||
if (this.spawnsWhilePlayerNear)
|
||||
{
|
||||
|
||||
if (roll <= this.chanceToSpawn) {
|
||||
if (this.spawnsWhilePlayerNear) {
|
||||
List<Entity> entities = this.getEntitiesWithinRange(genome, housing);
|
||||
EntityPlayer target = null;
|
||||
for (Entity e : entities)
|
||||
{
|
||||
if (e instanceof EntityPlayer)
|
||||
{
|
||||
target = (EntityPlayer)e;
|
||||
for (Entity e : entities) {
|
||||
if (e instanceof EntityPlayer) {
|
||||
target = (EntityPlayer) e;
|
||||
// Check for wearing armor & cancel
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(target) >= 4)
|
||||
{
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(target) >= 4) {
|
||||
// Full armor suit is treated as "invisible."
|
||||
target = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Let's spawn a mob. =D
|
||||
if (target != null)
|
||||
{
|
||||
if (target != null) {
|
||||
storedData.setBoolean(0, !this.spawnMob(genome, target, w, housing, false));
|
||||
}
|
||||
else if (this.alternateMob != null)
|
||||
{
|
||||
} else if (this.alternateMob != null) {
|
||||
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
storedData.setBoolean(0, !this.spawnMob(genome, null, w, housing, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.mobSound != null && w.rand.nextInt(100) < 35)
|
||||
{
|
||||
} else {
|
||||
if (this.mobSound != null && w.rand.nextInt(100) < 35) {
|
||||
int range = genome.getTerritory()[0];
|
||||
double x = housing.getXCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||
range = genome.getTerritory()[1];
|
||||
double y = housing.getYCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||
range = genome.getTerritory()[2];
|
||||
double z = housing.getZCoord() + w.rand.nextDouble() * (range * 2) - range;
|
||||
w.playSoundEffect(x, y, z, this.mobSound, 0.5f,
|
||||
(w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f);
|
||||
w.playSoundEffect(x, y, z, this.mobSound, 0.5f, (w.rand.nextFloat() - w.rand.nextFloat()) * 0.2f + 1.0f);
|
||||
}
|
||||
storedData.setBoolean(0, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate)
|
||||
{
|
||||
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) {
|
||||
boolean spawnedFlag = false;
|
||||
|
||||
|
||||
EntityLiving mob;
|
||||
if (spawnAlternate && this.alternateMob != null)
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.alternateMob, world);
|
||||
}
|
||||
else
|
||||
{
|
||||
mob = (EntityLiving)EntityList.createEntityByName(this.mobName, world);
|
||||
if (spawnAlternate && this.alternateMob != null) {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world);
|
||||
} else {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world);
|
||||
}
|
||||
|
||||
if (mob != null)
|
||||
{
|
||||
if (mob != null) {
|
||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int)pos[0], (int)pos[1], (int)pos[2], (int)pos[0] + 1, (int)pos[1] + 1, (int)pos[2] + 1)
|
||||
.expand(8.0D, 4.0D, 8.0D)).size();
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(
|
||||
mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int) pos[0], (int) pos[1], (int) pos[2], (int) pos[0] + 1, (int) pos[1] + 1, (int) pos[2] + 1).expand(8.0D,
|
||||
4.0D, 8.0D)).size();
|
||||
|
||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||
|
||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere())
|
||||
{
|
||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere()) {
|
||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||
if (this.aggosOnPlayer && player != null)
|
||||
{
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4)
|
||||
{
|
||||
// Protect fully suited player from initial murder intent.
|
||||
if (this.aggosOnPlayer && player != null) {
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4) {
|
||||
// Protect fully suited player from initial murder
|
||||
// intent.
|
||||
mob.setAttackTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return spawnedFlag;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn)
|
||||
{
|
||||
|
||||
public AlleleEffectSpawnMob setSpawnsOnPlayerNear(String alternateMobToSpawn) {
|
||||
this.spawnsWhilePlayerNear = true;
|
||||
this.alternateMob = alternateMobToSpawn;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setAggrosPlayerOnSpawn()
|
||||
{
|
||||
|
||||
public AlleleEffectSpawnMob setAggrosPlayerOnSpawn() {
|
||||
this.aggosOnPlayer = true;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setThrottle(int val)
|
||||
{
|
||||
public AlleleEffectSpawnMob setThrottle(int val) {
|
||||
this.throttle = val;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setChanceToSpawn(int value)
|
||||
{
|
||||
this.chanceToSpawn = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value)
|
||||
{
|
||||
this.maxMobsInArea = value;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
|
||||
{
|
||||
public AlleleEffectSpawnMob setChanceToSpawn(int value) {
|
||||
this.chanceToSpawn = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlleleEffectSpawnMob setMaxMobsInSpawnZone(int value) {
|
||||
this.maxMobsInArea = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) {
|
||||
double pos[] = new double[3];
|
||||
pos[0] = housing.getXCoord() + (world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2);
|
||||
pos[1] = housing.getYCoord() + world.rand.nextInt(3) - 1;
|
||||
+24
-37
@@ -1,5 +1,7 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import magicbees.bees.EffectData;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
@@ -8,16 +10,13 @@ import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectSpawnMobWeighted extends AlleleEffect
|
||||
{
|
||||
public class AlleleEffectSpawnMobWeighted extends AlleleEffect {
|
||||
private String[] entityNames;
|
||||
private int[] spawnChance;
|
||||
|
||||
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance)
|
||||
{
|
||||
|
||||
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance) {
|
||||
super(id, isDominant, throttle);
|
||||
if (mobs.length != chance.length)
|
||||
{
|
||||
if (mobs.length != chance.length) {
|
||||
throw new IllegalArgumentException("Array lengths must be equal!");
|
||||
}
|
||||
this.entityNames = mobs;
|
||||
@@ -25,62 +24,50 @@ public class AlleleEffectSpawnMobWeighted extends AlleleEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData)) {
|
||||
storedData = new EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
if (this.spawnMob(genome, housing))
|
||||
{
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
if (this.spawnMob(genome, housing)) {
|
||||
storedData.setInteger(0, 0);
|
||||
}
|
||||
|
||||
|
||||
return storedData;
|
||||
}
|
||||
|
||||
protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing)
|
||||
{
|
||||
|
||||
protected boolean spawnMob(IBeeGenome genome, IBeeHousing housing) {
|
||||
boolean flag = false;
|
||||
|
||||
|
||||
World w = housing.getWorld();
|
||||
int roll = 0;
|
||||
|
||||
for (int i = 0; i < this.spawnChance.length && !flag; ++i)
|
||||
{
|
||||
|
||||
for (int i = 0; i < this.spawnChance.length && !flag; ++i) {
|
||||
roll = 100 - w.rand.nextInt(100) + 1;
|
||||
if (roll < this.spawnChance[i])
|
||||
{
|
||||
if (roll < this.spawnChance[i]) {
|
||||
flag = true;
|
||||
Entity mob = EntityList.createEntityByName(this.entityNames[i], w);
|
||||
double[] coords = this.randomMobSpawnCoords(w, genome, housing);
|
||||
|
||||
|
||||
mob.setPositionAndRotation(coords[0], coords[1], coords[2], w.rand.nextFloat() * 360f, 0f);
|
||||
if (mob instanceof EntityLiving)
|
||||
{
|
||||
if (((EntityLiving)mob).getCanSpawnHere())
|
||||
{
|
||||
if (mob instanceof EntityLiving) {
|
||||
if (((EntityLiving) mob).getCanSpawnHere()) {
|
||||
w.spawnEntityInWorld(mob);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
w.spawnEntityInWorld(mob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing)
|
||||
{
|
||||
protected double[] randomMobSpawnCoords(World world, IBeeGenome bee, IBeeHousing housing) {
|
||||
double pos[] = new double[3];
|
||||
pos[0] = housing.getXCoord() + world.rand.nextDouble() * (bee.getTerritory()[0] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[0] / 2;
|
||||
pos[1] = housing.getYCoord() + world.rand.nextDouble() * (bee.getTerritory()[1] * housing.getTerritoryModifier(bee, 1f)) - bee.getTerritory()[1] / 2;
|
||||
@@ -0,0 +1,75 @@
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import magicbees.item.ItemArmorApiarist;
|
||||
import magicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
|
||||
public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob {
|
||||
|
||||
private byte[] wispTypes = {
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||
21, 23, 24, 25, 26, 27, 28, 29, 30,
|
||||
31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47
|
||||
};
|
||||
|
||||
public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn, String soundToPlay) {
|
||||
super(id, isDominant, mobToSpawn, soundToPlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean spawnMob(IBeeGenome bee, EntityPlayer player, World world, IBeeHousing housing, boolean spawnAlternate) {
|
||||
boolean spawnedFlag = false;
|
||||
|
||||
EntityLiving mob;
|
||||
if (spawnAlternate && this.alternateMob != null) {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(this.alternateMob, world);
|
||||
} else {
|
||||
mob = (EntityLiving) EntityList.createEntityByName(this.mobName, world);
|
||||
}
|
||||
|
||||
if (mob != null) {
|
||||
double pos[] = this.randomMobSpawnCoords(world, bee, housing);
|
||||
|
||||
int entitiesCount = world.getEntitiesWithinAABB(
|
||||
mob.getClass(),
|
||||
AxisAlignedBB.getBoundingBox((int) pos[0], (int) pos[1], (int) pos[2], (int) pos[0] + 1, (int) pos[1] + 1, (int) pos[2] + 1).expand(8.0D,
|
||||
4.0D, 8.0D)).size();
|
||||
|
||||
mob.setPositionAndRotation(pos[0], pos[1], pos[2], world.rand.nextFloat() * 360f, 0f);
|
||||
|
||||
if (entitiesCount < this.maxMobsInArea && mob.getCanSpawnHere()) {
|
||||
// Try some Reflection on TC code. This could be dangerous.
|
||||
try {
|
||||
Class<?> wispEntity = Class.forName(ThaumcraftHelper.Entity.WISP.getClassName());
|
||||
Field type = wispEntity.getDeclaredField("type");
|
||||
type.setByte(mob, wispTypes[world.rand.nextInt(wispTypes.length)]);
|
||||
} catch (Exception e) { /*
|
||||
* Last time I had a request to post
|
||||
* error messages, I regretted it.
|
||||
*/
|
||||
}
|
||||
|
||||
spawnedFlag = world.spawnEntityInWorld(mob);
|
||||
if (this.aggosOnPlayer && player != null) {
|
||||
if (ItemArmorApiarist.getNumberPiecesWorn(player) < 4) {
|
||||
// Protect fully suited player from initial murder
|
||||
// intent.
|
||||
mob.setAttackTarget(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return spawnedFlag;
|
||||
}
|
||||
}
|
||||
+12
-17
@@ -1,5 +1,6 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import magicbees.bees.AlleleEffect;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
@@ -7,31 +8,26 @@ import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectTransmuting extends AlleleEffect
|
||||
{
|
||||
public AlleleEffectTransmuting(String id, boolean isDominant)
|
||||
{
|
||||
public class AlleleEffectTransmuting extends AlleleEffect {
|
||||
public AlleleEffectTransmuting(String id, boolean isDominant) {
|
||||
super(id, isDominant, 200);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(IEffectData storedData)
|
||||
{
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData))
|
||||
{
|
||||
public IEffectData validateStorage(IEffectData storedData) {
|
||||
if (storedData == null || !(storedData instanceof magicbees.bees.EffectData)) {
|
||||
storedData = new magicbees.bees.EffectData(1, 0, 0);
|
||||
}
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
protected IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) {
|
||||
World world = housing.getWorld();
|
||||
// Get random coords within territory
|
||||
int xRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int)(housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
int xRange = (int) (housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[0]);
|
||||
int yRange = (int) (housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[1]);
|
||||
int zRange = (int) (housing.getTerritoryModifier(genome, 1f) * genome.getTerritory()[2]);
|
||||
|
||||
int xCoord = housing.getXCoord() + world.rand.nextInt(xRange) - xRange / 2;
|
||||
int yCoord = housing.getYCoord() + world.rand.nextInt(yRange) - yRange / 2;
|
||||
@@ -39,9 +35,8 @@ public class AlleleEffectTransmuting extends AlleleEffect
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
|
||||
TransmutationEffectController.instance.attemptTransmutations(world, biome,
|
||||
new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)),
|
||||
xCoord, yCoord, zCoord);
|
||||
|
||||
new ItemStack(world.getBlock(xCoord, yCoord, zCoord), 1, world.getBlockMetadata(xCoord, yCoord, zCoord)), xCoord, yCoord, zCoord);
|
||||
|
||||
storedData.setInteger(0, 0);
|
||||
|
||||
return storedData;
|
||||
+15
-24
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -10,39 +10,32 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class TransmutationEffectController implements ITransmutationEffectController
|
||||
{
|
||||
public class TransmutationEffectController implements ITransmutationEffectController {
|
||||
private ArrayList<ITransmutationEffectLogic> logicObjects;
|
||||
static TransmutationEffectController instance;
|
||||
|
||||
public TransmutationEffectController()
|
||||
{
|
||||
|
||||
public TransmutationEffectController() {
|
||||
logicObjects = new ArrayList<ITransmutationEffectLogic>();
|
||||
logicObjects.add(new TransmutationEffectRailcraft());
|
||||
logicObjects.add(new TransmutationEffectVanilla());
|
||||
MagicBeesAPI.transmutationEffectController = instance = this;
|
||||
}
|
||||
|
||||
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
|
||||
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean done;
|
||||
ITransmutationEffectLogic logic;
|
||||
for (int i = 0; i < logicObjects.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < logicObjects.size(); i++) {
|
||||
logic = logicObjects.get(i);
|
||||
try
|
||||
{
|
||||
try {
|
||||
done = logic.tryTransmutation(world, biome, sourceBlock, x, y, z);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
done = false;
|
||||
FMLLog.warning("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", logic.getClass().getName());
|
||||
FMLLog.warning("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", logic.getClass()
|
||||
.getName());
|
||||
FMLLog.info(e.getMessage());
|
||||
}
|
||||
|
||||
if (done)
|
||||
{
|
||||
|
||||
if (done) {
|
||||
logicObjects.remove(i);
|
||||
logicObjects.add(logic);
|
||||
break;
|
||||
@@ -51,10 +44,8 @@ public class TransmutationEffectController implements ITransmutationEffectContro
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEffectLogic(ITransmutationEffectLogic logic)
|
||||
{
|
||||
if (logic != null && !logicObjects.contains(logic))
|
||||
{
|
||||
public void addEffectLogic(ITransmutationEffectLogic logic) {
|
||||
if (logic != null && !logicObjects.contains(logic)) {
|
||||
logicObjects.add(logic);
|
||||
}
|
||||
}
|
||||
+13
-25
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -12,30 +12,22 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TransmutationEffectRailcraft implements ITransmutationEffectLogic
|
||||
{
|
||||
public class TransmutationEffectRailcraft implements ITransmutationEffectLogic {
|
||||
@Override
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false) ||
|
||||
OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false))
|
||||
{
|
||||
flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) ||
|
||||
trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z);
|
||||
if (OreDictionary.itemMatches(new ItemStack(Blocks.stone), sourceBlock, false)
|
||||
|| OreDictionary.itemMatches(new ItemStack(Blocks.cobblestone), sourceBlock, false)) {
|
||||
flag = trySpawnQuarriedStone(world, biome, sourceBlock, x, y, z) || trySpawnAbyssalStone(world, biome, sourceBlock, x, y, z);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
|
||||
private boolean trySpawnQuarriedStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) &&
|
||||
!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY))
|
||||
{
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) {
|
||||
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.quarried", 1);
|
||||
if (item != null)
|
||||
{
|
||||
if (item != null) {
|
||||
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
|
||||
flag = true;
|
||||
}
|
||||
@@ -43,15 +35,11 @@ public class TransmutationEffectRailcraft implements ITransmutationEffectLogic
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
private boolean trySpawnAbyssalStone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) &&
|
||||
!biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river"))
|
||||
{
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER) && !biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river")) {
|
||||
ItemStack item = GameRegistry.findItemStack("Railcraft", "cube.stone.abyssal", 1);
|
||||
if (item != null)
|
||||
{
|
||||
if (item != null) {
|
||||
world.setBlock(x, y, z, Block.getBlockFromItem(item.getItem()), item.getItemDamage(), 2);
|
||||
flag = true;
|
||||
}
|
||||
+5
-10
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.effect;
|
||||
|
||||
import magicbees.api.bees.ITransmutationEffectLogic;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -8,20 +8,15 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TransmutationEffectVanilla implements ITransmutationEffectLogic
|
||||
{
|
||||
public class TransmutationEffectVanilla implements ITransmutationEffectLogic {
|
||||
@Override
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
return trySpawnSandstone(world, biome, sourceBlock, x, y, z);
|
||||
}
|
||||
|
||||
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z)
|
||||
{
|
||||
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) &&
|
||||
OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false))
|
||||
{
|
||||
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY) && OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false)) {
|
||||
world.setBlock(x, y, z, Blocks.sandstone);
|
||||
flag = true;
|
||||
}
|
||||
+21
-47
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
@@ -10,67 +10,45 @@ import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderArsMagicaFlower implements IFlowerProvider
|
||||
{
|
||||
private ItemStack[] flowers = { new ItemStack(Config.amBlackOrchid), new ItemStack(Config.amDesertNova),
|
||||
new ItemStack(Config.amAum), new ItemStack(Config.amWakebloom),
|
||||
new ItemStack(Config.amTarmaRoot) };
|
||||
|
||||
public class FlowerProviderArsMagicaFlower implements IFlowerProvider {
|
||||
private ItemStack[] flowers = { new ItemStack(Config.amBlackOrchid), new ItemStack(Config.amDesertNova), new ItemStack(Config.amAum),
|
||||
new ItemStack(Config.amWakebloom), new ItemStack(Config.amTarmaRoot) };
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block == Config.amBlackOrchid || block == Config.amDesertNova ||
|
||||
block == Config.amAum || block == Config.amWakebloom ||
|
||||
block == Config.amTarmaRoot)
|
||||
{
|
||||
if (block == Config.amBlackOrchid || block == Config.amDesertNova || block == Config.amAum || block == Config.amWakebloom
|
||||
|| block == Config.amTarmaRoot) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
x = -222;
|
||||
y = 70;
|
||||
z = -51;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z))
|
||||
{
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
|
||||
{
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
|
||||
int dart = world.rand.nextInt(100);
|
||||
Block block;
|
||||
if (dart > 60)
|
||||
{
|
||||
if (dart > 60) {
|
||||
block = Config.amBlackOrchid;
|
||||
}
|
||||
else if (dart > 30)
|
||||
{
|
||||
} else if (dart > 30) {
|
||||
block = Config.amAum;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
block = Config.amTarmaRoot;
|
||||
}
|
||||
world.setBlock(x, y, z, block);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.sand)
|
||||
{
|
||||
} else if (blockDown == Blocks.sand) {
|
||||
world.setBlock(x, y, z, Config.amDesertNova);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.stone)
|
||||
{
|
||||
} else if (blockDown == Blocks.stone) {
|
||||
world.setBlock(x, y, z, Config.amTarmaRoot);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.water || blockDown == Blocks.water)
|
||||
{
|
||||
} else if (blockDown == Blocks.water || blockDown == Blocks.water) {
|
||||
world.setBlock(x, y, z, Config.amWakebloom);
|
||||
flag = true;
|
||||
}
|
||||
@@ -79,26 +57,22 @@ public class FlowerProviderArsMagicaFlower implements IFlowerProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.arsmagica");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||
{
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
public ItemStack[] getItemStacks() {
|
||||
return this.flowers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 1;
|
||||
}
|
||||
|
||||
+34
-50
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -7,94 +7,78 @@ import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderAuraNode implements IFlowerProvider
|
||||
{
|
||||
public class FlowerProviderAuraNode implements IFlowerProvider {
|
||||
protected int nodeRange = 70;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return this.isNodeWithinRange(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.node");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||
{
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
public ItemStack[] getItemStacks() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean isNodeWithinRange(World w, int x, int y, int z)
|
||||
{
|
||||
boolean nodeNearby = false;
|
||||
/*if (ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange) >= 0)
|
||||
{
|
||||
nodeNearby = true;
|
||||
}*/
|
||||
|
||||
protected boolean isNodeWithinRange(World w, int x, int y, int z) {
|
||||
boolean nodeNearby = false;
|
||||
/*
|
||||
* if (ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z,
|
||||
* this.nodeRange) >= 0) { nodeNearby = true; }
|
||||
*/
|
||||
return nodeNearby;
|
||||
}
|
||||
|
||||
/*protected AuraNode getNodeWithinRange(World w, int x, int y, int z)
|
||||
{
|
||||
AuraNode node = null;
|
||||
|
||||
int nodeId = ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z, this.nodeRange);
|
||||
if (nodeId >= 0)
|
||||
{
|
||||
node = ThaumcraftApi.getNodeCopy(nodeId);
|
||||
}
|
||||
|
||||
return node;
|
||||
}*/
|
||||
|
||||
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack)
|
||||
{
|
||||
for (ItemStack stack : products)
|
||||
{
|
||||
if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage())
|
||||
{
|
||||
if (stack.stackSize < stack.getItem().getItemStackLimit(stack))
|
||||
{
|
||||
/*
|
||||
* protected AuraNode getNodeWithinRange(World w, int x, int y, int z) {
|
||||
* AuraNode node = null;
|
||||
*
|
||||
* int nodeId = ThaumcraftApi.getClosestAuraWithinRange(w, x, y, z,
|
||||
* this.nodeRange); if (nodeId >= 0) { node =
|
||||
* ThaumcraftApi.getNodeCopy(nodeId); }
|
||||
*
|
||||
* return node; }
|
||||
*/
|
||||
|
||||
protected ItemStack[] addItemToProducts(ItemStack[] products, ItemStack itemStack) {
|
||||
for (ItemStack stack : products) {
|
||||
if (stack.getItem() == itemStack.getItem() && stack.getItemDamage() == itemStack.getItemDamage()) {
|
||||
if (stack.stackSize < stack.getItem().getItemStackLimit(stack)) {
|
||||
stack.stackSize += itemStack.stackSize;
|
||||
itemStack.stackSize = Math.max(stack.stackSize - stack.getItem().getItemStackLimit(stack), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemStack.stackSize > 0)
|
||||
{
|
||||
if (itemStack.stackSize > 0) {
|
||||
ItemStack[] newProducts = new ItemStack[products.length + 1];
|
||||
for (int i = 0; i < products.length; ++i)
|
||||
{
|
||||
for (int i = 0; i < products.length; ++i) {
|
||||
newProducts[i] = products[i];
|
||||
}
|
||||
newProducts[products.length] = itemStack;
|
||||
products = newProducts;
|
||||
}
|
||||
|
||||
|
||||
return products;
|
||||
}
|
||||
|
||||
+10
-18
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
@@ -11,45 +11,37 @@ import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderBookshelf implements IFlowerProvider
|
||||
{
|
||||
public class FlowerProviderBookshelf implements IFlowerProvider {
|
||||
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int i, int j)
|
||||
{
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int i, int j) {
|
||||
boolean flag = false;
|
||||
if (world.getBlock(x, i, j) == Blocks.bookshelf)
|
||||
{
|
||||
if (world.getBlock(x, i, j) == Blocks.bookshelf) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int i, int j)
|
||||
{
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int i, int j) {
|
||||
// Always return true so the system thinks we grew a flower.
|
||||
// Bees can't grow bookshelves! Are you crazy?!
|
||||
// Bees can't grow bookshelves! Are you crazy?!
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[])
|
||||
{
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[]) {
|
||||
return products;
|
||||
}
|
||||
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
public ItemStack[] getItemStacks() {
|
||||
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
||||
return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water);
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.book");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import magicbees.main.utils.compat.BotaniaHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderBotania implements IFlowerProvider {
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual individual, int x, int y, int z) {
|
||||
if (world.isAirBlock(x, y, z) && BotaniaHelper.blockMysticalFlower.canPlaceBlockAt(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, BotaniaHelper.blockMysticalFlower);
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.rand.nextInt(16), 2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacks() {
|
||||
return BotaniaHelper.mysticalFlowerVariants;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.botania");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z) {
|
||||
return world.getBlock(x, y, z) == BotaniaHelper.blockMysticalFlower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 0;
|
||||
}
|
||||
}
|
||||
+13
-26
@@ -1,4 +1,4 @@
|
||||
package magicbees.bees;
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import magicbees.main.Config;
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
@@ -11,19 +11,15 @@ import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderThaumcraftFlower implements IFlowerProvider
|
||||
{
|
||||
public class FlowerProviderThaumcraftFlower implements IFlowerProvider {
|
||||
private ItemStack[] flowers = { new ItemStack(Config.tcPlant, 1, 2), new ItemStack(Config.tcPlant, 1, 3) };
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
if (world.getBlock(x, y, z) == Config.tcPlant)
|
||||
{
|
||||
if (world.getBlock(x, y, z) == Config.tcPlant) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 2 || meta == 3)
|
||||
{
|
||||
if (meta == 2 || meta == 3) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
@@ -31,19 +27,14 @@ public class FlowerProviderThaumcraftFlower implements IFlowerProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z)
|
||||
{
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int y, int z) {
|
||||
boolean flag = false;
|
||||
Block blockDown = world.getBlock(x, y - 1, z);
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z))
|
||||
{
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass)
|
||||
{
|
||||
if (world.getBlock(x, y, z).isAir(world, x, y, z)) {
|
||||
if (blockDown == Blocks.dirt || blockDown == Blocks.grass) {
|
||||
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal(), 2);
|
||||
flag = true;
|
||||
}
|
||||
else if (blockDown == Blocks.sand)
|
||||
{
|
||||
} else if (blockDown == Blocks.sand) {
|
||||
world.setBlock(x, y, z, Config.tcPlant, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal(), 2);
|
||||
flag = true;
|
||||
}
|
||||
@@ -52,26 +43,22 @@ public class FlowerProviderThaumcraftFlower implements IFlowerProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
public String getDescription() {
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.magic");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products)
|
||||
{
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int y, int z, ItemStack[] products) {
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
public ItemStack[] getItemStacks() {
|
||||
return this.flowers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
return pollinatable.getPlantType().size() > 1;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package magicbees.main;
|
||||
|
||||
import magicbees.bees.BeeManager;
|
||||
import magicbees.bees.TransmutationEffectController;
|
||||
import magicbees.bees.allele.effect.TransmutationEffectController;
|
||||
import magicbees.client.gui.GUIHandler;
|
||||
import magicbees.main.utils.CraftingManager;
|
||||
import magicbees.main.utils.IMCManager;
|
||||
|
||||
@@ -3,7 +3,7 @@ package magicbees.main.utils;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import magicbees.bees.AlleleEffectCrumbling;
|
||||
import magicbees.bees.allele.effect.AlleleEffectCrumbling;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -49,6 +49,7 @@ public class BotaniaHelper {
|
||||
;
|
||||
}
|
||||
|
||||
public static Block blockMysticalFlower;
|
||||
public static Block blockLivingRock;
|
||||
public static Block blockLivingWood;
|
||||
|
||||
@@ -56,6 +57,8 @@ public class BotaniaHelper {
|
||||
public static Item itemManaPetal;
|
||||
public static Item itemManaResource;
|
||||
|
||||
public static ItemStack[] mysticalFlowerVariants;
|
||||
|
||||
public static IRecipe manasteelGrafterRecipe;
|
||||
public static IRecipe manasteelScoopRecipe;
|
||||
|
||||
@@ -111,8 +114,15 @@ public class BotaniaHelper {
|
||||
}
|
||||
|
||||
public static void getBlocks() {
|
||||
blockMysticalFlower = BlockInterface.getBlock(Name, "flower");
|
||||
blockLivingRock = BlockInterface.getBlock(Name, "livingrock");
|
||||
blockLivingWood = BlockInterface.getBlock(Name, "livingwood");
|
||||
|
||||
// Generate 16-colour flowers.
|
||||
mysticalFlowerVariants = new ItemStack[16];
|
||||
for (int i = 0; i < 16; i++) {
|
||||
mysticalFlowerVariants[i] = new ItemStack(blockMysticalFlower, 1, i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void getItems() {
|
||||
|
||||
@@ -413,6 +413,14 @@ magicbees.speciesBMBloody=Bloody
|
||||
magicbees.speciesBMBloody.description=....|Apinomicon
|
||||
magicbees.speciesBMBound=Bound
|
||||
magicbees.speciesBMBound.description=....|Apinomicon
|
||||
magicbees.speciesBotBotanic=Botanic
|
||||
magicbees.speciesBotBotanic.description=
|
||||
magicbees.speciesBotBlossom=Blossom
|
||||
magicbees.speciesBotBlossom.description=
|
||||
magicbees.speciesBotFloral=Floral
|
||||
magicbees.speciesBotFloral.description=
|
||||
magicbees.speciesBotVazbee=Vazbee
|
||||
magicbees.speciesBotVazbee.description=
|
||||
magicbees.species=
|
||||
magicbees.species.description=
|
||||
magicbees.speedBlinding=Blinding
|
||||
@@ -437,10 +445,13 @@ magicbees.effectAblaze=Ablaze
|
||||
magicbees.effectManaDrainer=Vortex
|
||||
magicbees.effectAMWisp=Spiritual
|
||||
magicbees.effectTEBlizzy=Blizzy
|
||||
|
||||
flowerProvider.book=Books
|
||||
flowerProvider.magic=Thaumic Flowers
|
||||
flowerProvider.arsmagica=Exotic Flowers
|
||||
flowerProvider.node=Node
|
||||
flowerProvider.botania=Mystical Flowers
|
||||
|
||||
classification.veiled=Veiled
|
||||
classification.veiled.description=The curious species found scattered through the world may have abilities beyond one's reasoning.|Apinomicon
|
||||
classification.arcane=Arcane
|
||||
|
||||
Reference in new issue
Block a user