From 9e9507efeb87f7cfc078447afa4dadbd326178d2 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 22 Apr 2024 03:23:13 +0200 Subject: [PATCH] Plant placement and drop fixes --- mods/CORE/mcl_util/init.lua | 5 +++-- mods/ITEMS/mcl_flowers/init.lua | 3 ++- mods/ITEMS/mcl_potions/functions.lua | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 4204e218d..b6fd71673 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -438,10 +438,11 @@ function mcl_util.generate_on_place_plant_function(condition) if not def_under or not def_above then return itemstack end - if def_under.buildable_to then + if def_under.buildable_to and def_under.name ~= itemstack:get_name() then place_pos = pointed_thing.under - elseif def_above.buildable_to then + elseif def_above.buildable_to and def_above.name ~= itemstack:get_name() then place_pos = pointed_thing.above + pointed_thing.under = pointed_thing.above else return itemstack end diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index 7c1fa1de4..85a65a165 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -194,8 +194,8 @@ def_clover.mesh = "mcl_clover_3leaf.obj" def_clover.tiles = { "mcl_flowers_clover.png" } def_clover.inventory_image = "mcl_flowers_clover_inv.png" def_clover.wield_image = "mcl_flowers_clover_inv.png" -def_clover.drop = nil def_clover.use_texture_alpha = "clip" +def_clover.drop = "mcl_flowers:clover" def_clover.selection_box = { type = "fixed", fixed = { -4/16, -0.5, -4/16, 4/16, 0, 4/16 }, @@ -212,6 +212,7 @@ def_4l_clover.tiles = { "mcl_flowers_fourleaf_clover.png" } def_4l_clover.inventory_image = "mcl_flowers_fourleaf_clover_inv.png" def_4l_clover.wield_image = "mcl_flowers_fourleaf_clover_inv.png" def_4l_clover.use_texture_alpha = "clip" +def_4l_clover.drop = "mcl_flowers:fourleaf_clover" minetest.register_node("mcl_flowers:fourleaf_clover", def_4l_clover) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 875d13c7c..41c077b81 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -1673,7 +1673,7 @@ function mcl_potions.make_invisible(obj_ref, hide) mcl_player.player_set_visibility(obj_ref, true) obj_ref:set_nametag_attributes({ color = { r = 255, g = 255, b = 255, a = 255 } }) end - else -- TODO make below section (and preferably other effects on mobs) rely on metadata + else if hide then local luaentity = obj_ref:get_luaentity() EF.invisibility[obj_ref].old_size = luaentity.visual_size