mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 17:28:52 -04:00
Fixed regression in redstone handling of print with only one state.
Only rendering robot labels once per frame (not in both render passes, herp).
This commit is contained in:
parent
10a640d8ee
commit
c0ff965fa7
@ -10,4 +10,6 @@ Navigating the manual is similar to browsing a wiki: click on links (1) to follo
|
|||||||
|
|
||||||
When opening the manual again at a later point, you will return to the page you were on when you closed it. You can start over on the main index page by using it while sneaking. It is also possible to directly jump to a page concerning a block in the world by using the block while sneaking with the manual in hand.
|
When opening the manual again at a later point, you will return to the page you were on when you closed it. You can start over on the main index page by using it while sneaking. It is also possible to directly jump to a page concerning a block in the world by using the block while sneaking with the manual in hand.
|
||||||
|
|
||||||
If your questions are not answered by the manual, other places with information are the [wiki](http://ocdoc.cil.li), OpenComputers' [IRC channel](http://webchat.esper.net/?channels=#oc) and the [forums](http://oc.cil.li/).
|
If your questions are not answered by the manual, other places with information are [the wiki](http://ocdoc.cil.li), OpenComputers' [IRC channel](http://webchat.esper.net/?channels=#oc) and [the forums](http://oc.cil.li/).
|
||||||
|
|
||||||
|
If you spot any mistakes in the manual, factual, grammatical or otherwise, or bugs in the mod, for that matter, please let us know [via the issue tracker](https://github.com/MightyPirates/OpenComputers/issues). If you'd like to contribute to the manual by adding content, get in touch via IRC or by creating a ticket on the issue tracker.
|
||||||
|
@ -428,7 +428,7 @@ object RobotRenderer extends TileEntitySpecialRenderer {
|
|||||||
GL11.glPopMatrix()
|
GL11.glPopMatrix()
|
||||||
|
|
||||||
val name = robot.name
|
val name = robot.name
|
||||||
if (Settings.get.robotLabels && !Strings.isNullOrEmpty(name) && x * x + y * y + z * z < RendererLivingEntity.NAME_TAG_RANGE) {
|
if (Settings.get.robotLabels && MinecraftForgeClient.getRenderPass == 1 && !Strings.isNullOrEmpty(name) && x * x + y * y + z * z < RendererLivingEntity.NAME_TAG_RANGE) {
|
||||||
GL11.glPushMatrix()
|
GL11.glPushMatrix()
|
||||||
|
|
||||||
// This is pretty much copy-pasta from the entity's label renderer.
|
// This is pretty much copy-pasta from the entity's label renderer.
|
||||||
@ -452,7 +452,7 @@ object RobotRenderer extends TileEntitySpecialRenderer {
|
|||||||
GL11.glDisable(GL11.GL_TEXTURE_2D)
|
GL11.glDisable(GL11.GL_TEXTURE_2D)
|
||||||
|
|
||||||
t.startDrawingQuads()
|
t.startDrawingQuads()
|
||||||
t.setColorRGBA_F(0, 0, 0, 0.25f)
|
t.setColorRGBA_F(0, 0, 0, 0.5f)
|
||||||
t.addVertex(-halfWidth - 1, -1, 0)
|
t.addVertex(-halfWidth - 1, -1, 0)
|
||||||
t.addVertex(-halfWidth - 1, 8, 0)
|
t.addVertex(-halfWidth - 1, 8, 0)
|
||||||
t.addVertex(halfWidth + 1, 8, 0)
|
t.addVertex(halfWidth + 1, 8, 0)
|
||||||
|
@ -31,6 +31,8 @@ class PrintData extends ItemData {
|
|||||||
|
|
||||||
def emitRedstone = redstoneLevel > 0 && stateOn.size > 0
|
def emitRedstone = redstoneLevel > 0 && stateOn.size > 0
|
||||||
|
|
||||||
|
def hasActiveState = stateOn.size > 0
|
||||||
|
|
||||||
def opacity = {
|
def opacity = {
|
||||||
if (opacityDirty) {
|
if (opacityDirty) {
|
||||||
opacityDirty = false
|
opacityDirty = false
|
||||||
|
@ -44,7 +44,7 @@ class Print extends traits.TileEntity with traits.RedstoneAware with traits.Rota
|
|||||||
|
|
||||||
override protected def onRedstoneInputChanged(side: ForgeDirection, oldMaxValue: Int, newMaxValue: Int): Unit = {
|
override protected def onRedstoneInputChanged(side: ForgeDirection, oldMaxValue: Int, newMaxValue: Int): Unit = {
|
||||||
super.onRedstoneInputChanged(side, oldMaxValue, newMaxValue)
|
super.onRedstoneInputChanged(side, oldMaxValue, newMaxValue)
|
||||||
if (!data.emitRedstone) {
|
if (!data.emitRedstone && data.hasActiveState) {
|
||||||
state = newMaxValue > 0
|
state = newMaxValue > 0
|
||||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.click", 0.3F, if (state) 0.6F else 0.5F)
|
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.click", 0.3F, if (state) 0.6F else 0.5F)
|
||||||
world.markBlockForUpdate(x, y, z)
|
world.markBlockForUpdate(x, y, z)
|
||||||
|
@ -263,7 +263,7 @@ class PrintPart(val original: Option[tileentity.Print] = None) extends SimpleBlo
|
|||||||
protected def checkRedstone(): Unit = {
|
protected def checkRedstone(): Unit = {
|
||||||
val newMaxValue = computeInput()
|
val newMaxValue = computeInput()
|
||||||
val newState = newMaxValue > 1 // Fixes oddities in cycling updates.
|
val newState = newMaxValue > 1 // Fixes oddities in cycling updates.
|
||||||
if (!data.emitRedstone && state != newState) {
|
if (!data.emitRedstone && data.hasActiveState && state != newState) {
|
||||||
toggleState()
|
toggleState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user