From 2430953a8137d22841da37acc536c505b2454557 Mon Sep 17 00:00:00 2001 From: JoseDouglas26 Date: Tue, 30 Apr 2024 10:41:23 +0000 Subject: [PATCH] Set use_texture_alpha for some nodes (#4262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Tall flowers with mesh drawtype (sunflower) * Clovers * End rod and its colored variants Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4262 Reviewed-by: Mikita Wiśniewski Co-authored-by: JoseDouglas26 Co-committed-by: JoseDouglas26 --- mods/ITEMS/mcl_end/building.lua | 2 ++ mods/ITEMS/mcl_flowers/init.lua | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index ba715bed9..837f09943 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -74,6 +74,7 @@ local end_rod_def = { light_source = minetest.LIGHT_MAX, sunlight_propagates = true, groups = { dig_immediate=3, deco_block=1, destroy_by_lava_flow=1, end_rod=1 }, + use_texture_alpha = "clip", selection_box = { type = "fixed", fixed = { @@ -153,6 +154,7 @@ for num, row in ipairs(colored_end_rods) do def.description = desc def._doc_items_longdesc = nil def._doc_items_create_entry = false + def.use_texture_alpha = "clip" local side_tex if name == "pink" then def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. end_rod_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index d7aa750df..7c1fa1de4 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -195,6 +195,7 @@ 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.selection_box = { type = "fixed", fixed = { -4/16, -0.5, -4/16, 4/16, 0, 4/16 }, @@ -210,6 +211,7 @@ def_4l_clover.mesh = "mcl_clover_4leaf.obj" 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" minetest.register_node("mcl_flowers:fourleaf_clover", def_4l_clover) @@ -268,6 +270,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im end -- Sunflower mesh and tiles local top_drawtype, bottom_drawtype + local alpha = nil local bottom_tiles = {} if not mesh then top_drawtype = "plantlike" @@ -277,6 +280,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im top_drawtype = "airlike" bottom_drawtype = "mesh" bottom_tiles = bottom_img + alpha = "clip" end -- Bottom minetest.register_node("mcl_flowers:"..name, { @@ -298,6 +302,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im _mcl_shears_drop = shears_drop, _mcl_fortune_drop = fortune_drop, node_placement_prediction = "", + use_texture_alpha = alpha, selection_box = { type = "fixed", fixed = { -selbox_radius, -0.5, -selbox_radius, selbox_radius, 0.5, selbox_radius }, @@ -397,6 +402,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im palette = palette, walkable = false, buildable_to = false, + use_texture_alpha = alpha, selection_box = { type = "fixed", fixed = { -selbox_radius, -0.5, -selbox_radius, selbox_radius, selbox_top_height, selbox_radius },