craftos2
craftos2 copied to clipboard
Inventory peripherals `setItem` call reports incorrect field names in errors
Describe the bug
When calling setItem
on a virtual inventory peripheral the error message for missing the "count" field is incorrect. It states "bad field 'name' (expected string, got nil)".
To Reproduce
- Attach a chest,
attach left chest
- Wrap it as a peripheral in the lua prompt
p = peripheral.wrap("left")
- Set an item missing the
count
fieldp.setItem(1, {name="test"})
Expected behavior
The error should state that the count
field is missing, not the name
field.
Screenshots
Environment (please complete the following information):
- OS: PopOS 22.04
- OS Version: 22.04
- CraftOS-PC Version: v2.8.3
- Compiled from source? No