Try to update Milo for 1.19

Removes Milo trying to access damage on items (`nil` because of The
Flattening). We might also need to reimplement showing durability in the
item's display name - I got a little too carried away with removing
mentions of "damage". Also renames nbtHash to nbt to be consistent with
new CC:T naming. I tried not to touch anything related to MiloRemote for
now, and there are probably still many bugs remaining that need to be
ironed out. Most of the basic functionality works now, though.
This commit is contained in:
Kan18
2022-12-24 15:33:01 +04:00
parent 2461d060e0
commit 2f67fb2ef8
16 changed files with 101 additions and 100 deletions

View File

@@ -2,6 +2,7 @@ local Event = require('opus.event')
local Milo = require('milo')
local Sound = require('opus.sound')
local Storage = require('milo.storage')
local TurtleInv = require('milo.turtleInv')
local UI = require('opus.ui')
local Util = require('opus.util')
@@ -18,7 +19,6 @@ multishell.setTitle(multishell.getCurrent(), 'Milo')
local function Syntax(msg)
print([[
Turtle must be provided with:
* Introspection module (never bound)
* Workbench
Turtle must be connected to:
@@ -46,10 +46,6 @@ if not modem.getNameLocal() then
Syntax('Wired modem is not active')
end
local introspection = device['plethora:introspection'] or
turtle.equip('left', 'plethora:module:0') and device['plethora:introspection'] or
Syntax('Introspection module missing')
if not device.workbench then
turtle.equip('right', 'minecraft:crafting_table:0')
if not device.workbench then
@@ -58,6 +54,7 @@ if not device.workbench then
end
local localName = modem.getNameLocal()
TurtleInv.setLocalName(localName)
local context = {
resources = Util.readTable(Milo.RESOURCE_FILE) or { },
@@ -76,7 +73,7 @@ local context = {
turtleInventory = {
name = localName,
mtype = 'hidden',
adapter = introspection.getInventory(),
adapter = TurtleInv,
}
}