mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
if we return 0 here then a lot of unrelated problems will be caused, so this is the easiest fix as this scenario is highly unlikely anyway
This commit is contained in:
parent
c571c95fec
commit
031bf3fbc3
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ public class AuraChunk implements IAuraChunk {
|
||||||
MutableInt spot = this.getActualDrainSpot(pos, true);
|
MutableInt spot = this.getActualDrainSpot(pos, true);
|
||||||
int curr = spot.intValue();
|
int curr = spot.intValue();
|
||||||
if (curr < 0 && curr - amount > 0) // Underflow protection
|
if (curr < 0 && curr - amount > 0) // Underflow protection
|
||||||
return 0;
|
return amount;
|
||||||
if (aimForZero) {
|
if (aimForZero) {
|
||||||
if (curr > 0 && curr - amount < 0)
|
if (curr > 0 && curr - amount < 0)
|
||||||
amount = curr;
|
amount = curr;
|
||||||
|
@ -83,7 +83,7 @@ public class AuraChunk implements IAuraChunk {
|
||||||
MutableInt spot = this.getActualDrainSpot(pos, true);
|
MutableInt spot = this.getActualDrainSpot(pos, true);
|
||||||
int curr = spot.intValue();
|
int curr = spot.intValue();
|
||||||
if (curr > 0 && curr + amount < 0) // Overflow protection
|
if (curr > 0 && curr + amount < 0) // Overflow protection
|
||||||
return 0;
|
return amount;
|
||||||
if (aimForZero) {
|
if (aimForZero) {
|
||||||
if (curr < 0 && curr + amount > 0) {
|
if (curr < 0 && curr + amount > 0) {
|
||||||
amount = -curr;
|
amount = -curr;
|
||||||
|
|
Loading…
Reference in a new issue