From 031bf3fbc3f3f15dfa5fb18b265b0bda9cd951d5 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 2 Dec 2018 23:34:37 +0100 Subject: [PATCH] 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 --- src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java b/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java index 64c20ed0..38a59184 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/AuraChunk.java @@ -59,7 +59,7 @@ public class AuraChunk implements IAuraChunk { MutableInt spot = this.getActualDrainSpot(pos, true); int curr = spot.intValue(); if (curr < 0 && curr - amount > 0) // Underflow protection - return 0; + return amount; if (aimForZero) { if (curr > 0 && curr - amount < 0) amount = curr; @@ -83,7 +83,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 0; + return amount; if (aimForZero) { if (curr < 0 && curr + amount > 0) { amount = -curr;