From 14610d57f35f607fce40367799e7a05e341b0781 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sat, 20 Mar 2021 10:58:49 +0100 Subject: [PATCH] Adapt use_texture_alpha for MT 5.3 and 5.4 --- bot_sensor.lua | 4 ++-- cart_sensor.lua | 4 ++-- changer.lua | 2 +- cmd_place.lua | 2 +- cmd_sign.lua | 2 +- crop_sensor.lua | 4 ++-- delayer.lua | 6 +++--- extender.lua | 4 ++-- init.lua | 3 +++ logic_and.lua | 6 +++--- node_sensor.lua | 4 ++-- robot.lua | 6 +++--- signs.lua | 2 +- timer.lua | 4 ++-- 14 files changed, 28 insertions(+), 25 deletions(-) diff --git a/bot_sensor.lua b/bot_sensor.lua index db470f6..0d2e90f 100644 --- a/bot_sensor.lua +++ b/bot_sensor.lua @@ -54,7 +54,7 @@ minetest.register_node("signs_bot:bot_sensor", { paramtype = "light", sunlight_propagates = true, paramtype2 = "facedir", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, is_ground_content = false, groups = {sign_bot_sensor = 1, cracky = 1}, sounds = default.node_sound_metal_defaults(), @@ -98,7 +98,7 @@ minetest.register_node("signs_bot:bot_sensor_on", { paramtype = "light", sunlight_propagates = true, paramtype2 = "facedir", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, is_ground_content = false, diggable = false, groups = {sign_bot_sensor = 1, not_in_creative_inventory = 1}, diff --git a/cart_sensor.lua b/cart_sensor.lua index 0af469a..b3c4a30 100644 --- a/cart_sensor.lua +++ b/cart_sensor.lua @@ -92,7 +92,7 @@ minetest.register_node("signs_bot:cart_sensor", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -123,7 +123,7 @@ minetest.register_node("signs_bot:cart_sensor_on", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, diff --git a/changer.lua b/changer.lua index b180c61..6baa9c8 100644 --- a/changer.lua +++ b/changer.lua @@ -145,7 +145,7 @@ for idx = 1,4 do on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, diff --git a/cmd_place.lua b/cmd_place.lua index 79c2267..b9393c2 100644 --- a/cmd_place.lua +++ b/cmd_place.lua @@ -422,7 +422,7 @@ minetest.register_node("signs_bot:torch", { "group:bakedclay", "group:soil"}, paramtype = "light", paramtype2 = "facedir", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, walkable = false, liquids_pointable = false, diff --git a/cmd_sign.lua b/cmd_sign.lua index a66c010..8917dab 100644 --- a/cmd_sign.lua +++ b/cmd_sign.lua @@ -172,7 +172,7 @@ minetest.register_node("signs_bot:sign_cmnd", { after_dig_node = lib.after_dig_sign_node, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, is_ground_content = false, drop = "", diff --git a/crop_sensor.lua b/crop_sensor.lua index baf1ff2..b009aca 100644 --- a/crop_sensor.lua +++ b/crop_sensor.lua @@ -85,7 +85,7 @@ minetest.register_node("signs_bot:crop_sensor", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -116,7 +116,7 @@ minetest.register_node("signs_bot:crop_sensor_on", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, diff --git a/delayer.lua b/delayer.lua index 23996a6..7d39c29 100644 --- a/delayer.lua +++ b/delayer.lua @@ -169,7 +169,7 @@ minetest.register_node("signs_bot:delayer", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -201,7 +201,7 @@ minetest.register_node("signs_bot:delayer_loaded", { paramtype = "light", sunlight_propagates = true, paramtype2 = "facedir", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, is_ground_content = false, diggable = false, groups = {sign_bot_sensor = 1, not_in_creative_inventory = 1}, @@ -229,7 +229,7 @@ minetest.register_node("signs_bot:delayer_on", { paramtype = "light", sunlight_propagates = true, paramtype2 = "facedir", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, is_ground_content = false, diggable = false, groups = {sign_bot_sensor = 1, not_in_creative_inventory = 1}, diff --git a/extender.lua b/extender.lua index 4486798..61c3063 100644 --- a/extender.lua +++ b/extender.lua @@ -56,7 +56,7 @@ minetest.register_node("signs_bot:sensor_extender", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -105,7 +105,7 @@ minetest.register_node("signs_bot:sensor_extender_on", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, diff --git a/init.lua b/init.lua index 6965f9c..4a2a5f6 100644 --- a/init.lua +++ b/init.lua @@ -17,6 +17,9 @@ signs_bot = {} -- Version for compatibility checks, see readme.md/history signs_bot.version = 1.06 +-- Test for MT 5.4 new string mode +signs_bot.CLIP = minetest.features.use_texture_alpha_string_modes and "clip" or true + if minetest.global_exists("techage") and techage.version < 0.25 then error("[signs_bot] Signs Bot requires techage version 0.25 or newer!") end diff --git a/logic_and.lua b/logic_and.lua index 2159af7..3a8fcde 100644 --- a/logic_and.lua +++ b/logic_and.lua @@ -169,7 +169,7 @@ minetest.register_node("signs_bot:and1", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -197,7 +197,7 @@ minetest.register_node("signs_bot:and2", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -224,7 +224,7 @@ minetest.register_node("signs_bot:and3", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, diff --git a/node_sensor.lua b/node_sensor.lua index fe4aeb6..519f4b3 100644 --- a/node_sensor.lua +++ b/node_sensor.lua @@ -147,7 +147,7 @@ minetest.register_node("signs_bot:node_sensor", { on_receive_fields = on_receive_fields, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -179,7 +179,7 @@ minetest.register_node("signs_bot:node_sensor_on", { on_receive_fields = on_receive_fields, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, diff --git a/robot.lua b/robot.lua index 4fd375a..b305606 100644 --- a/robot.lua +++ b/robot.lua @@ -71,7 +71,7 @@ minetest.register_node("signs_bot:robot", { }, paramtype2 = "facedir", paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, is_ground_content = false, drop = "", @@ -92,7 +92,7 @@ minetest.register_node("signs_bot:robot_leg", { }, paramtype2 = "facedir", paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, is_ground_content = false, drop = "", @@ -112,7 +112,7 @@ minetest.register_node("signs_bot:robot_foot", { }, paramtype2 = "facedir", paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, is_ground_content = false, drop = "", diff --git a/signs.lua b/signs.lua index 1bd07c8..def287c 100644 --- a/signs.lua +++ b/signs.lua @@ -53,7 +53,7 @@ local function register_sign(def) end, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, sign_bot_sign = 1}, diff --git a/timer.lua b/timer.lua index 59ccb55..7a09888 100644 --- a/timer.lua +++ b/timer.lua @@ -157,7 +157,7 @@ minetest.register_node("signs_bot:timer", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false, @@ -184,7 +184,7 @@ minetest.register_node("signs_bot:timer_on", { update_infotext = update_infotext, on_rotate = screwdriver.disallow, paramtype = "light", - use_texture_alpha = "clip", + use_texture_alpha = signs_bot.CLIP, sunlight_propagates = true, paramtype2 = "facedir", is_ground_content = false,