From bf10290b3996fbb3b3ca48c80e8f8fce6d5e423e Mon Sep 17 00:00:00 2001 From: luk3yx Date: Tue, 5 Mar 2024 10:10:35 +1300 Subject: [PATCH] Use xcompat for steel block texture --- mod.conf | 2 +- nodes.lua | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mod.conf b/mod.conf index 509403c..1bd89fb 100644 --- a/mod.conf +++ b/mod.conf @@ -1,3 +1,3 @@ name = snippets -optional_depends = cloaking, default, fs51 +optional_depends = cloaking, fs51, xcompat supported_games = * diff --git a/nodes.lua b/nodes.lua index 647bdf8..ab61fa7 100644 --- a/nodes.lua +++ b/nodes.lua @@ -3,12 +3,9 @@ -- -- Use steel block texture in minetest_game -local bg -if minetest.registered_nodes['default:steelblock'] then - bg = 'default_steel_block.png' -else - bg = '[combine:1x1^[noalpha^[colorize:#aaa' -end +local bg = minetest.global_exists('xcompat') and xcompat.textures and + xcompat.textures.metal.steel.block or + '[combine:1x1^[noalpha^[colorize:#aaa' minetest.register_node('snippets:button', { description = 'Snippets button',