summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2023-08-08 17:43:00 -0500
committercheapie <no-email-for-you@example.com>2023-08-08 17:43:00 -0500
commitfc6979807e9cd6ffd4d7d6e6f0723299cda392c8 (patch)
treeb2c3761f6d05513a4143f5c2116c80db2fec456a
parente1e3a599662ab954c514cb5d742661564fb86fc8 (diff)
downloadcelevator-fc6979807e9cd6ffd4d7d6e6f0723299cda392c8.tar
celevator-fc6979807e9cd6ffd4d7d6e6f0723299cda392c8.tar.gz
celevator-fc6979807e9cd6ffd4d7d6e6f0723299cda392c8.tar.bz2
celevator-fc6979807e9cd6ffd4d7d6e6f0723299cda392c8.tar.xz
celevator-fc6979807e9cd6ffd4d7d6e6f0723299cda392c8.zip
Improve call button/lantern/PI nodeboxes
They now mount to the front of a node instead of having to poke through a slab.
-rw-r--r--callbuttons.lua3
-rw-r--r--pilantern.lua16
2 files changed, 6 insertions, 13 deletions
diff --git a/callbuttons.lua b/callbuttons.lua
index e41f863..fb2fd6e 100644
--- a/callbuttons.lua
+++ b/callbuttons.lua
@@ -132,8 +132,7 @@ for _,state in ipairs(validstates) do
node_box = {
type = "fixed",
fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
- {-0.16, -0.37,-0.59, 0.17, 0.13,-0.5 },
+ {-0.16,-0.37,0.475,0.17,0.13,0.5},
},
},
on_rightclick = function(pos,_,clicker)
diff --git a/pilantern.lua b/pilantern.lua
index 8a9f3fd..6a88861 100644
--- a/pilantern.lua
+++ b/pilantern.lua
@@ -14,10 +14,7 @@ minetest.register_entity("celevator:pi_entity",{
})
local function removeentity(pos)
- local node = minetest.get_node(pos)
- local facedir = vector.rotate_around_axis(minetest.facedir_to_dir(node.param2),vector.new(0,-1,0),math.pi)
- local epos = vector.add(pos,facedir)
- local entitiesnearby = minetest.get_objects_inside_radius(epos,0.5)
+ local entitiesnearby = minetest.get_objects_inside_radius(pos,0.5)
for _,i in pairs(entitiesnearby) do
if i:get_luaentity() and i:get_luaentity().name == "celevator:pi_entity" then
i:remove()
@@ -62,7 +59,7 @@ function celevator.pi.updatedisplay(pos)
end
entity:set_properties({textures={etex}})
entity:set_yaw((fdir.x ~= 0) and math.pi/2 or 0)
- entity:set_pos(vector.add(pos,vector.multiply(fdir,-0.61)))
+ entity:set_pos(vector.add(pos,vector.multiply(fdir,0.47)))
end
function celevator.pi.flash(pos,what)
@@ -122,8 +119,7 @@ minetest.register_node("celevator:pi",{
node_box = {
type = "fixed",
fixed = {
- { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
- {-0.25,-0.453, -0.6,0.25,-0.125, -0.5 },
+ {-0.25,-0.453,0.475,0.25,-0.125,0.5},
},
},
on_destruct = removeentity,
@@ -274,8 +270,7 @@ for _,state in ipairs(validstates) do
node_box = {
type = "fixed",
fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
- {-0.25, -0.5,-0.59, 0.25,0.125, -0.5 },
+ {-0.25,-0.5,0.475,0.25,0.125,0.5},
},
},
})
@@ -311,8 +306,7 @@ for _,state in ipairs(validstates) do
node_box = {
type = "fixed",
fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
- {-0.25,-0.328,-0.59, 0.25, 0, -0.5 },
+ {-0.25,-0.328,0.475,0.25,0,0.5},
},
},
})