mirror of
https://github.com/minetest-mods/technic.git
synced 2024-09-27 15:00:18 +02:00
Update frames.lua
This commit is contained in:
parent
314360b2b3
commit
0674bbea19
|
@ -155,7 +155,7 @@ local function move_nodes_vect(poslist, vect, must_not_move, owner)
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, obj in ipairs(objects) do
|
for _, obj in ipairs(objects) do
|
||||||
obj:setpos(vector.add(obj:getpos(), vect))
|
obj:setpos(vector.add(obj:get_pos(), vect))
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, n in ipairs(nodelist) do
|
for _, n in ipairs(nodelist) do
|
||||||
|
@ -276,7 +276,7 @@ for zp = 0, 1 do
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_punch = function(pos, node, puncher)
|
on_punch = function(pos, node, puncher)
|
||||||
local ppos = puncher:getpos()
|
local ppos = puncher:get_pos()
|
||||||
local pvect = puncher:get_look_dir()
|
local pvect = puncher:get_look_dir()
|
||||||
local pface = get_face(pos, ppos, pvect)
|
local pface = get_face(pos, ppos, pvect)
|
||||||
|
|
||||||
|
@ -431,14 +431,14 @@ minetest.register_entity("technic:frame_entity", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
dig = function(self)
|
dig = function(self)
|
||||||
minetest.handle_node_drops(self.object:getpos(), { ItemStack("technic:frame_111111") }, self.last_puncher)
|
minetest.handle_node_drops(self.object:get_pos(), { ItemStack("technic:frame_111111") }, self.last_puncher)
|
||||||
local pos = vector.round(self.object:getpos())
|
local pos = vector.round(self.object:get_pos())
|
||||||
frames_pos[pos_to_string(pos)] = nil
|
frames_pos[pos_to_string(pos)] = nil
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:get_pos()
|
||||||
if self.damage_object == nil then
|
if self.damage_object == nil then
|
||||||
self.damage_object = minetest.add_entity(pos, "technic:damage_entity")
|
self.damage_object = minetest.add_entity(pos, "technic:damage_entity")
|
||||||
self.damage_object:get_luaentity().remaining_time = 0.25
|
self.damage_object:get_luaentity().remaining_time = 0.25
|
||||||
|
@ -450,7 +450,7 @@ minetest.register_entity("technic:frame_entity", {
|
||||||
end
|
end
|
||||||
|
|
||||||
self.last_puncher = puncher
|
self.last_puncher = puncher
|
||||||
local ppos = puncher:getpos()
|
local ppos = puncher:get_pos()
|
||||||
local pvect = puncher:get_look_dir()
|
local pvect = puncher:get_look_dir()
|
||||||
local pface = get_face(pos, ppos, pvect)
|
local pface = get_face(pos, ppos, pvect)
|
||||||
if pface == nil then return end
|
if pface == nil then return end
|
||||||
|
@ -468,8 +468,8 @@ minetest.register_entity("technic:frame_entity", {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:get_pos()
|
||||||
local ppos = clicker:getpos()
|
local ppos = clicker:get_pos()
|
||||||
local pvect = clicker:get_look_dir()
|
local pvect = clicker:get_look_dir()
|
||||||
local pface = get_face(pos, ppos, pvect)
|
local pface = get_face(pos, ppos, pvect)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user