From 1476c7ae599abc266b2cb4a55f628d1808943c79 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Fri, 2 Feb 2024 02:31:57 +0100 Subject: [PATCH] Make end rods use a mesh model * merged the 3 textures of the end rod into one * made a proper image mask for the colored end rods * (used to be hardcoded & didn't work for higher-res texture packs) --- mods/ITEMS/mcl_end/building.lua | 31 +++------- mods/ITEMS/mcl_end/models/mcl_end_rod.obj | 67 ++++++++++++++++++++++ textures/mcl_end_end_rod.png | Bin 0 -> 139 bytes textures/mcl_end_end_rod_bottom.png | Bin 78 -> 0 bytes textures/mcl_end_end_rod_mask.png | Bin 0 -> 87 bytes textures/mcl_end_end_rod_side.png | Bin 103 -> 0 bytes textures/mcl_end_end_rod_top.png | Bin 87 -> 0 bytes 7 files changed, 74 insertions(+), 24 deletions(-) create mode 100644 mods/ITEMS/mcl_end/models/mcl_end_rod.obj create mode 100644 textures/mcl_end_end_rod.png delete mode 100644 textures/mcl_end_end_rod_bottom.png create mode 100644 textures/mcl_end_end_rod_mask.png delete mode 100644 textures/mcl_end_end_rod_side.png delete mode 100644 textures/mcl_end_end_rod_top.png diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index 7baa22c0f..ba715bed9 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -60,32 +60,20 @@ minetest.register_node("mcl_end:purpur_pillar", { }) local end_rod_name = "mcl_end:end_rod" -local end_rod_side_tex = "mcl_end_end_rod_side.png" local end_rod_def = { description = S("End Rod"), _doc_items_longdesc = S("End rods are decorative light sources."), tiles = { - "mcl_end_end_rod_top.png", - "mcl_end_end_rod_bottom.png", - end_rod_side_tex, - end_rod_side_tex, - end_rod_side_tex, - end_rod_side_tex, + "mcl_end_end_rod.png", }, - drawtype = "nodebox", + drawtype = "mesh", + mesh = "mcl_end_rod.obj", is_ground_content = false, paramtype = "light", paramtype2 = "facedir", light_source = minetest.LIGHT_MAX, sunlight_propagates = true, groups = { dig_immediate=3, deco_block=1, destroy_by_lava_flow=1, end_rod=1 }, - node_box = { - type = "fixed", - fixed = { - {-0.125, -0.5, -0.125, 0.125, -0.4375, 0.125}, -- Base - {-0.0625, -0.4375, -0.0625, 0.0625, 0.5, 0.0625}, -- Rod - }, - }, selection_box = { type = "fixed", fixed = { @@ -156,8 +144,7 @@ local colored_end_rods = { {"lime", S("Lime End Rod"), "green"}, {"lightblue", S("Light Blue End Rod"), "lightblue"}, } -local top_mask = "^[mask:mobs_mc_empty.png\\^[fill\\:2x2\\:7,7\\:white" -local side_mask = "^[mask:mobs_mc_empty.png\\^[fill\\:16x15\\:0,0\\:white" +local end_rod_mask = "^[mask:mcl_end_end_rod_mask.png" for num, row in ipairs(colored_end_rods) do local name = row[1] local desc = row[2] @@ -168,16 +155,12 @@ for num, row in ipairs(colored_end_rods) do def._doc_items_create_entry = false local side_tex if name == "pink" then - def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" - side_tex = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" + def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. end_rod_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" elseif num > 4 then - def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" - side_tex = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" + def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. end_rod_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" else - def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" - side_tex = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" + def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. end_rod_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" end - for i=3, 6 do def.tiles[i] = side_tex end minetest.register_node(end_rod_name.."_"..name, def) minetest.register_craft({ type = "shapeless", diff --git a/mods/ITEMS/mcl_end/models/mcl_end_rod.obj b/mods/ITEMS/mcl_end/models/mcl_end_rod.obj new file mode 100644 index 000000000..f1050c550 --- /dev/null +++ b/mods/ITEMS/mcl_end/models/mcl_end_rod.obj @@ -0,0 +1,67 @@ +# Blender 3.6.7 +# www.blender.org +o Cube +v 0.125000 -0.437500 -0.125000 +v 0.125000 -0.500000 -0.125000 +v 0.125000 -0.437500 0.125000 +v 0.125000 -0.500000 0.125000 +v -0.125000 -0.437500 -0.125000 +v -0.125000 -0.500000 -0.125000 +v -0.125000 -0.437500 0.125000 +v -0.125000 -0.500000 0.125000 +v -0.062500 -0.437500 0.062500 +v -0.062500 0.500000 0.062500 +v -0.062500 -0.437500 -0.062500 +v -0.062500 0.500000 -0.062500 +v 0.062500 -0.437500 0.062500 +v 0.062500 0.500000 0.062500 +v 0.062500 -0.437500 -0.062500 +v 0.062500 0.500000 -0.062500 +vn -0.0000 1.0000 -0.0000 +vn -0.0000 -0.0000 1.0000 +vn -1.0000 -0.0000 -0.0000 +vn -0.0000 -1.0000 -0.0000 +vn 1.0000 -0.0000 -0.0000 +vn -0.0000 -0.0000 -1.0000 +vt 0.250000 1.000000 +vt -0.000000 1.000000 +vt -0.000000 0.750000 +vt 0.250000 0.750000 +vt 0.250000 0.000000 +vt 0.250000 0.062500 +vt 0.000000 0.062500 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 0.062500 +vt 0.750000 0.062500 +vt 0.750000 0.000000 +vt 0.000000 0.437500 +vt 0.250000 0.437500 +vt 0.250000 0.687500 +vt 0.000000 0.687500 +vt 0.500000 0.000000 +vt 0.500000 0.062500 +vt 1.000000 1.000000 +vt 0.875000 1.000000 +vt 0.875000 0.062500 +vt 0.750000 1.000000 +vt 0.625000 1.000000 +vt 0.625000 0.062500 +vt 0.500000 1.000000 +vt 0.187500 0.812500 +vt 0.187500 0.937500 +vt 0.062500 0.937500 +vt 0.062500 0.812500 +s 0 +f 1/1/1 5/2/1 7/3/1 3/4/1 +f 4/5/2 3/6/2 7/7/2 8/8/2 +f 8/9/3 7/10/3 5/11/3 6/12/3 +f 6/13/4 2/14/4 4/15/4 8/16/4 +f 2/17/5 1/18/5 3/6/5 4/5/5 +f 6/12/6 5/11/6 1/18/6 2/17/6 +f 9/10/3 10/19/3 12/20/3 11/21/3 +f 11/21/6 12/20/6 16/22/6 15/11/6 +f 15/11/5 16/22/5 14/23/5 13/24/5 +f 13/24/2 14/23/2 10/25/2 9/18/2 +f 11/26/4 15/27/4 13/28/4 9/29/4 +f 16/27/1 12/28/1 10/29/1 14/26/1 diff --git a/textures/mcl_end_end_rod.png b/textures/mcl_end_end_rod.png new file mode 100644 index 0000000000000000000000000000000000000000..5e5907a013930561fd6ee25b061facd2991653e4 GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`L7py-Ar_~TSA6pN(cdF^;lTOW z)BhhI=27r9;0t5+%l+5SAAFo)Puz}O-|g+rIB*DK3 jBwT3-WOn0K;A3FOyz@>$lHq?CP$h$>tDnm{r-UW|`i~TM literal 0 HcmV?d00001 diff --git a/textures/mcl_end_end_rod_side.png b/textures/mcl_end_end_rod_side.png deleted file mode 100644 index b6a9fdf977c70bb06ef08526615caa37e91be873..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 103 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|dY&$hAr*|te|BbDGHW(`e7^GR zmTLv2`n{%qDos9_1jwyno^Rsezcw_EQzesuL6leR3m?Dp1fWg^Pgg&ebxsLQ06Hff A5C8xG diff --git a/textures/mcl_end_end_rod_top.png b/textures/mcl_end_end_rod_top.png deleted file mode 100644 index 1485a8a261f2c3216538a1dc559e6611f5dbc1de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|a-J@ZAr*|tD?WKCa86vG7;^Z0 k?CHji6y7hN53gWjIP9hIB4XwC%|Mk5p00i_>zopr0D+i_@%