graceful user error fallback

This commit is contained in:
unknown 2022-02-06 11:08:10 -05:00
parent d9e06980d3
commit 7dfea8748a
1 changed files with 14 additions and 1 deletions

View File

@ -1,7 +1,20 @@
local S = minetest.get_translator("basic_materials")
local sound_api = dofile(basic_materials.modpath .. "/sound_api_core/init.lua")
local chains_sbox = {type = "fixed",fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 }}
local sound_api = loadfile(basic_materials.modpath .. "/sound_api_core/init.lua")
if not sound_api then
sound_api = {}
local metatable = {
__index = function(_, _)
return function(input)
minetest.log("warning", "[basic_materials]: sounds not found")
if input then return input else return nil end
end
end,
}
setmetatable(sound_api, metatable)
end
minetest.register_node("basic_materials:cement_block", {
description = S("Cement"),
tiles = {"basic_materials_cement_block.png"},