add player island /query

This commit is contained in:
Kimapr 2020-01-05 12:21:36 +05:00
parent cac6367d90
commit bef0202358
2 changed files with 13 additions and 1 deletions

View File

@ -543,7 +543,18 @@ minetest.register_chatcommand("invalidate", {
minetest.register_chatcommand("query", { minetest.register_chatcommand("query", {
description = S"Query information about this island", description = S"Query information about this island",
func = function(name,param) func = function(name,param)
local is = get_standing_island(name) local is
if param then
is = players[param]
if not is then
minetest.chat_send_player(name,S("Can't find @1's island",param))
return
end
is = {pos=is.pos,valid=is.valid,owner=param}
end
if not is then
is = get_standing_island(name)
end
if is then if is then
minetest.chat_send_player(name,"[") minetest.chat_send_player(name,"[")
minetest.chat_send_player(name," owner: "..((is.owner == "" and "(none)" or is.owner) or "(none)")) minetest.chat_send_player(name," owner: "..((is.owner == "" and "(none)" or is.owner) or "(none)"))

View File

@ -16,3 +16,4 @@ Get a new island=Get a new island
Bulk island generation=Bulk island generation Bulk island generation=Bulk island generation
Island generation done=Island generation done Island generation done=Island generation done
Generated an island (@1%)=Generated an island (@1%) Generated an island (@1%)=Generated an island (@1%)
Can't find @1's island=Can't find @1's island