From 5e2662571eaee78ece15c8b540318a9006ba05ca Mon Sep 17 00:00:00 2001 From: luk3yx Date: Wed, 14 Apr 2021 10:57:35 +1200 Subject: [PATCH] Fix texture without minetest_game installed --- mod.conf | 2 +- nodes.lua | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mod.conf b/mod.conf index dff7c72..03cdaa5 100644 --- a/mod.conf +++ b/mod.conf @@ -1,2 +1,2 @@ name = snippets -optional_depends = cloaking, fs51 +optional_depends = cloaking, default, fs51 diff --git a/nodes.lua b/nodes.lua index 65750bb..647bdf8 100644 --- a/nodes.lua +++ b/nodes.lua @@ -2,10 +2,17 @@ -- Buttons that run snippets -- +-- 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 + minetest.register_node('snippets:button', { description = 'Snippets button', - tiles = {'default_steel_block.png', 'default_steel_block.png', - 'default_steel_block.png^snippets_button.png'}, + tiles = {bg, bg, bg .. '^snippets_button.png'}, groups = {cracky = 2, not_in_creative_inventory = 1}, on_construct = function(pos)