mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 11:53:29 +01:00
make over- and underflow create another spot
This commit is contained in:
parent
5fcd096a99
commit
656a76980b
1 changed files with 4 additions and 3 deletions
|
@ -61,8 +61,9 @@ public class AuraChunk implements IAuraChunk {
|
|||
return 0;
|
||||
MutableInt spot = this.getActualDrainSpot(pos, true);
|
||||
int curr = spot.intValue();
|
||||
if (curr < 0 && curr - amount > 0) // Underflow protection
|
||||
return amount;
|
||||
if (curr < 0 && curr - amount > 0) { // Underflow protection
|
||||
return this.drainAura(pos.up(), amount, aimForZero, simulate);
|
||||
}
|
||||
if (aimForZero) {
|
||||
if (curr > 0 && curr - amount < 0)
|
||||
amount = curr;
|
||||
|
@ -88,7 +89,7 @@ public class AuraChunk implements IAuraChunk {
|
|||
MutableInt spot = this.getActualDrainSpot(pos, true);
|
||||
int curr = spot.intValue();
|
||||
if (curr > 0 && curr + amount < 0) // Overflow protection
|
||||
return amount;
|
||||
return this.storeAura(pos.up(), amount, aimForZero, simulate);
|
||||
if (aimForZero) {
|
||||
if (curr < 0 && curr + amount > 0) {
|
||||
amount = -curr;
|
||||
|
|
Loading…
Reference in a new issue