diff --git a/loot_chests.lua b/loot_chests.lua index baf6250..057c559 100644 --- a/loot_chests.lua +++ b/loot_chests.lua @@ -45,6 +45,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -62,6 +66,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -79,6 +87,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -96,6 +108,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -113,6 +129,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -130,6 +150,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -147,6 +171,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -164,6 +192,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -181,6 +213,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name) @@ -198,6 +234,10 @@ minetest.register_lbm({ -- local item_def = Everness.loot_chest.default[rand:next(1, #Everness.loot_chest.default)] + if not minetest.registered_items[item_def.name] then + return + end + if rand:next(0, 100) <= item_def.chance then local stack = ItemStack(item_def.name)