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

@@ -42,7 +42,7 @@ function recipeTab:setItem(item)
})
end
local key = itemDB:splitKey(self.recipe.result)
self.ignoreResultNBT.inactive = not key.nbtHash
self.ignoreResultNBT.inactive = not key.nbt
end
self.grid:setValues(t)
end
@@ -53,7 +53,7 @@ function recipeTab:eventHandler(event)
Milo:updateRecipe(self.recipe.result)
local item = itemDB:splitKey(self.recipe.result)
item.nbtHash = nil
item.nbt = nil
self.recipe.result = itemDB:makeKey(item)
-- add updated entry
@@ -64,13 +64,13 @@ function recipeTab:eventHandler(event)
elseif event.type == 'grid_focus_row' then
local key = itemDB:splitKey(event.selected.key)
self.ignoreNBT.inactive = not key.nbtHash
self.ignoreNBT.inactive = not key.nbt
self.ignoreNBT:draw()
elseif event.type == 'ignore_nbt' then
local selected = self.grid:getSelected()
local item = itemDB:splitKey(selected.key)
item.nbtHash = nil
item.nbt = nil
selected.key = itemDB:makeKey(item)
self.grid:draw()