mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Fixed some sidedness issues and fixed text on screens potentially rendering incorrectly.
This commit is contained in:
parent
c07c838bef
commit
9f767982aa
@ -58,7 +58,7 @@ item.oc.Drone.name=Drone
|
|||||||
item.oc.DroneCase0.name=Drone Case (Tier 1)
|
item.oc.DroneCase0.name=Drone Case (Tier 1)
|
||||||
item.oc.DroneCase1.name=Drone Case (Tier 2)
|
item.oc.DroneCase1.name=Drone Case (Tier 2)
|
||||||
item.oc.DroneCase3.name=Drone Case (Creative)
|
item.oc.DroneCase3.name=Drone Case (Creative)
|
||||||
item.oc.eeprom.name=EEPROM
|
item.oc.EEPROM.name=EEPROM
|
||||||
item.oc.FloppyDisk.name=Floppy Disk
|
item.oc.FloppyDisk.name=Floppy Disk
|
||||||
item.oc.GraphicsCard0.name=Graphics Card (Tier 1)
|
item.oc.GraphicsCard0.name=Graphics Card (Tier 1)
|
||||||
item.oc.GraphicsCard1.name=Graphics Card (Tier 2)
|
item.oc.GraphicsCard1.name=Graphics Card (Tier 2)
|
||||||
|
@ -54,7 +54,7 @@ item.oc.CuttingWire.name=Fil de coupe
|
|||||||
item.oc.DebugCard.name=Carte de débogueur
|
item.oc.DebugCard.name=Carte de débogueur
|
||||||
item.oc.Debugger.name=Débogueur réseau
|
item.oc.Debugger.name=Débogueur réseau
|
||||||
item.oc.Disk.name=Disque
|
item.oc.Disk.name=Disque
|
||||||
item.oc.eeprom.name=EEPROM
|
item.oc.EEPROM.name=EEPROM
|
||||||
item.oc.FloppyDisk.name=Disquette
|
item.oc.FloppyDisk.name=Disquette
|
||||||
item.oc.GraphicsCard0.name=Carte graphique (Niveau 1)
|
item.oc.GraphicsCard0.name=Carte graphique (Niveau 1)
|
||||||
item.oc.GraphicsCard1.name=Carte graphique (Niveau 2)
|
item.oc.GraphicsCard1.name=Carte graphique (Niveau 2)
|
||||||
|
@ -39,6 +39,7 @@ abstract class TextureFontRenderer {
|
|||||||
GL11.glScalef(0.5f, 0.5f, 1)
|
GL11.glScalef(0.5f, 0.5f, 1)
|
||||||
|
|
||||||
RenderState.disableDepthMask()
|
RenderState.disableDepthMask()
|
||||||
|
RenderState.makeItBlend()
|
||||||
GL11.glDisable(GL11.GL_TEXTURE_2D)
|
GL11.glDisable(GL11.GL_TEXTURE_2D)
|
||||||
|
|
||||||
RenderState.checkError(getClass.getName + ".drawBuffer: configure state")
|
RenderState.checkError(getClass.getName + ".drawBuffer: configure state")
|
||||||
|
@ -67,12 +67,26 @@ class Keyboard extends SimpleBlock with traits.OmniRotatable {
|
|||||||
case _ =>
|
case _ =>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy-pasta from old Forge's ForgeDirection, because MC's equivalent in EnumFacing is client side only \o/
|
||||||
|
private val ROTATION_MATRIX = Array(
|
||||||
|
Array(0, 1, 4, 5, 3, 2, 6),
|
||||||
|
Array(0, 1, 5, 4, 2, 3, 6),
|
||||||
|
Array(5, 4, 2, 3, 0, 1, 6),
|
||||||
|
Array(4, 5, 2, 3, 1, 0, 6),
|
||||||
|
Array(2, 3, 1, 0, 4, 5, 6),
|
||||||
|
Array(3, 2, 0, 1, 4, 5, 6),
|
||||||
|
Array(0, 1, 2, 3, 4, 5, 6))
|
||||||
|
|
||||||
|
private def getRotation(facing: EnumFacing, axis: EnumFacing) = {
|
||||||
|
EnumFacing.getFront(ROTATION_MATRIX(axis.ordinal)(facing.ordinal))
|
||||||
|
}
|
||||||
|
|
||||||
private def setBlockBounds(pitch: EnumFacing, yaw: EnumFacing) {
|
private def setBlockBounds(pitch: EnumFacing, yaw: EnumFacing) {
|
||||||
val (forward, up) = pitch match {
|
val (forward, up) = pitch match {
|
||||||
case side@(EnumFacing.DOWN | EnumFacing.UP) => (side, yaw)
|
case side@(EnumFacing.DOWN | EnumFacing.UP) => (side, yaw)
|
||||||
case _ => (yaw, EnumFacing.UP)
|
case _ => (yaw, EnumFacing.UP)
|
||||||
}
|
}
|
||||||
val side = forward.rotateAround(up.getAxis)
|
val side = getRotation(forward, up)
|
||||||
val sizes = Array(7f / 16f, 4f / 16f, 7f / 16f)
|
val sizes = Array(7f / 16f, 4f / 16f, 7f / 16f)
|
||||||
val x0 = -up.getFrontOffsetX * sizes(1) - side.getFrontOffsetX * sizes(2) - forward.getFrontOffsetX * sizes(0)
|
val x0 = -up.getFrontOffsetX * sizes(1) - side.getFrontOffsetX * sizes(2) - forward.getFrontOffsetX * sizes(0)
|
||||||
val x1 = up.getFrontOffsetX * sizes(1) + side.getFrontOffsetX * sizes(2) - forward.getFrontOffsetX * 0.5f
|
val x1 = up.getFrontOffsetX * sizes(1) + side.getFrontOffsetX * sizes(2) - forward.getFrontOffsetX * 0.5f
|
||||||
|
@ -34,7 +34,7 @@ abstract class RedstoneAware extends SimpleBlock /* with IRedNetOmniNode TODO MF
|
|||||||
|
|
||||||
override def isProvidingWeakPower(world: IBlockAccess, pos: BlockPos, state: IBlockState, side: EnumFacing) =
|
override def isProvidingWeakPower(world: IBlockAccess, pos: BlockPos, state: IBlockState, side: EnumFacing) =
|
||||||
world.getTileEntity(pos) match {
|
world.getTileEntity(pos) match {
|
||||||
case redstone: tileentity.traits.RedstoneAware => math.min(math.max(redstone.output(side), 0), 15)
|
case redstone: tileentity.traits.RedstoneAware if side != null => math.min(math.max(redstone.output(side.getOpposite), 0), 15)
|
||||||
case _ => super.isProvidingWeakPower(world, pos, state, side)
|
case _ => super.isProvidingWeakPower(world, pos, state, side)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,14 +195,6 @@ abstract class SimpleBlock(material: Material = Material.iron) extends BlockCont
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
|
|
||||||
override def canConnectRedstone(world: IBlockAccess, pos: BlockPos, side: EnumFacing) = false
|
|
||||||
|
|
||||||
override def isProvidingStrongPower(worldIn: IBlockAccess, pos: BlockPos, state: IBlockState, side: EnumFacing) = super.isProvidingWeakPower(worldIn, pos, state, side)
|
|
||||||
|
|
||||||
override def isProvidingWeakPower(worldIn: IBlockAccess, pos: BlockPos, state: IBlockState, side: EnumFacing) = 0
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
|
||||||
|
|
||||||
// NOTE: must not be final for immibis microblocks to work.
|
// NOTE: must not be final for immibis microblocks to work.
|
||||||
override def onBlockActivated(world: World, pos: BlockPos, state: IBlockState, player: EntityPlayer, side: EnumFacing, hitX: Float, hitY: Float, hitZ: Float) =
|
override def onBlockActivated(world: World, pos: BlockPos, state: IBlockState, player: EntityPlayer, side: EnumFacing, hitX: Float, hitY: Float, hitZ: Float) =
|
||||||
world.getTileEntity(pos) match {
|
world.getTileEntity(pos) match {
|
||||||
|
@ -5,7 +5,9 @@ import li.cil.oc.common
|
|||||||
import net.minecraft.inventory.IInventory
|
import net.minecraft.inventory.IInventory
|
||||||
|
|
||||||
class StaticComponentSlot(val container: Player, inventory: IInventory, index: Int, x: Int, y: Int, val slot: String, val tier: Int) extends ComponentSlot(inventory, index, x, y) {
|
class StaticComponentSlot(val container: Player, inventory: IInventory, index: Int, x: Int, y: Int, val slot: String, val tier: Int) extends ComponentSlot(inventory, index, x, y) {
|
||||||
setBackgroundLocation(Textures.Icons.get(slot))
|
if (!container.playerInventory.player.isServerWorld) {
|
||||||
|
setBackgroundLocation(Textures.Icons.get(slot))
|
||||||
|
}
|
||||||
|
|
||||||
val tierIcon = Textures.Icons.get(tier)
|
val tierIcon = Textures.Icons.get(tier)
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ trait RedstoneAware extends RotationAware /* with IConnectable with IRedstoneEmi
|
|||||||
|
|
||||||
protected def onRedstoneOutputChanged(side: EnumFacing) {
|
protected def onRedstoneOutputChanged(side: EnumFacing) {
|
||||||
val blockPos = getPos.offset(side)
|
val blockPos = getPos.offset(side)
|
||||||
world.notifyNeighborsOfStateChange(blockPos, getBlockType)
|
world.notifyBlockOfStateChange(blockPos, getBlockType)
|
||||||
world.notifyNeighborsOfStateExcept(blockPos, world.getBlockState(blockPos).getBlock, side.getOpposite)
|
world.notifyNeighborsOfStateExcept(blockPos, world.getBlockState(blockPos).getBlock, side.getOpposite)
|
||||||
|
|
||||||
if (isServer) ServerPacketSender.sendRedstoneState(this)
|
if (isServer) ServerPacketSender.sendRedstoneState(this)
|
||||||
|
@ -17,7 +17,7 @@ object DriverLootDisk extends Item {
|
|||||||
(stack.hasTagCompound && stack.getTagCompound.hasKey(Settings.namespace + "lootPath"))
|
(stack.hasTagCompound && stack.getTagCompound.hasKey(Settings.namespace + "lootPath"))
|
||||||
|
|
||||||
override def createEnvironment(stack: ItemStack, host: EnvironmentHost) =
|
override def createEnvironment(stack: ItemStack, host: EnvironmentHost) =
|
||||||
if (stack.hasTagCompound) {
|
if (stack.hasTagCompound && !host.world.isRemote) {
|
||||||
val lootPath = "loot/" + stack.getTagCompound.getString(Settings.namespace + "lootPath")
|
val lootPath = "loot/" + stack.getTagCompound.getString(Settings.namespace + "lootPath")
|
||||||
val savePath = new io.File(DimensionManager.getCurrentSaveRootDirectory, Settings.savePath + lootPath)
|
val savePath = new io.File(DimensionManager.getCurrentSaveRootDirectory, Settings.savePath + lootPath)
|
||||||
val fs =
|
val fs =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user