Compare commits

...
@@ -159,7 +159,7 @@ public class TileEntityApimancersDrainerCommon extends TileEntity
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
} }
if (this.essentia.getAmount(tag) >= amount) { if (this.essentia.getAmount(tag) >= amount) {
this.essentia.reduce(tag, amount); this.essentia.remove(tag, amount);
return true; return true;
} }
return false; return false;
@@ -177,7 +177,7 @@ public class TileEntityApimancersDrainerCommon extends TileEntity
} }
if (hasIt) { if (hasIt) {
for (Aspect next : ot.aspects.keySet()) { for (Aspect next : ot.aspects.keySet()) {
essentia.reduce(next, ot.getAmount(next)); essentia.remove(next, ot.getAmount(next));
} }
return true; return true;
} }
@@ -224,12 +224,10 @@ public class TileEntityApimancersDrainerCommon extends TileEntity
if (!this.worldObj.isRemote) { if (!this.worldObj.isRemote) {
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
} }
if (amount > this.essentia.getAmount(aspect)) {
int total = this.essentia.getAmount(aspect); int total = this.essentia.getAmount(aspect);
this.essentia.reduce(aspect, total); this.essentia.remove(aspect, amount); // if amount >= total then it will also remove aspect.
return total; if (amount > total) return total;
}
this.essentia.reduce(aspect, amount);
return amount; return amount;
} }
return 0; return 0;