mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 22:59:23 +01:00
fix animal and cache recharge effects sometimes not happening if spot calculation rounded badly
This commit is contained in:
parent
007e6fe8d0
commit
16997fb8ee
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ public class AnimalEffect implements IDrainSpotEffect {
|
|||
int aura = IAuraChunk.getAuraInArea(world, pos, 30);
|
||||
if (aura < 1500000)
|
||||
return false;
|
||||
this.chance = Math.min(50, Math.abs(aura) / 500000 / IAuraChunk.getSpotAmountInArea(world, pos, 30));
|
||||
this.chance = Math.min(50, MathHelper.ceil(Math.abs(aura) / 500000F / IAuraChunk.getSpotAmountInArea(world, pos, 30)));
|
||||
if (this.chance <= 0)
|
||||
return false;
|
||||
int dist = MathHelper.clamp(Math.abs(aura) / 150000, 5, 35);
|
||||
|
|
|
@ -33,7 +33,7 @@ public class CacheRechargeEffect implements IDrainSpotEffect {
|
|||
return false;
|
||||
int dist = MathHelper.clamp(aura / 3500, 3, 15);
|
||||
this.bb = new AxisAlignedBB(pos).grow(dist);
|
||||
this.amount = aura / 250000 / IAuraChunk.getSpotAmountInArea(world, pos, 20) - 2;
|
||||
this.amount = MathHelper.ceil(aura / 250000F / IAuraChunk.getSpotAmountInArea(world, pos, 20)) - 2;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue