mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 03:36:47 -04:00
Fixed printer printing a model even if limit is set to zero.
Some cleanup.
This commit is contained in:
parent
5503e3e283
commit
04e305bea6
@ -23,9 +23,7 @@ object PrinterRenderer extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5)
|
||||
|
||||
// GL11.glTranslated(-0.5, -0.5, -0.5)
|
||||
GL11.glRotated((System.currentTimeMillis() % 20000) / 20000.0 * 360, 0, 1, 0)
|
||||
// GL11.glTranslated(0.5, 0.5, 0.5)
|
||||
|
||||
val brightness = printer.world.getLightBrightnessForSkyBlocks(printer.x, printer.y, printer.z, 0)
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, brightness % 65536, brightness / 65536)
|
||||
|
@ -1,10 +1,7 @@
|
||||
package li.cil.oc.common.block
|
||||
|
||||
import li.cil.oc.Settings
|
||||
import li.cil.oc.client.Textures
|
||||
import li.cil.oc.common.GuiType
|
||||
import li.cil.oc.common.tileentity
|
||||
import net.minecraft.client.renderer.texture.IIconRegister
|
||||
import net.minecraft.world.IBlockAccess
|
||||
import net.minecraft.world.World
|
||||
import net.minecraftforge.common.util.ForgeDirection
|
||||
@ -19,13 +16,6 @@ class Printer extends SimpleBlock with traits.SpecialBlock with traits.StateAwar
|
||||
Some("PrinterSide")
|
||||
)
|
||||
|
||||
override def registerBlockIcons(iconRegister: IIconRegister) = {
|
||||
super.registerBlockIcons(iconRegister)
|
||||
Textures.Assembler.iconSideAssembling = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerSideAssembling")
|
||||
Textures.Assembler.iconSideOn = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerSideOn")
|
||||
Textures.Assembler.iconTopOn = iconRegister.registerIcon(Settings.resourceDomain + ":AssemblerTopOn")
|
||||
}
|
||||
|
||||
override def isBlockSolid(world: IBlockAccess, x: Int, y: Int, z: Int, side: ForgeDirection) = side == ForgeDirection.DOWN
|
||||
|
||||
override def isSideSolid(world: IBlockAccess, x: Int, y: Int, z: Int, side: ForgeDirection) = side == ForgeDirection.DOWN
|
||||
|
@ -48,6 +48,9 @@ class Print extends traits.TileEntity with traits.RedstoneAware with traits.Rota
|
||||
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.markBlockForUpdate(x, y, z)
|
||||
if (state && data.isButtonMode) {
|
||||
world.scheduleBlockUpdate(x, y, z, block, block.tickRate(world))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,8 +175,8 @@ class Printer extends traits.Environment with traits.Inventory with traits.Rotat
|
||||
if (!canPrint) {
|
||||
return result(null, "model invalid")
|
||||
}
|
||||
isActive = true
|
||||
limit = (args.optDouble(0, 1) max 0 min Integer.MAX_VALUE).toInt
|
||||
isActive = limit > 0
|
||||
result(true)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user