Fix texture without minetest_game installed

This commit is contained in:
luk3yx 2021-04-14 10:57:35 +12:00
parent 7ce4be4383
commit 5e2662571e
2 changed files with 10 additions and 3 deletions

View File

@ -1,2 +1,2 @@
name = snippets
optional_depends = cloaking, fs51
optional_depends = cloaking, default, fs51

View File

@ -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)