renamed obsolete functions to new name

master
Sokomine 2019-03-11 23:58:24 +01:00
parent d3414ab6d7
commit aa59e2c603
5 changed files with 10 additions and 10 deletions

View File

@ -119,7 +119,7 @@ mg_villages.list_villages_formspec = function( player, formname, fields )
return
end
local pname = player:get_player_name();
local ppos = player:getpos();
local ppos = player:get_pos();
local radius = 1000000;
-- without the special priv, players can only obtain informatoin about villages which are very close by
@ -226,7 +226,7 @@ minetest.register_chatcommand( 'visit', {
minetest.chat_send_player( name, "Initiating transfer to village no. "..tostring( v.nr )..", called "..( tostring( v.name or 'unknown'))..".");
local player = minetest.get_player_by_name( name );
player:moveto( { x=v.vx, y=(v.vh+1), z=v.vz }, false);
player:move_to( { x=v.vx, y=(v.vh+1), z=v.vz }, false);
return;
end
end
@ -260,7 +260,7 @@ minetest.register_chatcommand( 'village_mob_repopulate', {
minetest.chat_send_player( name, "Deleting information about workplaces and beds. Recalculating. Assigning new data for village no. "..tostring( v.nr )..", called "..( tostring( v.name or 'unknown'))..".");
-- move the player to the center of the village he just changed
local player = minetest.get_player_by_name( name );
player:moveto( { x=v.vx, y=(v.vh+1), z=v.vz }, false);
player:move_to( { x=v.vx, y=(v.vh+1), z=v.vz }, false);
local village_id = tostring( v.vx )..':'..tostring( v.vz );
-- actually do the reassigning

View File

@ -29,7 +29,7 @@ mg_villages.plotmarker_search_trader = function( trader, height )
for i,obj in ipairs( obj_list ) do
local e = obj:get_luaentity();
if( e and e.object ) then
local p = e.object:getpos();
local p = e.object:get_pos();
if( p and p.x and math.abs(p.x-trader.x)<1.5
and p.z and math.abs(p.z-trader.z)<1.5
and e.name and e.name=="mobf_trader:trader"
@ -70,7 +70,7 @@ mg_villages.plotmarker_list_traders = function( plot, formspec )
if( fields[ "visit_trader_"..i ] ) then
player:moveto( {x=trader.x, y=(village.vh+1), z=trader.z} );
player:move_to( {x=trader.x, y=(village.vh+1), z=trader.z} );
minetest.chat_send_player( pname, "You are visiting the "..tostring( trader.typ )..
" trader, who is supposed to be somewhere here. He might also be on a floor above you.");
return formspec;
@ -109,7 +109,7 @@ mg_villages.mob_spanwer_on_rightclick = function( pos, node, clicker, itemstack,
if( mob_info.mob_id and mob_basics) then
mob = mob_basics.find_mob_by_id( mob_info.mob_id, "trader" );
if( mob ) then
mob_pos = mob.object:getpos();
mob_pos = mob.object:get_pos();
if( mob_pos and mob_pos.x == pos.x and mob_pos.z == pos.z ) then
str = str.." yes, waiting right here. ";
mob.trader_does = "stand";

View File

@ -40,7 +40,7 @@ mg_villages.map_of_world = function( pname )
if( not( player )) then
return '';
end
local ppos = player:getpos();
local ppos = player:get_pos();
-- also usable: diamond_block, sand, water
local formspec = "size[14.4,10]"..

View File

@ -377,7 +377,7 @@ mg_villages.form_input_handler = function( player, formname, fields)
if( minetest.check_player_privs( pname, {teleport=true})) then
local pos = minetest.string_to_pos( fields.pos2str );
-- teleport the player to the target position
player:moveto( { x=pos.x, y=(pos.y+1), z=pos.z }, false);
player:move_to( { x=pos.x, y=(pos.y+1), z=pos.z }, false);
else
minetest.chat_sned_player( pname, "Sorry. You do not have the teleport privilege.");
end

View File

@ -36,8 +36,8 @@ mg_villages.village_area_mark_single_house_area = function(village_area, minp, m
local minpos = {x=minp.x, y=minp.z}
noise_object_blending = noise_object_blending or minetest.get_perlin_map(np_blend, chulens);
local nvals_blend = noise_object_blending:get2dMap_flat(minpos, noise_buffer);
-- local nvals_blend = minetest.get_perlin_map(np_blend, chulens):get2dMap_flat(minpos)
local nvals_blend = noise_object_blending:get_2d_map_flat(minpos, noise_buffer);
-- local nvals_blend = minetest.get_perlin_map(np_blend, chulens):get_2d_map_flat(minpos)
-- mark mapchunk-sized house area
local ni = 1