From bef0202358fc22d5b1576d5727048377acafc4e1 Mon Sep 17 00:00:00 2001 From: Kimapr Date: Sun, 5 Jan 2020 12:21:36 +0500 Subject: [PATCH] add player island /query --- nc_sky_isgen/init.lua | 13 ++++++++++++- nc_sky_isgen/locale/nc_sky_isgen.en.tr | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nc_sky_isgen/init.lua b/nc_sky_isgen/init.lua index adf71b7..6e4f7b9 100644 --- a/nc_sky_isgen/init.lua +++ b/nc_sky_isgen/init.lua @@ -543,7 +543,18 @@ minetest.register_chatcommand("invalidate", { minetest.register_chatcommand("query", { description = S"Query information about this island", 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 minetest.chat_send_player(name,"[") minetest.chat_send_player(name," owner: "..((is.owner == "" and "(none)" or is.owner) or "(none)")) diff --git a/nc_sky_isgen/locale/nc_sky_isgen.en.tr b/nc_sky_isgen/locale/nc_sky_isgen.en.tr index cec9418..6a330b7 100644 --- a/nc_sky_isgen/locale/nc_sky_isgen.en.tr +++ b/nc_sky_isgen/locale/nc_sky_isgen.en.tr @@ -16,3 +16,4 @@ Get a new island=Get a new island Bulk island generation=Bulk island generation Island generation done=Island generation done Generated an island (@1%)=Generated an island (@1%) +Can't find @1's island=Can't find @1's island