Fixed pump
This commit is contained in:
parent
1d084e6301
commit
99578a289f
2 changed files with 10 additions and 10 deletions
|
@ -33,7 +33,6 @@ public class TileEntityMinorPump extends TileEntityElectricityRunnable implement
|
||||||
{
|
{
|
||||||
public final double WATTS_PER_TICK = (400 / 20);
|
public final double WATTS_PER_TICK = (400 / 20);
|
||||||
double percentPumped = 0.0;
|
double percentPumped = 0.0;
|
||||||
double joulesReceived = 0;
|
|
||||||
|
|
||||||
int disableTimer = 0;
|
int disableTimer = 0;
|
||||||
public int pos = 0;
|
public int pos = 0;
|
||||||
|
@ -68,9 +67,9 @@ public class TileEntityMinorPump extends TileEntityElectricityRunnable implement
|
||||||
|
|
||||||
if (!this.worldObj.isRemote && !this.isDisabled())
|
if (!this.worldObj.isRemote && !this.isDisabled())
|
||||||
{
|
{
|
||||||
if (this.canPump(xCoord, yCoord - 1, zCoord) && this.joulesReceived >= this.WATTS_PER_TICK)
|
if (this.canPump(xCoord, yCoord - 1, zCoord) && this.wattsReceived >= this.WATTS_PER_TICK)
|
||||||
{
|
{
|
||||||
joulesReceived -= this.WATTS_PER_TICK;
|
wattsReceived -= this.WATTS_PER_TICK;
|
||||||
|
|
||||||
if (percentPumped++ >= 10)
|
if (percentPumped++ >= 10)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +86,7 @@ public class TileEntityMinorPump extends TileEntityElectricityRunnable implement
|
||||||
if (this.ticks % 10 == 0)
|
if (this.ticks % 10 == 0)
|
||||||
{
|
{
|
||||||
// TODO fix this to tell the client its running
|
// TODO fix this to tell the client its running
|
||||||
Packet packet = PacketManager.getPacket(FluidMech.CHANNEL, this, color.ordinal(), this.joulesReceived);
|
Packet packet = PacketManager.getPacket(FluidMech.CHANNEL, this, color.ordinal(), this.wattsReceived);
|
||||||
PacketManager.sendPacketToClients(packet, worldObj, new Vector3(this), 60);
|
PacketManager.sendPacketToClients(packet, worldObj, new Vector3(this), 60);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,7 +99,7 @@ public class TileEntityMinorPump extends TileEntityElectricityRunnable implement
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.color = ColorCode.get(data.readInt());
|
this.color = ColorCode.get(data.readInt());
|
||||||
this.joulesReceived = data.readDouble();
|
this.wattsReceived = data.readDouble();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -203,7 +202,7 @@ public class TileEntityMinorPump extends TileEntityElectricityRunnable implement
|
||||||
@Override
|
@Override
|
||||||
public String getMeterReading(EntityPlayer user, ForgeDirection side)
|
public String getMeterReading(EntityPlayer user, ForgeDirection side)
|
||||||
{
|
{
|
||||||
return this.joulesReceived + "/" + this.WATTS_PER_TICK + " " + this.percentPumped;
|
return this.wattsReceived + "/" + this.WATTS_PER_TICK + " " + this.percentPumped;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -97,14 +97,15 @@ public enum ColorCode
|
||||||
*/
|
*/
|
||||||
public boolean isValidLiquid(LiquidStack stack)
|
public boolean isValidLiquid(LiquidStack stack)
|
||||||
{
|
{
|
||||||
if (stack == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this == NONE || this.getAllLiquidData().size() == 0)
|
if (this == NONE || this.getAllLiquidData().size() == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (stack == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (LiquidData data : LiquidHandler.allowedLiquids)
|
for (LiquidData data : LiquidHandler.allowedLiquids)
|
||||||
{
|
{
|
||||||
if (data.getStack().isLiquidEqual(stack) && data.getColor() == this)
|
if (data.getStack().isLiquidEqual(stack) && data.getColor() == this)
|
||||||
|
|
Loading…
Reference in a new issue