Add wall-mounted sign

This commit is contained in:
Dirk Sohler 2017-01-30 05:24:03 +01:00 committed by JPG
parent 109116143b
commit 9c8f3fb0d9
3 changed files with 57 additions and 16 deletions

@ -378,13 +378,7 @@ mt.register_on_player_receive_fields(function(player, formname, fields)
end
end)
mt.register_craftitem("craftguide:book", {
description = "Crafting Guide",
inventory_image = "craftguide_book.png",
wield_image = "craftguide_book.png",
stack_max = 1,
groups = {book=1},
on_use = function(itemstack, user)
function craftguide:on_use(itemstack, user)
if not datas.init_items then
craftguide:get_init_items()
end
@ -403,6 +397,41 @@ mt.register_craftitem("craftguide:book", {
show_formspec(player_name, "craftguide", data.formspec)
end
end
mt.register_craftitem("craftguide:book", {
description = "Crafting Guide",
inventory_image = "craftguide_book.png",
wield_image = "craftguide_book.png",
stack_max = 1,
groups = {book=1},
on_use = function(itemstack, user)
craftguide:on_use(itemstack, user)
end
})
mt.register_node("craftguide:sign", {
description = "Crafting Guide Sign",
drawtype = "nodebox",
tiles = {"craftguide_sign.png"},
inventory_image = "craftguide_sign_inv.png",
wield_image = "craftguide_sign_inv.png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
groups = {wood=1, oddly_breakable_by_hand=1, flammable=3},
node_box = {
type = "wallmounted",
wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}
},
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Crafting Guide Sign")
end,
on_rightclick = function(pos, node, user, itemstack)
craftguide:on_use(itemstack, user)
end
})
mt.register_craft({
@ -417,5 +446,17 @@ mt.register_craft({
burntime = 3
})
mt.register_craft({
output = "craftguide:sign",
type = "shapeless",
recipe = {"default:sign_wall_wood"}
})
mt.register_craft({
type = "fuel",
recipe = "craftguide:sign",
burntime = 10
})
mt.register_alias("xdecor:crafting_guide", "craftguide:book")

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B