Fixed tank edge rendering
This commit is contained in:
parent
523f37508b
commit
d28c5a93cb
2 changed files with 28 additions and 18 deletions
|
@ -5,6 +5,7 @@ import java.util.{ArrayList, List}
|
|||
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import net.minecraft.block.material.Material
|
||||
import net.minecraft.client.renderer.RenderBlocks
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
|
@ -17,11 +18,12 @@ import resonant.content.prefab.RenderConnectedTexture
|
|||
import resonant.lib.render.{FluidRenderUtility, RenderUtility}
|
||||
import resonant.lib.transform.vector.Vector3
|
||||
import resonant.lib.utility.FluidUtility
|
||||
import resonant.lib.utility.render.RenderBlockUtility
|
||||
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
|
||||
*
|
||||
|
@ -44,7 +46,6 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
|||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
fluidNode.reconstruct()
|
||||
return FluidUtility.playerActivatedFluidItem(world, xi, yi, zi, player, side)
|
||||
}
|
||||
|
||||
|
@ -61,6 +62,13 @@ class TileTank extends TileFluidProvider(Material.iron) with ISneakPickup with R
|
|||
return super.getLightValue(access)
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def renderStatic(renderer: RenderBlocks, pos: Vector3, pass: Int): Boolean =
|
||||
{
|
||||
RenderBlockUtility.tessellateBlockWithConnectedTextures(clientRenderMask, world, pos.xi, pos.yi, pos.zi, tile.getBlockType, if (faceTexture != null) RenderUtility.getIcon(faceTexture) else null, RenderUtility.getIcon(edgeTexture))
|
||||
return true
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def renderDynamic(position: Vector3, frame: Float, pass: Int)
|
||||
{
|
||||
|
|
|
@ -11,7 +11,6 @@ import resonant.lib.network.ByteBufWrapper._
|
|||
import resonant.lib.network.discriminator.PacketType
|
||||
import resonant.lib.network.handle.{TPacketReceiver, TPacketSender}
|
||||
import resonant.lib.prefab.fluid.NodeFluid
|
||||
import resonant.lib.wrapper.BitmaskWrapper._
|
||||
|
||||
/**
|
||||
* A prefab class for tiles that use the fluid network.
|
||||
|
@ -29,7 +28,7 @@ abstract class TileFluidProvider(material: Material) extends TileAdvanced(materi
|
|||
def fluidNode_=(newNode: NodeFluid)
|
||||
{
|
||||
_fluidNode = newNode
|
||||
fluidNode.onConnectionChanged = () => if (!isInvalid) sendPacket(1)
|
||||
fluidNode.onConnectionChanged = () => if (!world.isRemote) sendPacket(1)
|
||||
nodes.add(fluidNode)
|
||||
}
|
||||
|
||||
|
@ -42,13 +41,13 @@ abstract class TileFluidProvider(material: Material) extends TileAdvanced(materi
|
|||
case 0 =>
|
||||
{
|
||||
buf <<< colorID
|
||||
buf <<< fluidNode.connectedMask.invert
|
||||
buf <<< fluidNode.connectedMask
|
||||
buf <<< fluidNode.getPrimaryTank
|
||||
}
|
||||
case 1 =>
|
||||
{
|
||||
buf <<< colorID
|
||||
buf <<< fluidNode.connectedMask.invert
|
||||
buf <<< fluidNode.connectedMask
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,22 +56,25 @@ abstract class TileFluidProvider(material: Material) extends TileAdvanced(materi
|
|||
{
|
||||
super.read(buf, id, packet)
|
||||
|
||||
id match
|
||||
if (world.isRemote)
|
||||
{
|
||||
case 0 =>
|
||||
id match
|
||||
{
|
||||
colorID = buf.readInt()
|
||||
clientRenderMask = buf.readInt()
|
||||
fluidNode.setPrimaryTank(buf.readTank())
|
||||
case 0 =>
|
||||
{
|
||||
colorID = buf.readInt()
|
||||
clientRenderMask = buf.readInt()
|
||||
fluidNode.setPrimaryTank(buf.readTank())
|
||||
}
|
||||
case 1 =>
|
||||
{
|
||||
colorID = buf.readInt()
|
||||
clientRenderMask = buf.readInt()
|
||||
}
|
||||
}
|
||||
case 1 =>
|
||||
{
|
||||
colorID = buf.readInt()
|
||||
clientRenderMask = buf.readInt()
|
||||
}
|
||||
}
|
||||
|
||||
markRender()
|
||||
markRender()
|
||||
}
|
||||
}
|
||||
|
||||
override def readFromNBT(nbt: NBTTagCompound)
|
||||
|
|
Loading…
Add table
Reference in a new issue