From 58e462a485ef7a996dc9a350eee82f28e1917d62 Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Fri, 8 May 2015 14:50:47 +0200 Subject: [PATCH] Bumped version to 1.0 - Added check for stratum when meta::set - Updated README.md - Bumped version to 1.0 --- README.md | 5 ++++- init.lua | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e3b6be..a6e7058 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Minetest mod metatools ###################### A mod inspired by mgl512's itemframe issue +Version : 1.0 # Authors - LeMagnesium / Mg / ElectronLibre : Source code writer @@ -16,17 +17,19 @@ stratum. "metatools_stick.png" by Ataron (CC-BY-NC-SA) # Todo - - Add a check if set is done in Node/fields/ - Add a table handler for meta::set + - Create a better ASCII-art graph at the end of this file... # Special thanks - mgl512 (Le_Docteur) for its locked itemframe which gave me the idea of a tool allowing to see/edit metadatas - Ataron who created the stick's texture + - palige who agreed to test the mod for its first release # Command tutorial - help => Get help + - version => Get version - open (x,y,z) => Open the node to manipulate at pos (x,y,z) - show => Show fields/path list at actual position - enter => Enter next stratum through diff --git a/init.lua b/init.lua index f44c7b6..c3841f3 100644 --- a/init.lua +++ b/init.lua @@ -4,6 +4,7 @@ metatools = {} meta_info = {} +metatools.version = "1.0" metatools.actualize_metalist = function(name) -- We need to actualize the tables @@ -64,8 +65,10 @@ minetest.register_chatcommand("meta", { if paramlist[1] == "help" then - minetest.chat_send_player(name,"Meta help: /meta +") + minetest.chat_send_player(name,"Metatools version " .. metatools.version) + minetest.chat_send_player(name,"Help: /meta +") minetest.chat_send_player(name," help : show this help") + minetest.chat_send_player(name," version : show metatools version") minetest.chat_send_player(name," open (x,y,z) : open node at pos x,y,z") minetest.chat_send_player(name," show : show fields at node/depth") minetest.chat_send_player(name," enter name : enter in field name at node/depth") @@ -77,6 +80,9 @@ minetest.register_chatcommand("meta", { minetest.chat_send_player(name," write [amount]: set the itemstack ") minetest.chat_send_player(name," close : close the current node") + elseif paramlist[1] == "version" then + minetest.chat_send_player(name, "- meta::version - Metatools' version : " .. metatools.version) + elseif paramlist[1] == "open" then if meta_info[name] and meta_info[name]["node"] then minetest.chat_send_player(name,"- meta::open - You already have opened a node without closing it, use /meta close "..minetest.pos_to_string(meta_info[name]["node"]).." to close it and retry") @@ -228,6 +234,11 @@ minetest.register_chatcommand("meta", { return false end + if meta_info[name]["stratum"] ~= 1 then + minetest.chat_send_player(name, "- meta::set - Warning: Meta set can only work at stratum 1 (node/fields). Use itemstack in node/inventory/* or any other command for other stratums") + return false + end + local i = 4 while (true) do if paramlist[i] ~= nil then