Add MCL groups and custom attribute to chest

This commit is contained in:
Juraj Vajda 2023-04-02 00:35:15 -04:00
parent b119e17e6b
commit 0a80d344f6
2 changed files with 14 additions and 67 deletions

View File

@ -326,7 +326,20 @@ Everness.chest.register_chest('everness:chest', {
sounds = Everness.node_sound_wood_defaults(), sounds = Everness.node_sound_wood_defaults(),
sound_open = 'everness_chest_open', sound_open = 'everness_chest_open',
sound_close = 'everness_chest_close', sound_close = 'everness_chest_close',
groups = { choppy = 2, oddly_breakable_by_hand = 2 }, groups = {
-- MTG
choppy = 2,
oddly_breakable_by_hand = 2,
-- MCL
handy = 1,
axey = 1,
container = 2,
deco_block = 1,
material_wood = 1,
flammable = -1,
},
_mcl_blast_resistance = 2.5,
_mcl_hardness = 2.5,
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -17,72 +17,6 @@
--]] --]]
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
--[[
minetest.register_on_mods_loaded(function()
local everness_registered_nodes = {}
local everness_registered_nodes_length = 0
local everness_registered_nodes_sand_length = 0
-- minetest.registered_items
-- registered_nodes
-- registered_tools
-- registered_craftitems
for name, def in pairs(minetest.registered_nodes) do
local name_split = name:split(':')
if name_split[1] == 'everness' then
everness_registered_nodes[name] = def
if minetest.get_item_group(name, 'sand') ~= 0 then
local new_groups = table.copy(def.groups)
everness_registered_nodes_sand_length = everness_registered_nodes_sand_length + 1
new_groups.handy = 1
new_groups.shovely = 1
new_groups.soil_sugarcane = 1
new_groups.enderman_takable = 1
new_groups.building_block = 1
new_groups.material_sand = 1
new_groups.creative_breakable = 1
new_groups.solid = 1
new_groups.opaque = 1
new_groups.handy_dig = 7
new_groups.shovely_dig = 2
-- minetest.override_item(name, {
-- groups = new_groups,
-- _mcl_blast_resistance = 0.5,
-- _mcl_hardness = 0.5
-- })
if name == 'everness:coral_sand' then
print(dump(minetest.registered_nodes[name]))
end
end
everness_registered_nodes_length = everness_registered_nodes_length + 1
end
end
-- for name, def in pairs(minetest.registered_tools) do
-- local name_split = name:split(':')
-- if name_split[1] == 'everness' then
-- if name == 'everness:pick_illuminating' then
-- print(dump(minetest.registered_tools[name]))
-- end
-- end
-- end
print('sand', everness_registered_nodes_sand_length)
print('total', everness_registered_nodes_length)
end)
--]]
--- ---
-- Fence / Gates -- Fence / Gates