From e0c94ccb8a75ef23ad154fe1b25715b908e0a397 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Wed, 28 Apr 2021 21:58:28 -0400 Subject: [PATCH 1/3] Stop thorns enchant from crashing server when dealing damage to mobs --- mods/ITEMS/mcl_armor/damage.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_armor/damage.lua b/mods/ITEMS/mcl_armor/damage.lua index c5023deb55..3732de8e60 100644 --- a/mods/ITEMS/mcl_armor/damage.lua +++ b/mods/ITEMS/mcl_armor/damage.lua @@ -81,7 +81,7 @@ mcl_damage.register_modifier(function(obj, damage, reason) local thorns_damage = thorns_damage_regular + thorns_damage_irregular if thorns_damage > 0 and reason.type ~= "thorns" and reason.source ~= obj then - mcl_util.deal_damage(reason.source, {type = "thorns", direct = obj}) + mcl_util.deal_damage(reason.source, thorns_damage) local thorns_item = thorns_pieces[math.random(#thorns_pieces)] mcl_util.use_item_durability(thorns_item.itemstack, 2) From cf46f0d8b88870170a0a00367601f031499f193a Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Thu, 29 Apr 2021 01:32:57 -0400 Subject: [PATCH 2/3] Fix crashing if null itemstack enchant when player is hacking --- mods/ITEMS/mcl_enchanting/engine.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mods/ITEMS/mcl_enchanting/engine.lua b/mods/ITEMS/mcl_enchanting/engine.lua index e5b61d328c..89fdc393dc 100644 --- a/mods/ITEMS/mcl_enchanting/engine.lua +++ b/mods/ITEMS/mcl_enchanting/engine.lua @@ -6,6 +6,9 @@ function mcl_enchanting.is_book(itemname) end function mcl_enchanting.get_enchantments(itemstack) + if not itemstack then + return({}) + end return minetest.deserialize(itemstack:get_meta():get_string("mcl_enchanting:enchantments")) or {} end From 6fac49550e3a126d48c0d87617698e89bbe2b945 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Thu, 29 Apr 2021 08:18:33 +0200 Subject: [PATCH 3/3] Fix kicking players from bed when it's destroyed --- mods/ITEMS/mcl_beds/functions.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index b1ce06b96e..ecd7496036 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -88,7 +88,7 @@ local function lay_down(player, pos, bed_pos, state, skip) end for _, other_pos in pairs(mcl_beds.bed_pos) do - if vector.distance(bed_pos, other_pos) < 0.1 then + if vector.distance(bed_pos2, other_pos) < 0.1 then return false, S("This bed is already occupied!") end end @@ -170,7 +170,7 @@ local function lay_down(player, pos, bed_pos, state, skip) mcl_beds.player[name] = 1 mcl_beds.pos[name] = pos - mcl_beds.bed_pos[name] = bed_pos + mcl_beds.bed_pos[name] = bed_pos2 player_in_bed = player_in_bed + 1 -- physics, eye_offset, etc player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0})