Skip to content

Commit

Permalink
Add compatibility code
Browse files Browse the repository at this point in the history
  • Loading branch information
MoNTE48 committed Dec 28, 2024
1 parent e46ad8c commit 3868307
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions mesecons_extrawires/vertical.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ local bottom_rules = {
{x=0, y=2, z=0} -- receive power from pressure plate / detector / ... 2 nodes above
}

local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or nil

local function is_vertical_conductor(nodename)
local def = minetest.registered_nodes[nodename]
return def and def.is_vertical_conductor
Expand Down Expand Up @@ -96,7 +98,7 @@ mesecon.register_node("mesecons_extrawires:vertical", {
after_place_node = vertical_update,
after_dig_node = vertical_update,
sounds = mesecon.node_sound.default,
use_texture_alpha = "clip",
use_texture_alpha = use_texture_alpha,
},{
tiles = {"mesecons_wire_off.png"},
groups = {dig_immediate=3},
Expand Down Expand Up @@ -131,7 +133,7 @@ mesecon.register_node("mesecons_extrawires:vertical_top", {
after_place_node = vertical_update,
after_dig_node = vertical_update,
sounds = mesecon.node_sound.default,
use_texture_alpha = "clip",
use_texture_alpha = use_texture_alpha,
},{
tiles = {"mesecons_wire_off.png"},
mesecons = {conductor = {
Expand Down Expand Up @@ -164,7 +166,7 @@ mesecon.register_node("mesecons_extrawires:vertical_bottom", {
after_place_node = vertical_update,
after_dig_node = vertical_update,
sounds = mesecon.node_sound.default,
use_texture_alpha = "clip",
use_texture_alpha = use_texture_alpha,
},{
tiles = {"mesecons_wire_off.png"},
mesecons = {conductor = {
Expand Down
6 changes: 4 additions & 2 deletions mesecons_receiver/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ local receiver_get_rules = mesecon.horiz_rules_getter({
{x = 0, y = 0, z = -2},
})

local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or nil

mesecon.register_node("mesecons_receiver:receiver", {
drawtype = "nodebox",
paramtype = "light",
Expand Down Expand Up @@ -98,7 +100,7 @@ mesecon.register_node("mesecons_receiver:receiver_up", {
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
drop = "mesecons:wire_00000000_off",
sounds = mesecon.node_sound.default,
use_texture_alpha = "clip",
use_texture_alpha = use_texture_alpha,
}, {
tiles = {"mesecons_wire_off.png"},
mesecons = {conductor = {
Expand Down Expand Up @@ -144,7 +146,7 @@ mesecon.register_node("mesecons_receiver:receiver_down", {
groups = {dig_immediate = 3, not_in_creative_inventory = 1},
drop = "mesecons:wire_00000000_off",
sounds = mesecon.node_sound.default,
use_texture_alpha = "clip",
use_texture_alpha = use_texture_alpha,
}, {
tiles = {"mesecons_wire_off.png"},
mesecons = {conductor = {
Expand Down

0 comments on commit 3868307

Please sign in to comment.