1
0
Fork 0

Ensure enchanted netherite armour is fire immune to lava etc.

jukebox_sound_distance
ancientmarinerdev 2023-04-03 02:06:58 +01:00
parent 0f64fb79c5
commit c83574802f
1 changed files with 7 additions and 1 deletions

View File

@ -409,8 +409,14 @@ local function nodes_destroy_items (self, moveresult, def, nn)
local dg = minetest.get_item_group(nn, "destroys_items") local dg = minetest.get_item_group(nn, "destroys_items")
if (def and (lg ~= 0 or fg ~= 0 or dg == 1)) then if (def and (lg ~= 0 or fg ~= 0 or dg == 1)) then
local item_name = self.itemstring
local name, _ = item_name:match"^(%S+)%s+(.+)"
if name then
item_name = name
end
--Wait 2 seconds to allow mob drops to be cooked, & picked up instead of instantly destroyed. --Wait 2 seconds to allow mob drops to be cooked, & picked up instead of instantly destroyed.
if self.age > 2 and minetest.get_item_group(self.itemstring, "fire_immune") == 0 then if self.age > 2 and minetest.get_item_group(item_name, "fire_immune") == 0 then
if dg ~= 2 then if dg ~= 2 then
minetest.sound_play("builtin_item_lava", { pos = self.object:get_pos(), gain = 0.5 }) minetest.sound_play("builtin_item_lava", { pos = self.object:get_pos(), gain = 0.5 })
end end