Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8

Conflicts:
	src/main/scala/li/cil/oc/client/gui/Assembler.scala
	src/main/scala/li/cil/oc/client/gui/Disassembler.scala
	src/main/scala/li/cil/oc/client/gui/Raid.scala
	src/main/scala/li/cil/oc/common/tileentity/Robot.scala
This commit is contained in:
Florian Nücke 2015-02-10 02:34:55 +01:00
commit b2c30e34bc
9 changed files with 13 additions and 26 deletions

View File

@ -101,12 +101,12 @@ class Assembler(playerInventory: InventoryPlayer, val assembler: tileentity.Asse
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
GL11.glColor3f(1, 1, 1) // Required under Linux.
super.drawGuiContainerBackgroundLayer(dt, mouseX, mouseY)
mc.renderEngine.bindTexture(Textures.GUI.RobotAssembler)
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
if (assemblerContainer.isAssembling) progress.level = assemblerContainer.assemblyProgress / 100.0
else progress.level = 0
drawWidgets()
drawInventorySlots()
}
override protected def drawDisabledSlot(slot: ComponentSlot) {}

View File

@ -21,7 +21,6 @@ class Disassembler(playerInventory: InventoryPlayer, val disassembler: tileentit
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
GL11.glColor3f(1, 1, 1) // Required under Linux.
super.drawGuiContainerBackgroundLayer(dt, mouseX, mouseY)
mc.renderEngine.bindTexture(Textures.GUI.Disassembler)
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
progress.level = disassemblerContainer.disassemblyProgress / 100.0

View File

@ -17,7 +17,6 @@ import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
import net.minecraft.client.renderer.Tessellator
import net.minecraft.entity.player.InventoryPlayer
import net.minecraft.inventory.Slot
import org.lwjgl.opengl.GL11
class Drone(playerInventory: InventoryPlayer, val drone: entity.Drone) extends DynamicGuiContainer(new container.Drone(playerInventory, drone)) with traits.DisplayBuffer {
@ -117,14 +116,7 @@ class Drone(playerInventory: InventoryPlayer, val drone: entity.Drone) extends D
drawSelection()
}
GL11.glPushMatrix()
GL11.glTranslatef(guiLeft, guiTop, 0)
for (slot <- 0 until inventorySlots.inventorySlots.size()) {
drawSlotInventory(inventorySlots.inventorySlots.get(slot).asInstanceOf[Slot])
}
GL11.glPopMatrix()
RenderState.makeItBlend()
drawInventorySlots()
}
protected override def drawGradientRect(par1: Int, par2: Int, par3: Int, par4: Int, par5: Int, par6: Int) {

View File

@ -54,6 +54,10 @@ abstract class DynamicGuiContainer(container: Container) extends CustomGuiContai
RenderState.makeItBlend()
GL11.glDisable(GL11.GL_LIGHTING)
drawInventorySlots()
}
protected def drawInventorySlots(): Unit = {
GL11.glPushMatrix()
GL11.glTranslatef(guiLeft, guiTop, 0)
GL11.glDisable(GL11.GL_DEPTH_TEST)
@ -62,6 +66,7 @@ abstract class DynamicGuiContainer(container: Container) extends CustomGuiContai
}
GL11.glEnable(GL11.GL_DEPTH_TEST)
GL11.glPopMatrix()
RenderState.makeItBlend()
}
override def drawScreen(mouseX: Int, mouseY: Int, dt: Float) {

View File

@ -21,7 +21,6 @@ class Raid(playerInventory: InventoryPlayer, val raid: tileentity.Raid) extends
override def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) {
GL11.glColor3f(1, 1, 1) // Required under Linux.
super.drawGuiContainerBackgroundLayer(dt, mouseX, mouseY)
mc.renderEngine.bindTexture(Textures.GUI.Raid)
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize)
}

View File

@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
import net.minecraft.client.renderer.Tessellator
import net.minecraft.entity.player.InventoryPlayer
import net.minecraft.inventory.Slot
import org.lwjgl.input.Keyboard
import org.lwjgl.input.Mouse
import org.lwjgl.opengl.GL11
@ -159,14 +158,7 @@ class Robot(playerInventory: InventoryPlayer, val robot: tileentity.Robot) exten
drawSelection()
}
GL11.glPushMatrix()
GL11.glTranslatef(guiLeft, guiTop, 0)
for (slot <- 0 until inventorySlots.inventorySlots.size()) {
drawSlotInventory(inventorySlots.inventorySlots.get(slot).asInstanceOf[Slot])
}
GL11.glPopMatrix()
RenderState.makeItBlend()
drawInventorySlots()
}
protected override def drawGradientRect(par1: Int, par2: Int, par3: Int, par4: Int, par5: Int, par6: Int) {

View File

@ -42,7 +42,7 @@ class Microcontroller(protected implicit val tileTag: ClassTag[tileentity.Microc
super.tooltipTail(metadata, stack, player, tooltip, advanced)
if (KeyBindings.showExtendedTooltips) {
val info = new MicrocontrollerData(stack)
for (component <- info.components) {
for (component <- info.components if component != null) {
tooltip.add("- " + component.getDisplayName)
}
}

View File

@ -150,7 +150,7 @@ class Robot extends traits.Computer with traits.PowerInformation with traits.Rot
override def getDisplayName = Robot.this.getDisplayName
}
val actualInventorySize = 86
val actualInventorySize = 100
def maxInventorySize = actualInventorySize - equipmentInventory.getSizeInventory - componentCount
@ -202,7 +202,7 @@ class Robot extends traits.Computer with traits.PowerInformation with traits.Rot
def componentSlots = getSizeInventory - componentCount until getSizeInventory
def inventorySlots = 0 until inventorySize
def inventorySlots: Range = equipmentInventory.getSizeInventory until (equipmentInventory.getSizeInventory + mainInventory.getSizeInventory)
def setLightColor(value: Int): Unit = {
info.lightColor = value
@ -770,7 +770,7 @@ class Robot extends traits.Computer with traits.PowerInformation with traits.Rot
}
else super.setInventorySlotContents(slot, stack)
}
else if (stack != null && stack.stackSize > 0) spawnStackInWorld(stack, Option(EnumFacing.UP))
else if (stack != null && stack.stackSize > 0 && !world.isRemote) spawnStackInWorld(stack, Option(EnumFacing.UP))
}
override def isUseableByPlayer(player: EntityPlayer) =

View File

@ -100,7 +100,7 @@ object ItemUtils {
// Split items up again to 'disassemble them individually'.
val distinct = mutable.ArrayBuffer.empty[ItemStack]
for (ingredient <- merged) {
val size = ingredient.stackSize
val size = ingredient.stackSize max 1
ingredient.stackSize = 1
for (i <- 0 until size) {
distinct += ingredient.copy()