Ported the shift-to-toggle-state-of-3d-print-itemstacks thinger.

This commit is contained in:
Florian Nücke 2015-06-25 20:26:36 +02:00
parent f244e5de33
commit 9d1edeaeb9

View File

@ -2,6 +2,7 @@ package li.cil.oc.client.renderer.block
import com.google.common.base.Strings import com.google.common.base.Strings
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.client.KeyBindings
import li.cil.oc.client.Textures import li.cil.oc.client.Textures
import li.cil.oc.common.block import li.cil.oc.common.block
import li.cil.oc.common.item.data.PrintData import li.cil.oc.common.item.data.PrintData
@ -52,14 +53,17 @@ object PrintModel extends SmartBlockModelBase with ISmartItemModel {
val faces = mutable.ArrayBuffer.empty[BakedQuad] val faces = mutable.ArrayBuffer.empty[BakedQuad]
Textures.Block.bind() Textures.Block.bind()
for (shape <- data.stateOff) { val shapes =
if (data.hasActiveState && KeyBindings.showExtendedTooltips)
data.stateOn
else
data.stateOff
for (shape <- shapes) {
val bounds = shape.bounds val bounds = shape.bounds
val texture = resolveTexture(shape.texture) val texture = resolveTexture(shape.texture)
if (Strings.isNullOrEmpty(shape.texture))
Tessellator.getInstance.getWorldRenderer.setColorRGBA_F(1, 1, 1, 0.25f)
faces ++= bakeQuads(makeBox(bounds.min, bounds.max), Array.fill(6)(texture), shape.tint.getOrElse(NoTint)) faces ++= bakeQuads(makeBox(bounds.min, bounds.max), Array.fill(6)(texture), shape.tint.getOrElse(NoTint))
} }
if (data.stateOff.isEmpty) { if (shapes.isEmpty) {
val bounds = ExtendedAABB.unitBounds val bounds = ExtendedAABB.unitBounds
val texture = resolveTexture(Settings.resourceDomain + ":blocks/white") val texture = resolveTexture(Settings.resourceDomain + ":blocks/white")
faces ++= bakeQuads(makeBox(bounds.min, bounds.max), Array.fill(6)(texture), Color.rgbValues(EnumDyeColor.LIME)) faces ++= bakeQuads(makeBox(bounds.min, bounds.max), Array.fill(6)(texture), Color.rgbValues(EnumDyeColor.LIME))