From 8f3c416920163137f2158e23ff8b5414f6fe931e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 24 Feb 2021 16:27:30 +0100 Subject: [PATCH] Fix 5.4.0 texture alpha deprecations --- mods/anvil/init.lua | 1 + mods/bonfire/init.lua | 2 ++ mods/core/stairs_and_slabs.lua | 4 ++++ mods/decorations/init.lua | 7 +++++++ mods/default/init.lua | 7 ++++--- mods/doors/init.lua | 4 ++++ mods/farming/init.lua | 3 +++ mods/flowers_plus/init.lua | 3 +++ mods/light/init.lua | 1 + mods/scaffolding/init.lua | 2 ++ mods/tnt/init.lua | 2 ++ mods/xpanes/init.lua | 2 ++ 12 files changed, 35 insertions(+), 3 deletions(-) diff --git a/mods/anvil/init.lua b/mods/anvil/init.lua index eda26ea..5578b2d 100644 --- a/mods/anvil/init.lua +++ b/mods/anvil/init.lua @@ -209,6 +209,7 @@ for _, anvil in ipairs(anvils) do minetest.register_node("anvil:anvil_"..anvil[1], { description = anvil[2] .. " Anvil", tiles = {"anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_top.png","anvil_"..anvil[1].."_side.png"}, + use_texture_alpha = "clip", drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", diff --git a/mods/bonfire/init.lua b/mods/bonfire/init.lua index 33deb52..3fd38a4 100644 --- a/mods/bonfire/init.lua +++ b/mods/bonfire/init.lua @@ -31,6 +31,7 @@ realtest.add_bonfire_fuel("minerals:charcoal") minetest.register_node("bonfire:self", { description = "Bonfire", tiles = {"bonfire_top.png", "bonfire_bottom.png", "bonfire_side.png"}, + use_texture_alpha = "clip", particle_image = {"bonfire_bottom.png"}, drawtype = "nodebox", paramtype = "light", @@ -77,6 +78,7 @@ minetest.register_node("bonfire:self_active", { {name="bonfire_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.8}}, }, + use_texture_alpha = "clip", particle_image = {"bonfire_bottom.png"}, drawtype = "nodebox", paramtype = "light", diff --git a/mods/core/stairs_and_slabs.lua b/mods/core/stairs_and_slabs.lua index ef8abbd..4a32b2e 100644 --- a/mods/core/stairs_and_slabs.lua +++ b/mods/core/stairs_and_slabs.lua @@ -15,6 +15,7 @@ function realtest.register_stair(name, recipeitem, groups, images, description, description = description, drawtype = "nodebox", tiles = images, + use_texture_alpha = "clip", drop = drop, paramtype = "light", paramtype2 = "facedir", @@ -58,6 +59,7 @@ function realtest.register_stair(name, recipeitem, groups, images, description, drop = drop, drawtype = "nodebox", tiles = images, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "facedir", groups = groups, @@ -114,6 +116,7 @@ function realtest.register_slab(name, recipeitem, groups, images, description, s minetest.register_node(":"..name.."_slab_r", { drawtype = "nodebox", tiles = images, + use_texture_alpha = "clip", drop = drop, paramtype = "light", paramtype2 = "wallmounted", @@ -139,6 +142,7 @@ function realtest.register_slab(name, recipeitem, groups, images, description, s groups = groups, sounds = sounds, tiles = images, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "facedir", node_box = { diff --git a/mods/decorations/init.lua b/mods/decorations/init.lua index 685a6be..ac91c24 100644 --- a/mods/decorations/init.lua +++ b/mods/decorations/init.lua @@ -50,6 +50,7 @@ for _, mineral in ipairs(decor_minerals) do collision_box = pyr_cbox, paramtype = "light", tiles = {"decorations_"..mineral[1]..".png"}, + use_texture_alpha = "clip", particle_image = {"minerals_"..mineral[1]..".png"}, groups = {cracky = 3}, sounds = default.node_sound_stone_defaults(), @@ -66,6 +67,7 @@ for _, mineral in ipairs(decor_minerals) do "decorations_"..mineral[1]..".png", tree.textures.planks }, + use_texture_alpha = "clip", groups = {cracky=3, oddly_breakable_by_hand = 2}, sounds = default.node_sound_stone_defaults(), }) @@ -87,6 +89,7 @@ for _, mineral in ipairs(decor_minerals) do "decorations_"..mineral[1]..".png", "decorations_"..mineral[1].."_casket_front.png" }, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "facedir", selection_box = casket_cbox, @@ -233,6 +236,7 @@ for _, mineral in ipairs(decor_minerals) do mesh = "decorations_cylinder.obj", paramtype = "light", tiles = {"decorations_"..mineral[1]..".png"}, + use_texture_alpha = "clip", particle_image = {"minerals_"..mineral[1]..".png"}, groups = {cracky=3}, sounds = default.node_sound_stone_defaults(), @@ -244,6 +248,7 @@ for _, mineral in ipairs(decor_minerals) do mesh = "decorations_vase.obj", paramtype = "light", tiles = {"decorations_"..mineral[1]..".png"}, + use_texture_alpha = "clip", groups = {cracky=3, oddly_breakable_by_hand = 2}, sounds = default.node_sound_stone_defaults(), }) @@ -256,6 +261,7 @@ for _, mineral in ipairs(decor_minerals) do collision_box = bowl_cbox, paramtype = "light", tiles = {"decorations_"..mineral[1]..".png"}, + use_texture_alpha = "clip", groups = {cracky=3, oddly_breakable_by_hand = 2}, sounds = default.node_sound_stone_defaults(), }) @@ -272,6 +278,7 @@ for _, mineral in ipairs(decor_minerals) do {name="decorations_coals.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}, "decorations_"..mineral[1]..".png" }, + use_texture_alpha = "clip", groups = {cracky=3, oddly_breakable_by_hand = 2}, sounds = default.node_sound_stone_defaults(), }) diff --git a/mods/default/init.lua b/mods/default/init.lua index a0fe925..79e6edf 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -3,7 +3,6 @@ -- The API documentation in here was moved into doc/lua_api.txt -local WATER_ALPHA = 160 local WATER_VISC = 1 local LAVA_VISC = 7 @@ -297,6 +296,7 @@ minetest.register_node("default:brick", { minetest.register_node("default:cactus", { description = "Cactus", tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, + use_texture_alpha = "clip", groups = {snappy=2,choppy=3,flammable=2,dropping_node=1,drop_on_dig=1}, drawtype = "nodebox", paramtype = "light", @@ -434,6 +434,7 @@ minetest.register_node("default:glass", { description = "Glass", drawtype = "glasslike", tiles = {"default_glass.png"}, + use_texture_alpha = "clip", particle_image = {"default_glass.png"}, paramtype = "light", sunlight_propagates = true, @@ -459,7 +460,7 @@ minetest.register_node("default:water_flowing", { animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8} }, }, - alpha = WATER_ALPHA, + use_texture_alpha = "blend", paramtype = "light", walkable = false, pointable = false, @@ -485,8 +486,8 @@ minetest.register_node("default:water_source", { -- New-style water source material (mostly unused) {name="default_water.png", backface_culling=false}, }, + use_texture_alpha = "blend", drop = "", - alpha = WATER_ALPHA, paramtype = "light", walkable = false, pointable = false, diff --git a/mods/doors/init.lua b/mods/doors/init.lua index d47f980..d0e194f 100644 --- a/mods/doors/init.lua +++ b/mods/doors/init.lua @@ -128,6 +128,7 @@ function doors:register_door(name, def) minetest.register_node(name.."_b_1", { tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "facedir", drop = name, @@ -159,6 +160,7 @@ function doors:register_door(name, def) minetest.register_node(name.."_t_1", { tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "facedir", drop = name, @@ -190,6 +192,7 @@ function doors:register_door(name, def) minetest.register_node(name.."_b_2", { tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "facedir", drop = name, @@ -221,6 +224,7 @@ function doors:register_door(name, def) minetest.register_node(name.."_t_2", { tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "facedir", drop = name, diff --git a/mods/farming/init.lua b/mods/farming/init.lua index a9246e8..3145da0 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -44,6 +44,7 @@ for i=1,4 do drawtype = "nodebox", description = desc.." Seeds", tiles = {"farming_seed_placed.png","blank.png"}, + use_texture_alpha = "clip", inventory_image = "farming_"..name.."_seed.png", groups = {snappy=3, plant=1, attached_node=1}, sounds = default.node_sound_defaults(), @@ -170,6 +171,7 @@ minetest.register_node("farming:cake", { drawtype = "nodebox", description = "Cake", tiles = {"farming_cake_top.png","farming_cake_base.png","farming_cake_side.png"}, + use_texture_alpha = "clip", groups = {crumbly=3}, sounds = default.node_sound_defaults(), paramtype = "light", @@ -332,6 +334,7 @@ minetest.register_node("farming:rope",{ drawtype = "nodebox", sunlight_propagates = true, tiles = {"farming_rope.png"}, + use_texture_alpha = "clip", inventory_image = "farming_rope_inv.png", wield_image = "farming_rope_inv.png", groups = {choppy=3,snappy=3,oddly_breakable_by_hand=3,flammable=1}, diff --git a/mods/flowers_plus/init.lua b/mods/flowers_plus/init.lua index d7e78d3..6f09f06 100644 --- a/mods/flowers_plus/init.lua +++ b/mods/flowers_plus/init.lua @@ -46,6 +46,7 @@ for i in ipairs(lilies_list) do "flowers_waterlily"..deg2..".png", "flowers_waterlily"..deg2..".png^[transformFY" }, + use_texture_alpha = "clip", inventory_image = "flowers_waterlily.png", wield_image = "flowers_waterlily.png", sunlight_propagates = true, @@ -146,6 +147,7 @@ for i in ipairs(algae_list) do "flowers_seaweed"..num..".png", "flowers_seaweed"..num..".png^[transformFY" }, + use_texture_alpha = "clip", inventory_image = "flowers_seaweed_2.png", wield_image = "flowers_seaweed_2.png", sunlight_propagates = true, @@ -238,6 +240,7 @@ minetest.register_node(":flowers:sunflower", { inventory_image = "flowers_sunflower_inv.png", mesh = "flowers_sunflower.obj", tiles = { "flowers_sunflower.png" }, + use_texture_alpha = "clip", walkable = false, buildable_to = true, is_ground_content = true, diff --git a/mods/light/init.lua b/mods/light/init.lua index 8cad85d..e0d5190 100644 --- a/mods/light/init.lua +++ b/mods/light/init.lua @@ -2,6 +2,7 @@ minetest.register_node("light:streetlight", { description = "Streetlight", drawtype = "nodebox", tiles = {"light_streetlight_top.png", "light_streetlight_top.png", "light_streetlight.png",}, + use_texture_alpha = "clip", paramtype = "light", sunlight_propagates = true, light_source = 14, diff --git a/mods/scaffolding/init.lua b/mods/scaffolding/init.lua index ccb9fb7..fa56b46 100644 --- a/mods/scaffolding/init.lua +++ b/mods/scaffolding/init.lua @@ -47,6 +47,7 @@ for i, tree_name in ipairs(realtest.registered_trees_list) do }, }, tiles = {texture_top, texture_bottom, texture_side, texture_side, texture_side, texture_side}, + use_texture_alpha = "clip", drop = "scaffolding:scaffolding_"..tree.name:remove_modname_prefix(), paramtype = "light", sunlight_propagates = false, @@ -70,6 +71,7 @@ for i, tree_name in ipairs(realtest.registered_trees_list) do local scaffolding_sub = copy_table(scaffolding_top) scaffolding_sub.tiles = {texture_side, texture_side, texture_side, texture_side, texture_side, texture_side} + scaffolding_sub.use_texture_alpha = "clip" scaffolding_sub.sunlight_propagates = true minetest.register_node("scaffolding:scaffolding_"..tree.name:remove_modname_prefix(), scaffolding) diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index 7fed5f6..b5c8a62 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -112,6 +112,7 @@ minetest.register_node("tnt:tnt", { }, }, tiles = {"tnt_top.png", "tnt_bottom.png", "tnt_side.png"}, + use_texture_alpha = "clip", groups = {dig_immediate=2, mesecon=2, falling_node=1}, sounds = default.node_sound_wood_defaults(), on_punch = function(pos, node, puncher) @@ -147,6 +148,7 @@ minetest.register_node("tnt:tnt_burning", { }, }, tiles = {"tnt_top_burning.png", "tnt_bottom.png", "tnt_side.png"}, + use_texture_alpha = "clip", light_source = 5, drop = "", groups = {falling_node=1}, diff --git a/mods/xpanes/init.lua b/mods/xpanes/init.lua index 968771c..feac5b6 100644 --- a/mods/xpanes/init.lua +++ b/mods/xpanes/init.lua @@ -72,6 +72,7 @@ for i = 1, 15 do minetest.register_node("xpanes:pane_"..i, { drawtype = "nodebox", tiles = {"xpanes_white.png", "xpanes_white.png", texture}, + use_texture_alpha = "clip", paramtype = "light", groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,drop_on_dig=1}, drop = "xpanes:pane", @@ -90,6 +91,7 @@ end minetest.register_node("xpanes:pane", { description = "Glass Pane", tiles = {"xpanes_space.png"}, + use_texture_alpha = "clip", inventory_image = "xpanes_pane.png", wield_image = "xpanes_pane.png", node_placement_prediction = "",