mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 21:19:46 +00:00
Fix mana pump voiding mana taken from a cart when the receiving pool is full
This commit is contained in:
1 parent
dcc55ebd83
commit
16bb4a8902
1 file changed
+5
-3
@@ -101,7 +101,7 @@ public class EntityPoolMinecart extends EntityMinecart {
|
||||
int transfer = Math.min(TRANSFER_RATE, poolMana);
|
||||
int actualTransfer = Math.min(TilePool.MAX_MANA - cartMana, transfer);
|
||||
if(actualTransfer > 0) {
|
||||
pool.recieveMana(-transfer);
|
||||
pool.recieveMana(-actualTransfer);
|
||||
setMana(cartMana + actualTransfer);
|
||||
did = true;
|
||||
}
|
||||
@@ -109,10 +109,12 @@ public class EntityPoolMinecart extends EntityMinecart {
|
||||
can = true;
|
||||
if(!pool.isFull()) {
|
||||
int cartMana = getMana();
|
||||
int poolMana = pool.getCurrentMana();
|
||||
int transfer = Math.min(TRANSFER_RATE, cartMana);
|
||||
int actualTransfer = Math.min(TilePool.MAX_MANA - poolMana, transfer);
|
||||
if(transfer > 0) {
|
||||
pool.recieveMana(transfer);
|
||||
setMana(cartMana - transfer);
|
||||
pool.recieveMana(actualTransfer);
|
||||
setMana(cartMana - actualTransfer);
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user