Fix texture without minetest_game installed
This commit is contained in:
parent
7ce4be4383
commit
5e2662571e
2
mod.conf
2
mod.conf
@ -1,2 +1,2 @@
|
|||||||
name = snippets
|
name = snippets
|
||||||
optional_depends = cloaking, fs51
|
optional_depends = cloaking, default, fs51
|
||||||
|
11
nodes.lua
11
nodes.lua
@ -2,10 +2,17 @@
|
|||||||
-- Buttons that run snippets
|
-- 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', {
|
minetest.register_node('snippets:button', {
|
||||||
description = 'Snippets button',
|
description = 'Snippets button',
|
||||||
tiles = {'default_steel_block.png', 'default_steel_block.png',
|
tiles = {bg, bg, bg .. '^snippets_button.png'},
|
||||||
'default_steel_block.png^snippets_button.png'},
|
|
||||||
groups = {cracky = 2, not_in_creative_inventory = 1},
|
groups = {cracky = 2, not_in_creative_inventory = 1},
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user