mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 06:24:54 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ce571f464 |
@@ -227,8 +227,7 @@ public class TileEntityApimancersDrainerCommon extends TileEntity
|
||||
|
||||
int total = this.essentia.getAmount(aspect);
|
||||
this.essentia.remove(aspect, amount); // if amount >= total then it will also remove aspect.
|
||||
if (amount > total) return total;
|
||||
return amount;
|
||||
return Math.min(amount, total);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -287,6 +286,9 @@ public class TileEntityApimancersDrainerCommon extends TileEntity
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
super.readFromNBT(compound);
|
||||
this.essentia.readFromNBT(compound);
|
||||
for (Aspect aspect : this.essentia.getAspects()) {
|
||||
if (this.essentia.getAmount(aspect) <= 0) this.essentia.remove(aspect);
|
||||
}
|
||||
if (this.essentia.visSize() > this.maxAmount) {
|
||||
this.essentia = new AspectList();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user