mirror of
https://github.com/minetest-mods/craftguide.git
synced 2025-01-07 10:50:17 +01:00
Add wall-mounted sign
This commit is contained in:
parent
109116143b
commit
6e4624a0d7
47
init.lua
47
init.lua
@ -378,13 +378,7 @@ mt.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
mt.register_craftitem("craftguide:book", {
|
function craftguide:on_use(itemstack, user)
|
||||||
description = "Crafting Guide",
|
|
||||||
inventory_image = "craftguide_book.png",
|
|
||||||
wield_image = "craftguide_book.png",
|
|
||||||
stack_max = 1,
|
|
||||||
groups = {book=1},
|
|
||||||
on_use = function(itemstack, user)
|
|
||||||
if not datas.init_items then
|
if not datas.init_items then
|
||||||
craftguide:get_init_items()
|
craftguide:get_init_items()
|
||||||
end
|
end
|
||||||
@ -402,6 +396,38 @@ mt.register_craftitem("craftguide:book", {
|
|||||||
else
|
else
|
||||||
show_formspec(player_name, "craftguide", data.formspec)
|
show_formspec(player_name, "craftguide", data.formspec)
|
||||||
end
|
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_inventory.png",
|
||||||
|
wield_image = "craftguide_sign_inventory.png",
|
||||||
|
stack_max = 1,
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
groups = {wood = 1, oddly_breakable_by_hand = 1, flammable = 3},
|
||||||
|
legacy_wallmounted = true,
|
||||||
|
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_rightclick = function(pos, node, user, itemstack, pointed_thing)
|
||||||
|
craftguide:on_use(itemstack, user)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -417,5 +443,12 @@ mt.register_craft({
|
|||||||
burntime = 3
|
burntime = 3
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mt.register_craft({
|
||||||
|
output = "craftguide:sign",
|
||||||
|
type = "shapeless",
|
||||||
|
recipe = {"default:sign_wall_wood"}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
mt.register_alias("xdecor:crafting_guide", "craftguide:book")
|
mt.register_alias("xdecor:crafting_guide", "craftguide:book")
|
||||||
|
|
||||||
|
BIN
textures/craftguide_sign.png
Normal file
BIN
textures/craftguide_sign.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
textures/craftguide_sign_inventory.png
Normal file
BIN
textures/craftguide_sign_inventory.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
Loading…
Reference in New Issue
Block a user