mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Finally took the time to make cables use the ISBRH instead of a TESR.
This commit is contained in:
parent
52918b5bcc
commit
633ca1cee1
Binary file not shown.
After Width: | Height: | Size: 268 B |
Binary file not shown.
After Width: | Height: | Size: 295 B |
Binary file not shown.
Before Width: | Height: | Size: 213 B |
@ -33,7 +33,6 @@ private[oc] class Proxy extends CommonProxy {
|
||||
Settings.blockRenderId = RenderingRegistry.getNextAvailableRenderId
|
||||
RenderingRegistry.registerBlockHandler(BlockRenderer)
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Cable], CableRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Case], CaseRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Charger], ChargerRenderer)
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(classOf[tileentity.Disassembler], DisassemblerRenderer)
|
||||
|
@ -27,7 +27,6 @@ object Textures extends ResourceManagerReloadListener {
|
||||
val guiServer = new ResourceLocation(Settings.resourceDomain, "textures/gui/server.png")
|
||||
val guiSlot = new ResourceLocation(Settings.resourceDomain, "textures/gui/slot.png")
|
||||
|
||||
val blockCable = new ResourceLocation(Settings.resourceDomain, "textures/blocks/cable.png")
|
||||
val blockCaseFrontOn = new ResourceLocation(Settings.resourceDomain, "textures/blocks/CaseFrontOn.png")
|
||||
val blockHologram = new ResourceLocation(Settings.resourceDomain, "textures/blocks/HologramEffect.png")
|
||||
val blockRackFrontOn = new ResourceLocation(Settings.resourceDomain, "textures/blocks/ServerRackFrontOn.png")
|
||||
@ -38,6 +37,10 @@ object Textures extends ResourceManagerReloadListener {
|
||||
val upgradeGenerator = new ResourceLocation(Settings.resourceDomain, "textures/items/upgrade_generator_equipped.png")
|
||||
val upgradeInventory = new ResourceLocation(Settings.resourceDomain, "textures/items/upgrade_inventory_equipped.png")
|
||||
|
||||
object Cable {
|
||||
var iconCap: Icon = _
|
||||
}
|
||||
|
||||
object Charger {
|
||||
var iconFrontCharging: Icon = _
|
||||
var iconSideCharging: Icon = _
|
||||
@ -90,7 +93,6 @@ object Textures extends ResourceManagerReloadListener {
|
||||
manager.getResource(guiServer)
|
||||
manager.getResource(guiSlot)
|
||||
|
||||
manager.getResource(blockCable)
|
||||
manager.getResource(blockCaseFrontOn)
|
||||
manager.getResource(blockRackFrontOn)
|
||||
manager.getResource(blockRobot)
|
||||
|
@ -3,12 +3,13 @@ package li.cil.oc.client.renderer.block
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.client.Textures
|
||||
import li.cil.oc.client.renderer.tileentity.{CableRenderer, RobotRenderer}
|
||||
import li.cil.oc.client.renderer.tileentity.RobotRenderer
|
||||
import li.cil.oc.common.block._
|
||||
import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.util.RenderState
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.client.renderer.{RenderBlocks, Tessellator}
|
||||
import net.minecraft.util.AxisAlignedBB
|
||||
import net.minecraft.world.IBlockAccess
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
import org.lwjgl.opengl.GL11
|
||||
@ -25,8 +26,10 @@ object BlockRenderer extends ISimpleBlockRenderingHandler {
|
||||
Delegator.subBlock(block, metadata) match {
|
||||
case Some(cable: Cable) =>
|
||||
GL11.glScalef(1.6f, 1.6f, 1.6f)
|
||||
GL11.glTranslatef(-0.5f, -0.3f, -0.5f)
|
||||
CableRenderer.renderCable(ForgeDirection.DOWN.flag)
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f)
|
||||
Tessellator.instance.startDrawingQuads()
|
||||
renderCable(block, metadata, renderer)
|
||||
Tessellator.instance.draw()
|
||||
|
||||
RenderState.checkError(getClass.getName + ".renderInventoryBlock: cable")
|
||||
case Some(proxy@(_: RobotProxy | _: RobotAfterimage)) =>
|
||||
@ -78,6 +81,12 @@ object BlockRenderer extends ISimpleBlockRenderingHandler {
|
||||
RenderState.checkError(getClass.getName + ".renderWorldBlock: entering (aka: wasntme)")
|
||||
|
||||
world.getBlockTileEntity(x, y, z) match {
|
||||
case cable: tileentity.Cable =>
|
||||
renderCable(Cable.neighbors(world, x, y, z), block, cable.getBlockMetadata, x, y, z, renderer)
|
||||
|
||||
RenderState.checkError(getClass.getName + ".renderWorldBlock: cable")
|
||||
|
||||
true
|
||||
case keyboard: tileentity.Keyboard =>
|
||||
if (keyboard.facing == ForgeDirection.UP || keyboard.facing == ForgeDirection.DOWN) {
|
||||
keyboard.yaw match {
|
||||
@ -250,6 +259,76 @@ object BlockRenderer extends ISimpleBlockRenderingHandler {
|
||||
GL11.glPopAttrib()
|
||||
}
|
||||
|
||||
def renderCable(mask: Int, block: Block, metadata: Int, x: Int, y: Int, z: Int, renderer: RenderBlocks) {
|
||||
// Center part.
|
||||
val bounds = AxisAlignedBB.getBoundingBox(-0.125, -0.125, -0.125, 0.125, 0.125, 0.125)
|
||||
bounds.offset(0.5, 0.5, 0.5)
|
||||
renderer.setRenderBounds(bounds.minX, bounds.minY, bounds.minZ, bounds.maxX, bounds.maxY, bounds.maxZ)
|
||||
renderer.renderStandardBlock(block, x, y, z)
|
||||
|
||||
// Connections.
|
||||
def renderPart(side: ForgeDirection, boundSetter: () => Unit) {
|
||||
bounds.setBounds(-0.125, -0.125, -0.125, 0.125, 0.125, 0.125)
|
||||
bounds.offset(side.offsetX * 0.25, side.offsetY * 0.25, side.offsetZ * 0.25)
|
||||
boundSetter()
|
||||
bounds.offset(0.5, 0.5, 0.5)
|
||||
renderer.setRenderBounds(bounds.minX, bounds.minY, bounds.minZ, bounds.maxX, bounds.maxY, bounds.maxZ)
|
||||
renderer.renderStandardBlock(block, x, y, z)
|
||||
}
|
||||
for (side <- ForgeDirection.VALID_DIRECTIONS) {
|
||||
if ((side.flag & mask) != 0) {
|
||||
renderPart(side, () => {
|
||||
bounds.minX = math.min(bounds.minX, side.offsetX * 0.5)
|
||||
bounds.maxX = math.max(bounds.maxX, side.offsetX * 0.5)
|
||||
bounds.minY = math.min(bounds.minY, side.offsetY * 0.5)
|
||||
bounds.maxY = math.max(bounds.maxY, side.offsetY * 0.5)
|
||||
bounds.minZ = math.min(bounds.minZ, side.offsetZ * 0.5)
|
||||
bounds.maxZ = math.max(bounds.maxZ, side.offsetZ * 0.5)
|
||||
})
|
||||
}
|
||||
if ((side.getOpposite.flag & mask) == mask || mask == 0) {
|
||||
renderer.overrideBlockTexture = Textures.Cable.iconCap
|
||||
renderPart(side, () => {
|
||||
bounds.minX = math.max(bounds.minX, -(0.125 + 1 / 16f))
|
||||
bounds.maxX = math.min(bounds.maxX, 0.125 + 1 / 16f)
|
||||
bounds.minY = math.max(bounds.minY, -(0.125 + 1 / 16f))
|
||||
bounds.maxY = math.min(bounds.maxY, 0.125 + 1 / 16f)
|
||||
bounds.minZ = math.max(bounds.minZ, -(0.125 + 1 / 16f))
|
||||
bounds.maxZ = math.min(bounds.maxZ, 0.125 + 1 / 16f)
|
||||
})
|
||||
renderer.clearOverrideBlockTexture()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def renderCable(block: Block, metadata: Int, renderer: RenderBlocks) {
|
||||
val previousRenderAllFaces = renderer.renderAllFaces
|
||||
renderer.renderAllFaces = true
|
||||
|
||||
renderer.setRenderBounds(0.375, 3 / 16f, 0.375, 0.625, 13 / 16f, 0.625)
|
||||
renderFaceXNeg(block, metadata, renderer)
|
||||
renderFaceXPos(block, metadata, renderer)
|
||||
renderFaceZNeg(block, metadata, renderer)
|
||||
renderFaceZPos(block, metadata, renderer)
|
||||
|
||||
renderer.overrideBlockTexture = Textures.Cable.iconCap
|
||||
renderer.setRenderBounds(0.375, 2 / 16f, 0.375, 0.625, 3 / 16f, 0.625)
|
||||
renderFaceYNeg(block, metadata, renderer)
|
||||
renderFaceXNeg(block, metadata, renderer)
|
||||
renderFaceXPos(block, metadata, renderer)
|
||||
renderFaceZNeg(block, metadata, renderer)
|
||||
renderFaceZPos(block, metadata, renderer)
|
||||
renderer.setRenderBounds(0.375, 13 / 16f, 0.375, 0.625, 14 / 16f, 0.625)
|
||||
renderFaceYPos(block, metadata, renderer)
|
||||
renderFaceXNeg(block, metadata, renderer)
|
||||
renderFaceXPos(block, metadata, renderer)
|
||||
renderFaceZNeg(block, metadata, renderer)
|
||||
renderFaceZPos(block, metadata, renderer)
|
||||
renderer.clearOverrideBlockTexture()
|
||||
|
||||
renderer.renderAllFaces = previousRenderAllFaces
|
||||
}
|
||||
|
||||
def renderHologram(block: Block, metadata: Int, x: Int, y: Int, z: Int, renderer: RenderBlocks) {
|
||||
// Center.
|
||||
renderer.setRenderBounds(4 / 16f, 0, 4 / 16f, 12 / 16f, 3 / 16f, 12 / 16f)
|
||||
|
@ -1,130 +0,0 @@
|
||||
package li.cil.oc.client.renderer.tileentity
|
||||
|
||||
import li.cil.oc.client.Textures
|
||||
import li.cil.oc.common.block
|
||||
import li.cil.oc.util.RenderState
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer
|
||||
import net.minecraft.client.renderer.{GLAllocation, Tessellator}
|
||||
import net.minecraft.tileentity.TileEntity
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
import org.lwjgl.opengl.GL11
|
||||
|
||||
object CableRenderer extends TileEntitySpecialRenderer {
|
||||
private val displayLists = GLAllocation.generateDisplayLists(64)
|
||||
|
||||
def compileLists() {
|
||||
val t = Tessellator.instance
|
||||
val lb = 0.375
|
||||
val ub = 0.625
|
||||
val s = 0.25
|
||||
val t1 = Array(ub, ub, lb, lb)
|
||||
val t2 = Array(lb, ub, ub, lb)
|
||||
val uv1 = Array(0, 0, 0.5, 0.5)
|
||||
val uv2 = Array(0.5, 0, 0, 0.5)
|
||||
val uo = 4.0 / 8.0
|
||||
val vs = 6.0 / 4.0
|
||||
val translations = Array(Array(lb, 0, 0), Array(0, lb, 0), Array(0, 0, lb))
|
||||
val offsets = Array(Array(s, 0, 0), Array(0, s, 0), Array(0, 0, s))
|
||||
val normals = Array(
|
||||
Array(ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.SOUTH, ForgeDirection.NORTH),
|
||||
Array(ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.WEST, ForgeDirection.EAST),
|
||||
Array(ForgeDirection.UP, ForgeDirection.DOWN, ForgeDirection.WEST, ForgeDirection.EAST),
|
||||
Array(ForgeDirection.WEST, ForgeDirection.EAST, ForgeDirection.DOWN, ForgeDirection.UP),
|
||||
Array(ForgeDirection.SOUTH, ForgeDirection.NORTH, ForgeDirection.DOWN, ForgeDirection.UP),
|
||||
Array(ForgeDirection.UP, ForgeDirection.DOWN, ForgeDirection.NORTH, ForgeDirection.SOUTH)
|
||||
)
|
||||
def normal(side: ForgeDirection, n: Int) {
|
||||
val v = normals(side.ordinal())(n)
|
||||
t.setNormal(v.offsetX, v.offsetY, v.offsetZ)
|
||||
}
|
||||
def uv(i: Int) = (i + 4) % 4
|
||||
|
||||
for (mask <- 0 to 0xFF >> 2) {
|
||||
GL11.glNewList(displayLists + mask, GL11.GL_COMPILE)
|
||||
t.startDrawingQuads()
|
||||
for (side <- ForgeDirection.VALID_DIRECTIONS) {
|
||||
val connects = (side.flag & mask) != 0
|
||||
val z = if (connects) 0 else lb
|
||||
val uc = if (ForgeDirection.VALID_DIRECTIONS.
|
||||
filter(_ != side).filter(_ != side.getOpposite).
|
||||
exists(s => (s.flag & mask) != 0)) uo
|
||||
else 0
|
||||
|
||||
t.setNormal(side.offsetX, side.offsetY, -side.offsetZ)
|
||||
val (tx, ty, tz, u, v) = side match {
|
||||
case ForgeDirection.WEST => (Array.fill(4)(z), t2, t1, uv1.reverse, uv2)
|
||||
case ForgeDirection.EAST => (Array.fill(4)(1 - z), t1, t2, uv2, uv1)
|
||||
case ForgeDirection.DOWN => (t1, Array.fill(4)(z), t2, uv1.reverse, uv2)
|
||||
case ForgeDirection.UP => (t2, Array.fill(4)(1 - z), t1, uv2, uv1)
|
||||
case ForgeDirection.NORTH => (t2, t1, Array.fill(4)(z), uv2, uv1)
|
||||
case ForgeDirection.SOUTH => (t1, t2, Array.fill(4)(1 - z), uv1.reverse, uv2)
|
||||
case _ => throw new AssertionError()
|
||||
}
|
||||
t.addVertexWithUV(tx(0), ty(0), tz(0), u(0) + uc, v(0))
|
||||
t.addVertexWithUV(tx(1), ty(1), tz(1), u(1) + uc, v(1))
|
||||
t.addVertexWithUV(tx(2), ty(2), tz(2), u(2) + uc, v(2))
|
||||
t.addVertexWithUV(tx(3), ty(3), tz(3), u(3) + uc, v(3))
|
||||
|
||||
if (connects) {
|
||||
val (axis, sign, uv1, uv2, uv3, uv4) = side match {
|
||||
case ForgeDirection.WEST => (0, -1, 1, 1, 0, 0)
|
||||
case ForgeDirection.EAST => (0, 1, 2, 2, 1, 1)
|
||||
case ForgeDirection.DOWN => (1, -1, 1, 3, 2, 0)
|
||||
case ForgeDirection.UP => (1, 1, 2, 0, 3, 1)
|
||||
case ForgeDirection.NORTH => (2, -1, 0, 2, 1, 1)
|
||||
case ForgeDirection.SOUTH => (2, 1, 1, 1, 0, 2)
|
||||
case _ => throw new AssertionError()
|
||||
}
|
||||
val tl = translations(axis)
|
||||
val o1 = offsets((axis + sign + 3) % 3)
|
||||
val o2 = offsets((axis - sign + 3) % 3)
|
||||
|
||||
normal(side, 0)
|
||||
t.addVertexWithUV(tx(0) - sign * tl(0), ty(0) - sign * tl(1), tz(0) - sign * tl(2), u(uv(0 + uv1)) + uo, v(uv(0 + uv1)) * vs)
|
||||
t.addVertexWithUV(tx(1) - sign * tl(0), ty(1) - sign * tl(1), tz(1) - sign * tl(2), u(uv(1 + uv1)) + uo, v(uv(1 + uv1)) * vs)
|
||||
t.addVertexWithUV(tx(2) + o1(0), ty(2) + o1(1), tz(2) + o1(2), u(uv(2 + uv1)) + uo, v(uv(2 + uv1)) * vs)
|
||||
t.addVertexWithUV(tx(3) + o1(0), ty(3) + o1(1), tz(3) + o1(2), u(uv(3 + uv1)) + uo, v(uv(3 + uv1)) * vs)
|
||||
|
||||
normal(side, 1)
|
||||
t.addVertexWithUV(tx(0) - o1(0), ty(0) - o1(1), tz(0) - o1(2), u(uv(0 + uv2)) + uo, v(uv(0 + uv2)) * vs)
|
||||
t.addVertexWithUV(tx(1) - o1(0), ty(1) - o1(1), tz(1) - o1(2), u(uv(1 + uv2)) + uo, v(uv(1 + uv2)) * vs)
|
||||
t.addVertexWithUV(tx(2) - sign * tl(0), ty(2) - sign * tl(1), tz(2) - sign * tl(2), u(uv(2 + uv2)) + uo, v(uv(2 + uv2)) * vs)
|
||||
t.addVertexWithUV(tx(3) - sign * tl(0), ty(3) - sign * tl(1), tz(3) - sign * tl(2), u(uv(3 + uv2)) + uo, v(uv(3 + uv2)) * vs)
|
||||
|
||||
normal(side, 2)
|
||||
t.addVertexWithUV(tx(0) - sign * tl(0), ty(0) - sign * tl(1), tz(0) - sign * tl(2), u(uv(0 + uv3)) + uo, v(uv(0 + uv3)) * vs)
|
||||
t.addVertexWithUV(tx(1) - o2(0), ty(1) - o2(1), tz(1) - o2(2), u(uv(1 + uv3)) + uo, v(uv(1 + uv3)) * vs)
|
||||
t.addVertexWithUV(tx(2) - o2(0), ty(2) - o2(1), tz(2) - o2(2), u(uv(2 + uv3)) + uo, v(uv(2 + uv3)) * vs)
|
||||
t.addVertexWithUV(tx(3) - sign * tl(0), ty(3) - sign * tl(1), tz(3) - sign * tl(2), u(uv(3 + uv3)) + uo, v(uv(3 + uv3)) * vs)
|
||||
|
||||
normal(side, 3)
|
||||
t.addVertexWithUV(tx(0) + o2(0), ty(0) + o2(1), tz(0) + o2(2), u(uv(0 + uv4)) + uo, v(uv(0 + uv4)) * vs)
|
||||
t.addVertexWithUV(tx(1) - sign * tl(0), ty(1) - sign * tl(1), tz(1) - sign * tl(2), u(uv(1 + uv4)) + uo, v(uv(1 + uv4)) * vs)
|
||||
t.addVertexWithUV(tx(2) - sign * tl(0), ty(2) - sign * tl(1), tz(2) - sign * tl(2), u(uv(2 + uv4)) + uo, v(uv(2 + uv4)) * vs)
|
||||
t.addVertexWithUV(tx(3) + o2(0), ty(3) + o2(1), tz(3) + o2(2), u(uv(3 + uv4)) + uo, v(uv(3 + uv4)) * vs)
|
||||
}
|
||||
}
|
||||
t.draw()
|
||||
|
||||
GL11.glEndList()
|
||||
}
|
||||
}
|
||||
|
||||
compileLists()
|
||||
|
||||
def renderCable(neighbors: Int) {
|
||||
bindTexture(Textures.blockCable)
|
||||
GL11.glCallList(displayLists + neighbors)
|
||||
}
|
||||
|
||||
override def renderTileEntityAt(t: TileEntity, x: Double, y: Double, z: Double, f: Float) {
|
||||
RenderState.checkError(getClass.getName + ".renderTileEntityAt: entering (aka: wasntme)")
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING)
|
||||
GL11.glTranslated(x, y, z)
|
||||
renderCable(block.Cable.neighbors(t.getWorldObj, t.xCoord, t.yCoord, t.zCoord))
|
||||
GL11.glTranslated(-x, -y, -z)
|
||||
|
||||
RenderState.checkError(getClass.getName + ".renderTileEntityAt: leaving")
|
||||
}
|
||||
}
|
@ -2,7 +2,10 @@ package li.cil.oc.common.block
|
||||
|
||||
import codechicken.lib.vec.Cuboid6
|
||||
import codechicken.multipart.{JNormalOcclusion, NormalOcclusionTest, TFacePart, TileMultipart}
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.api.network.{Environment, SidedEnvironment}
|
||||
import li.cil.oc.client.Textures
|
||||
import li.cil.oc.common.multipart.CablePart
|
||||
import li.cil.oc.common.tileentity
|
||||
import li.cil.oc.util.mods.Mods
|
||||
@ -12,6 +15,23 @@ import net.minecraft.world.{IBlockAccess, World}
|
||||
import net.minecraftforge.common.ForgeDirection
|
||||
|
||||
class Cable(val parent: SpecialDelegator) extends SpecialDelegate {
|
||||
override protected def customTextures = Array(
|
||||
Some("CablePart"),
|
||||
Some("CablePart"),
|
||||
Some("CablePart"),
|
||||
Some("CablePart"),
|
||||
Some("CablePart"),
|
||||
Some("CablePart")
|
||||
)
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def registerIcons(iconRegister: IconRegister) {
|
||||
super.registerIcons(iconRegister)
|
||||
Textures.Cable.iconCap = iconRegister.registerIcon(Settings.resourceDomain + ":CableCap")
|
||||
}
|
||||
|
||||
override def hasTileEntity = true
|
||||
|
||||
override def createTileEntity(world: World) = Some(new tileentity.Cable())
|
||||
@ -24,7 +44,7 @@ class Cable(val parent: SpecialDelegator) extends SpecialDelegate {
|
||||
|
||||
override def opacity(world: World, x: Int, y: Int, z: Int) = 0
|
||||
|
||||
override def shouldSideBeRendered(world: IBlockAccess, x: Int, y: Int, z: Int, side: ForgeDirection) = false
|
||||
override def shouldSideBeRendered(world: IBlockAccess, x: Int, y: Int, z: Int, side: ForgeDirection) = true
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -1,14 +1,18 @@
|
||||
package li.cil.oc.common.multipart
|
||||
|
||||
import codechicken.lib.lighting.LazyLightMatrix
|
||||
import codechicken.lib.vec.{Cuboid6, Vector3}
|
||||
import codechicken.multipart._
|
||||
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||
import li.cil.oc.api.network.{Message, Node, Visibility}
|
||||
import li.cil.oc.api.{Items, network}
|
||||
import li.cil.oc.client.renderer.block.BlockRenderer
|
||||
import li.cil.oc.client.renderer.tileentity.CableRenderer
|
||||
import li.cil.oc.common.block.{Cable, Delegator}
|
||||
import li.cil.oc.util.ExtendedNBT._
|
||||
import li.cil.oc.{Settings, api, common}
|
||||
import net.minecraft.block.Block
|
||||
import net.minecraft.client.Minecraft
|
||||
import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.util.AxisAlignedBB
|
||||
import org.lwjgl.opengl.GL11
|
||||
@ -65,11 +69,12 @@ class CablePart(val original: Option[Node] = None) extends DelegatePart with TCu
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def renderDynamic(pos: Vector3, frame: Float, pass: Int) {
|
||||
super.renderDynamic(pos, frame, pass)
|
||||
GL11.glTranslated(pos.x, pos.y, pos.z)
|
||||
CableRenderer.renderCable(Cable.neighbors(world, x, y, z))
|
||||
GL11.glTranslated(-pos.x, -pos.y, -pos.z)
|
||||
override def renderStatic(pos: Vector3, olm: LazyLightMatrix, pass: Int) {
|
||||
val (x, y, z) = (pos.x.toInt, pos.y.toInt, pos.z.toInt)
|
||||
val block = api.Items.get("cable").block()
|
||||
val metadata = world.getBlockMetadata(x, y, z)
|
||||
val renderer = Minecraft.getMinecraft.renderGlobal.globalRenderBlocks
|
||||
BlockRenderer.renderCable(Cable.neighbors(world, x, y, z), block, metadata, x, y, z, renderer)
|
||||
}
|
||||
|
||||
override def onMessage(message: Message) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user