From 5618003be30951233ea575cca56789f6d32385f5 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Mon, 7 Feb 2022 15:53:29 +1100 Subject: [PATCH] fix remaining `use_texture_alpha` warnings extension of d2954c52, using the same compatibility check for now, though it would be good to bump the minimum minetest version to 5.4 at some point fixes #11 --- devices.lua | 5 +++++ routing_tubes.lua | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/devices.lua b/devices.lua index 6e6b6e4..0acbc76 100644 --- a/devices.lua +++ b/devices.lua @@ -1,6 +1,8 @@ local S = minetest.get_translator("pipeworks") local new_flow_logic_register = pipeworks.flowables.register +local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes + local polys = "" if pipeworks.enable_lowpoly then polys = "_lowpoly" end @@ -142,6 +144,7 @@ for s in ipairs(states) do drawtype = "mesh", mesh = "pipeworks_pump"..polys..".obj", tiles = { "pipeworks_pump_"..states[s]..".png" }, + use_texture_alpha = texture_alpha_mode and "clip" or true, paramtype = "light", paramtype2 = "facedir", groups = dgroups, @@ -286,6 +289,7 @@ minetest.register_node("pipeworks:grating", { "pipeworks_grating_sides.png", "pipeworks_grating_sides.png" }, + use_texture_alpha = texture_alpha_mode and "clip" or true, drawtype = "nodebox", node_box = { type = "fixed", @@ -357,6 +361,7 @@ minetest.register_node(nodename_spigot_loaded, { }, { name = "pipeworks_spigot.png" } }, + use_texture_alpha = texture_alpha_mode and "blend" or true, sunlight_propagates = true, paramtype = "light", paramtype2 = "facedir", diff --git a/routing_tubes.lua b/routing_tubes.lua index e7bc596..a99d1c3 100644 --- a/routing_tubes.lua +++ b/routing_tubes.lua @@ -163,11 +163,15 @@ if pipeworks.enable_crossing_tube then }) end +local texture_alpha_mode = minetest.features.use_texture_alpha_string_modes + and "clip" or true + if pipeworks.enable_one_way_tube then minetest.register_node("pipeworks:one_way_tube", { description = S("One way tube"), tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png", "pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"}, + use_texture_alpha = texture_alpha_mode, paramtype2 = "facedir", drawtype = "nodebox", paramtype = "light",