diff --git a/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua b/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua index f94f07c71..eb1e8dce5 100644 --- a/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua +++ b/src/main/resources/assets/opencomputers/loot/OpenOS/lib/filesystem.lua @@ -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 diff --git a/src/main/scala/li/cil/oc/common/container/Player.scala b/src/main/scala/li/cil/oc/common/container/Player.scala index 5799d6609..07cddafb2 100644 --- a/src/main/scala/li/cil/oc/common/container/Player.scala +++ b/src/main/scala/li/cil/oc/common/container/Player.scala @@ -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 diff --git a/src/main/scala/li/cil/oc/common/item/Delegator.scala b/src/main/scala/li/cil/oc/common/item/Delegator.scala index b4724c213..4bdb7c8ac 100644 --- a/src/main/scala/li/cil/oc/common/item/Delegator.scala +++ b/src/main/scala/li/cil/oc/common/item/Delegator.scala @@ -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 {