From 656a76980bea76070fb00f4517d1d9076908f11e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 3 Dec 2018 14:40:53 +0100 Subject: [PATCH] make over- and underflow create another spot --- src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java b/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java index ef6a3236..67996874 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java @@ -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;