diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-08-03 09:31:05 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-08-03 09:31:05 -0400 |
commit | 2fa93b219eadfcdcf8f1d472aad046fc62d5b99d (patch) | |
tree | cff2e96e78cd89aa965976553d2ff8989b5a02b5 /pipeworks/luaentity.lua | |
parent | 76594f4bd5f825eaf1245965e2c0933bec47320d (diff) | |
download | dreambuilder_modpack-2fa93b219eadfcdcf8f1d472aad046fc62d5b99d.tar dreambuilder_modpack-2fa93b219eadfcdcf8f1d472aad046fc62d5b99d.tar.gz dreambuilder_modpack-2fa93b219eadfcdcf8f1d472aad046fc62d5b99d.tar.bz2 dreambuilder_modpack-2fa93b219eadfcdcf8f1d472aad046fc62d5b99d.tar.xz dreambuilder_modpack-2fa93b219eadfcdcf8f1d472aad046fc62d5b99d.zip |
update castles, cottages, digistuff, gloopblocks, locks,
maptools, mesecons, pipeworks, technic, unified inventory,
unified dyes, and xban2
Diffstat (limited to 'pipeworks/luaentity.lua')
-rw-r--r-- | pipeworks/luaentity.lua | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/pipeworks/luaentity.lua b/pipeworks/luaentity.lua index 34b6665..c11c030 100644 --- a/pipeworks/luaentity.lua +++ b/pipeworks/luaentity.lua @@ -74,7 +74,7 @@ local move_entities_globalstep_part1 = function(dtime) local active_block_range = tonumber(minetest.settings:get("active_block_range")) or 2 local new_active_blocks = {} for _, player in ipairs(minetest.get_connected_players()) do - local blockpos = get_blockpos(player:getpos()) + local blockpos = get_blockpos(player:get_pos()) local minp = vector.subtract(blockpos, active_block_range) local maxp = vector.add(blockpos, active_block_range) @@ -114,9 +114,9 @@ local entitydef_default = { if not def.entity then return end - def.entity:setpos(vector.add(self._pos, def.offset)) - def.entity:setvelocity(self._velocity) - def.entity:setacceleration(self._acceleration) + def.entity:set_pos(vector.add(self._pos, def.offset)) + def.entity:set_velocity(self._velocity) + def.entity:set_acceleration(self._acceleration) end, _attach_all = function(self) local master = self._attached_entities_master @@ -186,43 +186,43 @@ local entitydef_default = { self:_add_attached(id) end end, - getid = function(self) + get_id = function(self) return self._id end, - getpos = function(self) + get_pos = function(self) return vector.new(self._pos) end, - setpos = function(self, pos) + set_pos = function(self, pos) self._pos = vector.new(pos) --for _, entity in pairs(self._attached_entities) do -- if entity.entity then - -- entity.entity:setpos(vector.add(self._pos, entity.offset)) + -- entity.entity:set_pos(vector.add(self._pos, entity.offset)) -- end --end local master = self._attached_entities_master if master then local master_def = self._attached_entities[master] - master_def.entity:setpos(vector.add(self._pos, master_def.offset)) + master_def.entity:set_pos(vector.add(self._pos, master_def.offset)) end end, - getvelocity = function(self) + get_velocity = function(self) return vector.new(self._velocity) end, - setvelocity = function(self, velocity) + set_velocity = function(self, velocity) self._velocity = vector.new(velocity) local master = self._attached_entities_master if master then - self._attached_entities[master].entity:setvelocity(self._velocity) + self._attached_entities[master].entity:set_velocity(self._velocity) end end, - getacceleration = function(self) + get_acceleration = function(self) return vector.new(self._acceleration) end, - setacceleration = function(self, acceleration) + set_acceleration = function(self, acceleration) self._acceleration = vector.new(acceleration) local master = self._attached_entities_master if master then - self._attached_entities[master].entity:setacceleration(self._acceleration) + self._attached_entities[master].entity:set_acceleration(self._acceleration) end end, remove = function(self) @@ -314,7 +314,7 @@ function luaentity.get_objects_inside_radius(pos, radius) local objects = {} local index = 1 for id, entity in pairs(luaentity.entities) do - if vector.distance(pos, entity:getpos()) <= radius then + if vector.distance(pos, entity:get_pos()) <= radius then objects[index] = entity index = index + 1 end @@ -329,11 +329,11 @@ local move_entities_globalstep_part2 = function(dtime) local master = entity._attached_entities_master local master_def = master and entity._attached_entities[master] local master_entity = master_def and master_def.entity - local master_entity_pos = master_entity and master_entity:getpos() + local master_entity_pos = master_entity and master_entity:get_pos() if master_entity_pos then entity._pos = vector.subtract(master_entity_pos, master_def.offset) - entity._velocity = master_entity:getvelocity() - entity._acceleration = master_entity:getacceleration() + entity._velocity = master_entity:get_velocity() + entity._acceleration = master_entity:get_acceleration() else entity._pos = vector.add(vector.add( entity._pos, |