boolean redstone = false;
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
if(tileAt instanceof IManaPool) {
IManaPool pool = (IManaPool) tileAt;
if(pool != receiver) {
if(pool instanceof IKeyLocked && !((IKeyLocked) pool).getOutputKey().equals(getInputKey()))
continue;
int manaInPool = pool.getCurrentMana();
if(manaInPool > 0 && !isFull()) {
int manaMissing = getMaxMana() - mana;
int manaToRemove = Math.min(manaInPool, manaMissing);
pool.recieveMana(-manaToRemove);
recieveMana(manaToRemove);
}
}
}