Merge pull request #1 from atrain99/master
Changed Pipe tileEntity, the API interfaces, added textures.
This commit is contained in:
commit
a5d1fac4e7
|
@ -47,9 +47,12 @@ public class TileEntityPipe extends TileEntity implements ILiquidConsumer
|
|||
}
|
||||
else
|
||||
{
|
||||
if(tileEntity instanceof ILiquidConsumer || tileEntity instanceof ILiquidProducer)
|
||||
if(tileEntity instanceof ILiquidProducer)
|
||||
{
|
||||
this.connectedBlocks[side] = tileEntity;
|
||||
if(((ILiquidProducer) tileEntity).canConnectFromTypeAndSide(this.getType(), side)) this.connectedBlocks[side] = tileEntity;
|
||||
}else if(tileEntity instanceof ILiquidConsumer)
|
||||
{
|
||||
if(((ILiquidConsumer) tileEntity).canConnectFromTypeAndSide(this.getType(), side)) this.connectedBlocks[side] = tileEntity;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -67,13 +70,13 @@ public class TileEntityPipe extends TileEntity implements ILiquidConsumer
|
|||
* @return watt - The amount of rejected power to be sent back into the conductor
|
||||
*/
|
||||
@Override
|
||||
public int onReceiveLiquid(int type,int watt, byte side)
|
||||
public int onReceiveLiquid(int type,int amt, byte side)
|
||||
{
|
||||
if(type == this.type)
|
||||
{
|
||||
int rejectedElectricity = Math.max((this.getStoredLiquid(type) + watt) - this.capacity, 0);
|
||||
this.liquidStored = watt - rejectedElectricity;
|
||||
return rejectedElectricity;
|
||||
int rejectedLiquid = Math.max((this.getStoredLiquid(type) + amt) - this.capacity, 0);
|
||||
this.liquidStored += watt - rejectedElectricity;
|
||||
return rejectedLiquid;
|
||||
}
|
||||
return watt;
|
||||
}
|
||||
|
@ -154,7 +157,7 @@ public class TileEntityPipe extends TileEntity implements ILiquidConsumer
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Return the stored electricity in this consumer. Called by conductors to spread electricity to this unit.
|
||||
* @return Return the stored liquid in this consumer. Called by conductors to spread electricity to this unit.
|
||||
*/
|
||||
@Override
|
||||
public int getStoredLiquid(int type)
|
||||
|
|
|
@ -27,5 +27,6 @@ public interface ILiquidConsumer
|
|||
* @return Return the maximum amount of stored liquid this consumer can get.
|
||||
*/
|
||||
public int getLiquidCapacity(int type);
|
||||
public int canConnectFromTypeAndSide(int type, byte side);
|
||||
|
||||
}
|
||||
|
|
|
@ -18,4 +18,6 @@ public interface ILiquidProducer
|
|||
public int onProduceLiquid(int type, int maxVol, int side);
|
||||
|
||||
public boolean canProduceLiquid(int type, byte side);
|
||||
|
||||
public boolean canConnectFromTypeAndSide(int type, byte side);
|
||||
}
|
BIN
textures/SteamPipe.png
Normal file
BIN
textures/SteamPipe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
textures/WaterPipe.png
Normal file
BIN
textures/WaterPipe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
BIN
textures/airPipe.png
Normal file
BIN
textures/airPipe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
textures/fuelPipe.png
Normal file
BIN
textures/fuelPipe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
BIN
textures/lavaPipe.png
Normal file
BIN
textures/lavaPipe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
BIN
textures/oilPipe.png
Normal file
BIN
textures/oilPipe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Loading…
Reference in a new issue