Finish nexus block and pedestal.
The full receiver node is now gone. The pedestal itself is a connecting nodebox and adds 4 little "holders" if the nexus block is above. Right-click accepting code is now really simple. We should probably handle punch/left click of the node on the pedestal as well to make it simple for all users.
This commit is contained in:
parent
d19d5b55b7
commit
e2b531fa9d
@ -468,15 +468,15 @@ minetest.register_chatcommand("open", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("boxes:findme_item", {
|
minetest.register_node("boxes:nexus", {
|
||||||
description = "Put me inside receivers",
|
description = "Put me on a Nexus Pedestal",
|
||||||
drawtype = "mesh",
|
drawtype = "mesh",
|
||||||
mesh = "nexusblock.obj",
|
mesh = "nexus.obj",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
tiles = {
|
tiles = {
|
||||||
{
|
{
|
||||||
name = "secret.png",
|
name = "nexus.png",
|
||||||
animation = {
|
animation = {
|
||||||
type = "sheet_2d",
|
type = "sheet_2d",
|
||||||
frames_w = 5,
|
frames_w = 5,
|
||||||
@ -493,35 +493,37 @@ minetest.register_node("boxes:findme_item", {
|
|||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-3/8, -3/8, -3/8, 3/8, 3/8, 3/8},
|
fixed = {-3/8, -3/8, -3/8, 3/8, 3/8, 3/8},
|
||||||
},
|
},
|
||||||
group = {node = 0, secret = 1},
|
group = {node = 0, nexus = 1},
|
||||||
--FIXME: onplace for pedestal:
|
|
||||||
-- only on top of empty pedestals
|
|
||||||
-- make param2 random between 0-23
|
|
||||||
-- trigger complete check?
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("boxes:item_receiver", {
|
minetest.register_node("boxes:pedestal", {
|
||||||
description = "Item receiver",
|
description = "Nexus Pedestal",
|
||||||
tiles = {"I_need_textures_too.png"},
|
tiles = {"bricks_marble.png"},
|
||||||
groups = {node = 1}, -- remove node group if no longer a full node
|
drawtype = "nodebox",
|
||||||
|
node_box = {
|
||||||
|
type = "connected",
|
||||||
|
fixed = {{-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}},
|
||||||
|
connect_top = {
|
||||||
|
{-1/2, 1/2, -1/2, -1/4, 3/4, -1/4},
|
||||||
|
{1/4, 1/2, -1/2, 1/2, 3/4, -1/4},
|
||||||
|
{-1/2, 1/2, 1/4, -1/4, 3/4, 1/2},
|
||||||
|
{1/4, 1/2, 1/4, 1/2, 3/4, 1/2},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
connects_to = {"boxes:nexus"},
|
||||||
|
groups = {node = 1},
|
||||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||||
if itemstack:get_name() ~= "boxes:findme_item" then
|
if itemstack:get_name() ~= "boxes:nexus" then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
node.name = "boxes:item_receiver_full"
|
minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z},
|
||||||
minetest.swap_node(pos, node)
|
{name = "boxes:nexus", param2 = math.random(24) - 1})
|
||||||
boxes.increase_items(clicker)
|
boxes.increase_items(clicker)
|
||||||
return itemstack
|
return itemstack
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("boxes:item_receiver_full", {
|
|
||||||
description = "Item receiver (full)",
|
|
||||||
tiles = {"I_need_textures_as_well.png"},
|
|
||||||
groups = {node = 1}, -- remove node group if no longer a full node
|
|
||||||
})
|
|
||||||
|
|
||||||
-- This is only still needed if we want to change the size, the entry, or the
|
-- This is only still needed if we want to change the size, the entry, or the
|
||||||
-- exit of the lobbies; changing the contents can be done by /edite.
|
-- exit of the lobbies; changing the contents can be done by /edite.
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Loading…
x
Reference in New Issue
Block a user