Mana Spreaders will no longer fire into the pool they're bound to. Closes #67

This commit is contained in:
Vasco Lavos committed 2014-05-27 10:50:30 +01:00
1 parent 4412430959
commit c211ace28b
1 file changed
+8 -6
@@ -118,12 +118,14 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
if(tileAt instanceof IManaPool) {
IManaPool pool = (IManaPool) tileAt;
int manaInPool = pool.getCurrentMana();
if(manaInPool > 0 && !isFull()) {
int manaMissing = MAX_MANA - mana;
int manaToRemove = Math.min(manaInPool, manaMissing);
pool.recieveMana(-manaToRemove);
recieveMana(manaToRemove);
if(pool != receiver) {
int manaInPool = pool.getCurrentMana();
if(manaInPool > 0 && !isFull()) {
int manaMissing = MAX_MANA - mana;
int manaToRemove = Math.min(manaInPool, manaMissing);
pool.recieveMana(-manaToRemove);
recieveMana(manaToRemove);
}
}
}