Merge branch 'master' of github.com:MightyPirates/OpenComputers into MC1.7

This commit is contained in:
Florian Nücke 2014-06-22 20:40:52 +02:00
commit 5a36e1eea9
3 changed files with 7 additions and 2 deletions

View File

@ -228,7 +228,7 @@ end
function filesystem.path(path)
local parts = segments(path)
local result = table.concat(parts, "/", 1, #parts - 1) .. "/"
if unicode.sub(path, 1, 1) == "/" then
if unicode.sub(path, 1, 1) == "/" and unicode.sub(result, 1, 1) ~= "/" then
return "/" .. result
else
return result

View File

@ -52,7 +52,7 @@ abstract class Player(val playerInventory: InventoryPlayer, val otherInventory:
if (intoPlayerInventory) (inventorySlots.size - 1, 0)
else (0, inventorySlots.size - 1)
if (fromStack.isStackable) for (i <- begin to end by step if i >= 0 && i < inventorySlots.size && from.getHasStack && from.getStack.stackSize > 0) {
if (fromStack.getMaxStackSize > 1) for (i <- begin to end by step if i >= 0 && i < inventorySlots.size && from.getHasStack && from.getStack.stackSize > 0) {
val intoSlot = inventorySlots.get(i).asInstanceOf[Slot]
if (intoSlot.inventory != from.inventory && intoSlot.getHasStack) {
val intoStack = intoSlot.getStack

View File

@ -146,6 +146,11 @@ class Delegator extends Item {
case _ => super.getMaxDamage(stack)
}
override def isDamaged(stack: ItemStack) =
subItem(stack) match {
case Some(subItem) if subItem.isDamageable => subItem.damage(stack) > 0
case _ => false
}
override def onUpdate(stack: ItemStack, world: World, player: Entity, slot: Int, selected: Boolean) =
subItem(stack) match {