Skip to content

Commit

Permalink
empty sticker added (with space " " as input)
Browse files Browse the repository at this point in the history
  • Loading branch information
OchNoe committed Apr 12, 2020
1 parent ba3b016 commit 277f31d
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ local additional_chars = {
}

local characters = {}
local characters_sticker = {}

ehlphabet = {}
ehlphabet.path = minetest.get_modpath(minetest.get_current_modname())
Expand Down Expand Up @@ -55,6 +56,9 @@ table_merge(characters, cyrillic_chars)
table_merge(characters, greek_chars)
table_merge(characters, additional_chars)

table_merge(characters_sticker, characters)
table.insert(characters_sticker, " ")

local create_alias = true

-- generate all available blocks
Expand Down Expand Up @@ -123,6 +127,37 @@ for _, name in ipairs(characters) do

end

-- empty sticker

local key = "ehlphabet:32"
local file = ("%03d"):format(32)
local desc = S("Ehlphabet Block '@1'", name)

minetest.register_node(
key.."_sticker",
{
description = desc.."Sticker",
tiles = {"ehlphabet_000.png"},
paramtype = "light",
paramtype2 = "wallmounted", -- "colorwallmounted",
on_rotate = screwdriver.rotate_simple ,
drawtype = "nodebox",
is_ground_content = false,
drop = "", -- new
node_box = {
type = "wallmounted",
wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.49, 0.5},
wall_top = {-0.5, 0.49, -0.5, 0.5, 0.5, 0.5},
wall_side = {-0.5, -0.5, -0.5, -0.49, 0.5, 0.5},
},
groups = {attached_node = 1, dig_immediate = 2,
not_in_creative_inventory = 1,
not_blocking_trains = 1 },
}
)



minetest.register_node(
"ehlphabet:machine",
{
Expand Down Expand Up @@ -194,7 +229,11 @@ minetest.register_node(
-- other type in output slot -> abort
return
end
for _, v in pairs(characters) do
local clist = characters
if inputstack:get_name() == "default:paper" then
clist = characters_sticker
end
for _, v in pairs(clist) do
if v == ch then
local give = {}
give[1] = inv:add_item("output", "ehlphabet:" .. key)
Expand Down

0 comments on commit 277f31d

Please sign in to comment.