Fixed tank edge not rendering when connected to pipes
This commit is contained in:
parent
bb8c0fd47d
commit
c87e7e6a79
2 changed files with 21 additions and 5 deletions
|
@ -11,19 +11,22 @@ import net.minecraft.item.ItemStack
|
|||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.world.IBlockAccess
|
||||
import net.minecraftforge.common.util.ForgeDirection
|
||||
import net.minecraftforge.fluids.{FluidContainerRegistry, FluidStack, FluidTank, IFluidTank}
|
||||
import net.minecraftforge.fluids._
|
||||
import org.lwjgl.opengl.GL11
|
||||
import resonant.api.IRemovable.ISneakPickup
|
||||
import resonant.api.grid.INode
|
||||
import resonant.content.prefab.RenderConnectedTexture
|
||||
import resonant.lib.grid.node.Node
|
||||
import resonant.lib.render.{FluidRenderUtility, RenderUtility}
|
||||
import resonant.lib.transform.vector.Vector3
|
||||
import resonant.lib.utility.FluidUtility
|
||||
import resonant.lib.utility.render.RenderBlockUtility
|
||||
import resonant.lib.wrapper.BitmaskWrapper._
|
||||
import resonantinduction.archaic.ArchaicContent
|
||||
import resonantinduction.archaic.fluid.gutter.NodePressureGravity
|
||||
import resonantinduction.core.Reference
|
||||
import resonantinduction.core.prefab.node.TileFluidProvider
|
||||
import resonant.lib.wrapper.BitmaskWrapper._
|
||||
|
||||
/**
|
||||
* Tile/Block class for basic Dynamic tanks
|
||||
*
|
||||
|
@ -37,6 +40,16 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
|||
itemBlock = classOf[ItemBlockTank]
|
||||
|
||||
fluidNode = new NodePressureGravity(this, 16 * FluidContainerRegistry.BUCKET_VOLUME)
|
||||
{
|
||||
override def connect[B <: IFluidHandler](obj: B, dir: ForgeDirection)
|
||||
{
|
||||
super.connect(obj, dir)
|
||||
|
||||
if (obj.isInstanceOf[INode] && !obj.asInstanceOf[Node].parent.isInstanceOf[TileTank])
|
||||
_connectedMask = _connectedMask.closeMask(dir)
|
||||
}
|
||||
}
|
||||
|
||||
fluidNode.asInstanceOf[NodePressureGravity].maxFlowRate = FluidContainerRegistry.BUCKET_VOLUME
|
||||
fluidNode.onFluidChanged = () => markUpdate()
|
||||
|
||||
|
|
|
@ -22,11 +22,14 @@ class NodePressure(parent: INodeProvider, volume: Int = FluidContainerRegistry.B
|
|||
var maxPressure = 100
|
||||
private var _pressure: Int = 0
|
||||
|
||||
UpdateTicker.addUpdater(this)
|
||||
override def reconstruct()
|
||||
{
|
||||
super.reconstruct()
|
||||
UpdateTicker.addUpdater(this)
|
||||
}
|
||||
|
||||
def update(deltaTime: Double)
|
||||
{
|
||||
println(world)
|
||||
if (!world.isRemote)
|
||||
{
|
||||
updatePressure()
|
||||
|
@ -176,7 +179,7 @@ class NodePressure(parent: INodeProvider, volume: Int = FluidContainerRegistry.B
|
|||
this._pressure = pressure
|
||||
}
|
||||
|
||||
def canUpdate = !isInvalid
|
||||
def canUpdate = !isInvalid && world != null
|
||||
|
||||
def continueUpdate = !isInvalid
|
||||
}
|
Loading…
Reference in a new issue