mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 14:34:44 +00:00
Updating to Forestry 2.2.8.0
fixing some shit.
This commit is contained in:
1 parent
c3210c0883
commit
e20ab2dfb9
25 files changed
+211
-208
No files matched your search
@@ -11,14 +11,12 @@ import forestry.api.genetics.IEffectData;
|
||||
|
||||
public class AlleleEffectSpawnMobWeighted extends AlleleEffect
|
||||
{
|
||||
private int throttle;
|
||||
private String[] entityNames;
|
||||
private int[] spawnChance;
|
||||
|
||||
public AlleleEffectSpawnMobWeighted(String id, boolean isDominant, int throttle, String[] mobs, int[] chance)
|
||||
{
|
||||
super(id, isDominant);
|
||||
this.throttle = throttle;
|
||||
super(id, isDominant, throttle);
|
||||
if (mobs.length != chance.length)
|
||||
{
|
||||
throw new IllegalArgumentException("Array lengths must be equal!");
|
||||
@@ -38,20 +36,11 @@ public class AlleleEffectSpawnMobWeighted extends AlleleEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
public IEffectData doEffectThrottled(IBeeGenome genome, IEffectData storedData, IBeeHousing housing)
|
||||
{
|
||||
int value = storedData.getInteger(0);
|
||||
|
||||
if (value >= this.throttle)
|
||||
if (this.spawnMob(genome, housing))
|
||||
{
|
||||
if (this.spawnMob(genome, housing))
|
||||
{
|
||||
storedData.setInteger(0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
storedData.setInteger(0, value + 1);
|
||||
storedData.setInteger(0, 0);
|
||||
}
|
||||
|
||||
return storedData;
|
||||
|
||||
Reference in new issue
Block a user