Fixed Induction Matrix not outputting properly

This commit is contained in:
Aidan C. Brady 2015-03-24 21:43:22 -04:00
parent 0e51852baa
commit f9070f33d0
4 changed files with 12 additions and 16 deletions

View file

@ -52,17 +52,14 @@ public class SynchronizedMatrixData extends SynchronizedData<SynchronizedMatrixD
{
for(Coord4D coord : cells)
{
if(energy <= 0)
{
return;
}
TileEntity tile = coord.getTileEntity(world);
if(tile instanceof TileEntityInductionCell)
{
TileEntityInductionCell cell = (TileEntityInductionCell)tile;
cell.setEnergy(0);
double toAdd = Math.min(cell.getMaxEnergy(), energy);
cell.setEnergy(toAdd);
energy -= toAdd;

View file

@ -8,7 +8,6 @@ import java.util.Set;
import mekanism.api.Coord4D;
import mekanism.common.tile.TileEntityMultiblock;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;

View file

@ -92,6 +92,7 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
if(structure.fluidStored != null && structure.fluidStored.amount <= 0)
{
structure.fluidStored = null;
markDirty();
}
manageInventory();

View file

@ -79,6 +79,15 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
{
EnumSet set = EnumSet.allOf(ForgeDirection.class);
set.remove(ForgeDirection.UNKNOWN);
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
if(structure.locations.contains(Coord4D.get(this).getFromSide(side)))
{
set.remove(side);
}
}
return set;
}
@ -215,16 +224,6 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
nbtTags.setBoolean("mode", mode);
}
/**
* Gets the scaled energy level for the GUI.
* @param i - multiplier
* @return scaled energy
*/
public int getScaledEnergyLevel(int i)
{
return (int)(getEnergy()*i / getMaxEnergy());
}
@Override
@Method(modid = "CoFHCore")
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate)