circular saw flag
This commit is contained in:
parent
d711fd5f33
commit
2906e9e8b9
@ -15,6 +15,6 @@ read_globals = {
|
||||
"dump",
|
||||
|
||||
-- optional deps
|
||||
"technic"
|
||||
"technic", "circular_saw"
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ Vue.component("item-detail", {
|
||||
<span v-if="item.pointable" class="badge badge-success">Pointable</span>
|
||||
<span v-if="item.airlike" class="badge badge-success">Airlike</span>
|
||||
<span v-if="item.walkable" class="badge badge-success">Walkable</span>
|
||||
<span v-if="item.circular_saw" class="badge badge-primary">Circular-saw compatible</span>
|
||||
<p>Stack-max: <span class="badge badge-primary">{{ item.stack_max }}</span></p>
|
||||
<p v-if="item.light_source">Light-source: <span class="badge badge-primary">{{ item.light_source }}</span></p>
|
||||
<p v-if="item.damage_per_second">Damage per second: <span class="badge badge-warning">{{ item.damage_per_second }}</span></p>
|
||||
|
@ -1,10 +1,13 @@
|
||||
|
||||
function mtinfo.map_list(target, list, keys, filter)
|
||||
function mtinfo.map_list(target, list, keys, filter, enhancefn)
|
||||
filter = filter or function()
|
||||
-- show all
|
||||
return true
|
||||
end
|
||||
|
||||
-- no-op
|
||||
enhancefn = enhancefn or function() end
|
||||
|
||||
for name, def in pairs(list) do
|
||||
if filter(def) then
|
||||
local item = {}
|
||||
@ -18,6 +21,7 @@ function mtinfo.map_list(target, list, keys, filter)
|
||||
end
|
||||
end
|
||||
end
|
||||
enhancefn(name, item)
|
||||
target[name] = item
|
||||
end
|
||||
end
|
||||
|
11
items.lua
11
items.lua
@ -32,14 +32,19 @@ local item_mapped_keys = {
|
||||
}
|
||||
|
||||
function mtinfo.export_items()
|
||||
local data = {}
|
||||
local data = {}
|
||||
local has_moreblocks = minetest.get_modpath("moreblocks")
|
||||
|
||||
mtinfo.map_list(data, minetest.registered_items, item_mapped_keys, function(def)
|
||||
mtinfo.map_list(data, minetest.registered_items, item_mapped_keys, function(def)
|
||||
if def.groups and def.groups.not_in_creative_inventory then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end, function(name, item)
|
||||
if has_moreblocks and circular_saw.known_nodes[name] then
|
||||
item.circular_saw = true
|
||||
end
|
||||
end)
|
||||
mtinfo.export_json(mtinfo.basepath.."/data/items.js", data, "mtinfo.items")
|
||||
mtinfo.export_json(mtinfo.basepath.."/data/items.js", data, "mtinfo.items")
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user