From 4a085c9526b5c7c5afb092536bdb925ebc05b405 Mon Sep 17 00:00:00 2001 From: Saku Laesvuori Date: Sat, 3 Apr 2021 20:12:24 +0300 Subject: [PATCH 1/3] Fix passive mobs despawning According to the wiki most passive mobs do not despawn. The ones that do have already been explicity marked as despawning. --- mods/ENTITIES/mcl_mobs/api.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 0a038ba13..6a8646bd5 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3741,6 +3741,8 @@ function mobs:register_mob(name, def) local can_despawn if def.can_despawn ~= nil then can_despawn = def.can_despawn +elseif def.spawn_class == "passive" then + can_despawn = false else can_despawn = true end From 49446bbb7b615e75f56e75a9bd2b507f81d6e214 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 4 Apr 2021 12:01:45 +0200 Subject: [PATCH 2/3] Make enderdragon spawn upon exit portal generation --- mods/MAPGEN/mcl_structures/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index f6317bdeb..6a7f44dfb 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -313,6 +313,7 @@ mcl_structures.generate_fossil = function(pos, rotation, pr) end mcl_structures.generate_end_exit_portal = function(pos, rot) + minetest.add_entity(vector.add(pos, vector.new(3, 11, 3)), "mobs_mc:enderdragon") local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_end_exit_portal.mts" return mcl_structures.place_schematic(pos, path, rot or "0", nil, true) end From 598692cf8c2fcbe94c21ab82ef3432665eb74e76 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 4 Apr 2021 12:10:21 +0200 Subject: [PATCH 3/3] Add nil check to prevent crashes with mcl_throwing --- mods/ITEMS/mcl_throwing/register.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_throwing/register.lua b/mods/ITEMS/mcl_throwing/register.lua index 8ef1c73bf..3d8cc94cf 100644 --- a/mods/ITEMS/mcl_throwing/register.lua +++ b/mods/ITEMS/mcl_throwing/register.lua @@ -99,7 +99,7 @@ local snowball_on_step = function(self, dtime) local vel = self.object:get_velocity() local node = minetest.get_node(pos) local def = minetest.registered_nodes[node.name] - + -- Destroy when hitting a solid node if self._lastpos.x~=nil then @@ -203,7 +203,7 @@ local pearl_on_step = function(self, dtime) self.object:remove() -- Activate when hitting a solid node or a plant elseif walkable or nn == "mcl_core:vine" or nn == "mcl_core:deadbush" or minetest.get_item_group(nn, "flower") ~= 0 or minetest.get_item_group(nn, "sapling") ~= 0 or minetest.get_item_group(nn, "plant") ~= 0 or minetest.get_item_group(nn, "mushroom") ~= 0 or not def then - local player = minetest.get_player_by_name(self._thrower) + local player = self._thrower and minetest.get_player_by_name(self._thrower) if player then -- Teleport and hurt player