Fixed tanks and gutters affected by pressure

This commit is contained in:
Calclavia 2014-12-10 22:38:18 +08:00
parent 100c70a111
commit b36f382fa4
3 changed files with 5 additions and 1 deletions

View file

@ -47,6 +47,7 @@ object TileGutter
class TileGutter extends TileFluidProvider(Material.rock)
{
fluidNode = new NodeGutter(this)
fluidNode.asInstanceOf[NodeGutter].doPressureUpdate = false
fluidNode.onFluidChanged = () =>
{
if (!world.isRemote)

View file

@ -51,6 +51,7 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
}
fluidNode.asInstanceOf[NodeFluidGravity].maxFlowRate = FluidContainerRegistry.BUCKET_VOLUME
fluidNode.asInstanceOf[NodeFluidGravity].doPressureUpdate = false
fluidNode.onFluidChanged = () => if(!world.isRemote) sendPacket(0)
override def shouldSideBeRendered(access: IBlockAccess, x: Int, y: Int, z: Int, side: Int): Boolean = new Vector3(x, y, z).getBlock(access) != block

View file

@ -21,6 +21,7 @@ class NodeFluidPressure(parent: INodeProvider, volume: Int = FluidContainerRegis
{
var maxFlowRate = 1000
var maxPressure = 100
var doPressureUpdate = true
private var _pressure: Int = 0
override def reconstruct()
@ -33,6 +34,7 @@ class NodeFluidPressure(parent: INodeProvider, volume: Int = FluidContainerRegis
{
if (!world.isRemote)
{
if (doPressureUpdate)
updatePressure()
distribute(deltaTime)
}