1
0
mirror of https://codeberg.org/tenplus1/mobs_animal.git synced 2024-12-23 01:10:25 +01:00

getpos to get_pos

This commit is contained in:
TenPlus1 2017-10-09 15:16:05 +01:00
parent 3b72ac1357
commit 0db8d4b263
5 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ mobs:register_mob("mobs_animal:bunny", {
end, end,
on_spawn = function(self) on_spawn = function(self)
local pos = self.object:getpos() ; pos.y = pos.y - 1 local pos = self.object:get_pos() ; pos.y = pos.y - 1
-- white snowy bunny -- white snowy bunny
if minetest.find_node_near(pos, 1, if minetest.find_node_near(pos, 1,

View File

@ -71,7 +71,7 @@ mobs:register_mob("mobs_animal:chicken", {
return return
end end
local pos = self.object:getpos() local pos = self.object:get_pos()
minetest.add_item(pos, "mobs:egg") minetest.add_item(pos, "mobs:egg")
@ -179,7 +179,7 @@ local egg_VELOCITY = 19
-- shoot egg -- shoot egg
local mobs_shoot_egg = function (item, player, pointed_thing) local mobs_shoot_egg = function (item, player, pointed_thing)
local playerpos = player:getpos() local playerpos = player:get_pos()
minetest.sound_play("default_place_node_hard", { minetest.sound_play("default_place_node_hard", {
pos = playerpos, pos = playerpos,

View File

@ -87,7 +87,7 @@ mobs:register_mob("mobs_animal:cow", {
if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then
clicker:get_inventory():add_item("main", "mobs:bucket_milk") clicker:get_inventory():add_item("main", "mobs:bucket_milk")
else else
local pos = self.object:getpos() local pos = self.object:get_pos()
pos.y = pos.y + 0.5 pos.y = pos.y + 0.5
minetest.add_item(pos, {name = "mobs:bucket_milk"}) minetest.add_item(pos, {name = "mobs:bucket_milk"})
end end

View File

@ -41,7 +41,7 @@ mobs:register_mob("mobs_animal:rat", {
self.rat_timer = 0 self.rat_timer = 0
local pos = self.object:getpos() local pos = self.object:get_pos()
print("rat pos", pos.x, pos.y, pos.z, dtime) print("rat pos", pos.x, pos.y, pos.z, dtime)

View File

@ -106,7 +106,7 @@ for _, col in ipairs(all_colours) do
self.gotten = true -- shaved self.gotten = true -- shaved
local obj = minetest.add_item( local obj = minetest.add_item(
self.object:getpos(), self.object:get_pos(),
ItemStack( "wool:" .. col[1] .. " " .. math.random(1, 3) ) ItemStack( "wool:" .. col[1] .. " " .. math.random(1, 3) )
) )
@ -147,7 +147,7 @@ for _, col in ipairs(all_colours) do
if c[1] == colr then if c[1] == colr then
local pos = self.object:getpos() local pos = self.object:get_pos()
self.object:remove() self.object:remove()