diff --git a/src/main/resources/assets/opencomputers/lua/component/robot/lib/robot.lua b/src/main/resources/assets/opencomputers/lua/component/robot/lib/robot.lua index a1c86751c..0a010c746 100644 --- a/src/main/resources/assets/opencomputers/lua/component/robot/lib/robot.lua +++ b/src/main/resources/assets/opencomputers/lua/component/robot/lib/robot.lua @@ -72,16 +72,16 @@ end ------------------------------------------------------------------------------- -- Inventory + World -function robot.compare() - return component.robot.compare(sides.front) +function robot.compare(fuzzy) + return component.robot.compare(sides.front, fuzzy) end -function robot.compareUp() - return component.robot.compare(sides.up) +function robot.compareUp(fuzzy) + return component.robot.compare(sides.up, fuzzy) end -function robot.compareDown() - return component.robot.compare(sides.down) +function robot.compareDown(fuzzy) + return component.robot.compare(sides.down, fuzzy) end function robot.drop(count) diff --git a/src/main/scala/li/cil/oc/server/component/traits/InventoryWorldControl.scala b/src/main/scala/li/cil/oc/server/component/traits/InventoryWorldControl.scala index 6055f8f8d..7d563a06d 100644 --- a/src/main/scala/li/cil/oc/server/component/traits/InventoryWorldControl.scala +++ b/src/main/scala/li/cil/oc/server/component/traits/InventoryWorldControl.scala @@ -13,7 +13,7 @@ import net.minecraft.item.ItemBlock import net.minecraftforge.common.util.ForgeDirection trait InventoryWorldControl extends InventoryAware with WorldAware with SideRestricted { - @Callback(doc = "function(side:number):boolean -- Compare the block on the specified side with the one in the selected slot. Returns true if equal.") + @Callback(doc = "function(side:number[, fuzzy:boolean=false]):boolean -- Compare the block on the specified side with the one in the selected slot. Returns true if equal.") def compare(context: Context, args: Arguments): Array[AnyRef] = { val side = checkSideForAction(args, 0) stackInSlot(selectedSlot) match { @@ -21,7 +21,7 @@ trait InventoryWorldControl extends InventoryAware with WorldAware with SideRest case Some(item: ItemBlock) => val blockPos = position.offset(side) val idMatches = item.field_150939_a == world.getBlock(blockPos) - val subTypeMatches = !item.getHasSubtypes || item.getMetadata(stack.getItemDamage) == world.getBlockMetadata(blockPos) + val subTypeMatches = args.optBoolean(1, false) || !item.getHasSubtypes || item.getMetadata(stack.getItemDamage) == world.getBlockMetadata(blockPos) return result(idMatches && subTypeMatches) case _ => }