Fixed screens rendering their orientation overlay when *any* OC item is held in hand; should only be the case when a screen is held (or a wrench tool).

This commit is contained in:
Florian Nücke 2014-11-27 18:31:47 +01:00
parent 62e669ec9d
commit 0ac27fd0e0

View File

@ -1,8 +1,8 @@
package li.cil.oc.client.renderer.tileentity package li.cil.oc.client.renderer.tileentity
import li.cil.oc.Settings import li.cil.oc.Settings
import li.cil.oc.api
import li.cil.oc.client.Textures import li.cil.oc.client.Textures
import li.cil.oc.common.block
import li.cil.oc.common.tileentity.Screen import li.cil.oc.common.tileentity.Screen
import li.cil.oc.integration.util.Wrench import li.cil.oc.integration.util.Wrench
import li.cil.oc.util.RenderState import li.cil.oc.util.RenderState
@ -22,6 +22,8 @@ object ScreenRenderer extends TileEntitySpecialRenderer {
private var screen: Screen = null private var screen: Screen = null
private lazy val screens = Set(api.Items.get("screen1"), api.Items.get("screen2"), api.Items.get("screen3"))
// ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- //
// Rendering // Rendering
// ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- //
@ -104,11 +106,7 @@ object ScreenRenderer extends TileEntitySpecialRenderer {
// Show up vector overlay when holding same screen block. // Show up vector overlay when holding same screen block.
val stack = Minecraft.getMinecraft.thePlayer.getHeldItem val stack = Minecraft.getMinecraft.thePlayer.getHeldItem
if (stack != null) { if (stack != null) {
if (Wrench.holdsApplicableWrench(Minecraft.getMinecraft.thePlayer, screen.x, screen.y, screen.z) || if (Wrench.holdsApplicableWrench(Minecraft.getMinecraft.thePlayer, screen.x, screen.y, screen.z) || screens.contains(api.Items.get(stack))) {
(stack.getItem match {
case block: block.Item => block.getMetadata(stack.getItemDamage) == screen.getBlockMetadata
case _ => false
})) {
GL11.glPushMatrix() GL11.glPushMatrix()
transform() transform()
bindTexture(Textures.blockScreenUpIndicator) bindTexture(Textures.blockScreenUpIndicator)