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,
|
||||
})
|
||||
|
||||
minetest.register_node("boxes:findme_item", {
|
||||
description = "Put me inside receivers",
|
||||
minetest.register_node("boxes:nexus", {
|
||||
description = "Put me on a Nexus Pedestal",
|
||||
drawtype = "mesh",
|
||||
mesh = "nexusblock.obj",
|
||||
mesh = "nexus.obj",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {
|
||||
{
|
||||
name = "secret.png",
|
||||
name = "nexus.png",
|
||||
animation = {
|
||||
type = "sheet_2d",
|
||||
frames_w = 5,
|
||||
@ -493,35 +493,37 @@ minetest.register_node("boxes:findme_item", {
|
||||
type = "fixed",
|
||||
fixed = {-3/8, -3/8, -3/8, 3/8, 3/8, 3/8},
|
||||
},
|
||||
group = {node = 0, secret = 1},
|
||||
--FIXME: onplace for pedestal:
|
||||
-- only on top of empty pedestals
|
||||
-- make param2 random between 0-23
|
||||
-- trigger complete check?
|
||||
group = {node = 0, nexus = 1},
|
||||
})
|
||||
|
||||
minetest.register_node("boxes:item_receiver", {
|
||||
description = "Item receiver",
|
||||
tiles = {"I_need_textures_too.png"},
|
||||
groups = {node = 1}, -- remove node group if no longer a full node
|
||||
minetest.register_node("boxes:pedestal", {
|
||||
description = "Nexus Pedestal",
|
||||
tiles = {"bricks_marble.png"},
|
||||
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)
|
||||
if itemstack:get_name() ~= "boxes:findme_item" then
|
||||
if itemstack:get_name() ~= "boxes:nexus" then
|
||||
return itemstack
|
||||
end
|
||||
itemstack:take_item()
|
||||
node.name = "boxes:item_receiver_full"
|
||||
minetest.swap_node(pos, node)
|
||||
minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{name = "boxes:nexus", param2 = math.random(24) - 1})
|
||||
boxes.increase_items(clicker)
|
||||
return itemstack
|
||||
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
|
||||
-- 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