mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-12 08:17:29 +00:00
Adding Ignoble trait to Hiveacynth Princesses; Config option for rate of Pristine princesses.
This commit is contained in:
1 parent
00d01c55ad
commit
2e42dd5be3
2 files changed
+19
-8
No files matched your search
@@ -69,6 +69,7 @@ public class BotaniaHelper {
|
||||
public static double hiveacynthManaMultiplier;
|
||||
public static double hiveacynthRainResistRate;
|
||||
public static double hiveacynthPrincessSpawnRate;
|
||||
public static double hiveacynthPristineRate;
|
||||
|
||||
public static boolean isActive() {
|
||||
return isBotaniaActive;
|
||||
@@ -144,12 +145,16 @@ public class BotaniaHelper {
|
||||
hiveacynthManaMultiplier = p.getDouble();
|
||||
|
||||
p = configuration.get(section, "hiveacynthRainResistRate", 0.1);
|
||||
p.comment = "Rate at which the hiveacynth applies rain resist to spawned bees. Default: 0.1 Setting to 0 will disable.";
|
||||
p.comment = "Rate at which the Hiveacynth applies rain resist to spawned bees. Default: 0.1 Setting to 0 will disable.";
|
||||
hiveacynthRainResistRate = p.getDouble();
|
||||
|
||||
p = configuration.get(section, "hiveacynthPrincessSpawnRate", 0.09);
|
||||
p.comment = "Rate at which the Hiveacynth will spawn a Princess instead of a Drone. Default: 0.09. Setting to 0 will disable.";
|
||||
hiveacynthPrincessSpawnRate = p.getDouble();
|
||||
|
||||
p = configuration.get(section, "hiveacynthPristineRate", 0.15);
|
||||
p.comment = "Rate at which the Hiveacynth will produce a Pristine Princess, when it produces a princess. Default: 0.15. Setting to 0 will disable.";
|
||||
hiveacynthPristineRate = p.getDouble();
|
||||
}
|
||||
|
||||
public static boolean requestMana(ItemStack stack, EntityPlayer player, int manaPerDamage, int charges) {
|
||||
|
||||
@@ -33,15 +33,21 @@ public class SubTileHiveacynth extends SubTileFunctional {
|
||||
}
|
||||
|
||||
if (readyToProduceProduct()) {
|
||||
Random r = supertile.getWorldObj().rand;
|
||||
EnumBeeType beeType = EnumBeeType.DRONE;
|
||||
|
||||
if (supertile.getWorldObj().rand.nextDouble() < BotaniaHelper.hiveacynthPrincessSpawnRate) {
|
||||
IBee bee = getRandomBee(r);
|
||||
|
||||
if (r.nextDouble() < BotaniaHelper.hiveacynthPrincessSpawnRate) {
|
||||
beeType = EnumBeeType.PRINCESS;
|
||||
|
||||
if (BotaniaHelper.hiveacynthPristineRate < r.nextDouble()) {
|
||||
bee.setIsNatural(false);
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack stack = BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal());
|
||||
|
||||
ItemStack stack = BeeManager.beeRoot.getMemberStack(getRandomBee(), beeType.ordinal());
|
||||
|
||||
Random r = supertile.getWorldObj().rand;
|
||||
EntityItem entity = new EntityItem(supertile.getWorldObj(),
|
||||
supertile.xCoord - RANGE + r.nextInt(RANGE * 2 + 1), supertile.yCoord + 1, supertile.zCoord - RANGE + r.nextInt(RANGE * 2 + 1), stack);
|
||||
entity.motionX = 0;
|
||||
@@ -51,11 +57,11 @@ public class SubTileHiveacynth extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
|
||||
private IBee getRandomBee() {
|
||||
IAlleleBeeSpecies dropSpecies = BeeManager.getRandomWorldgenSpecies(supertile.getWorldObj().rand);
|
||||
private IBee getRandomBee(Random random) {
|
||||
IAlleleBeeSpecies dropSpecies = BeeManager.getRandomWorldgenSpecies(random);
|
||||
IAllele[] speciesTemplate = BeeManager.beeRoot.getTemplate(dropSpecies.getUID());
|
||||
|
||||
if (supertile.getWorldObj().rand.nextDouble() < BotaniaHelper.hiveacynthRainResistRate) {
|
||||
if (random.nextDouble() < BotaniaHelper.hiveacynthRainResistRate) {
|
||||
speciesTemplate = BeeGenomeManager.addRainResist(speciesTemplate);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user