Compare commits

1 Commits

Author SHA1 Message Date
2e5a1fab64 Version MFF. 2018-09-08 01:25:55 +02:00
4 changed files with 395 additions and 892 deletions

25
README.md Normal file → Executable file
View File

@ -2,11 +2,9 @@ Minetest mod metatools
######################
A mod inspired by mgl512's itemframe issue
Version : 1.2.2
# Authors
- LeMagnesium / Mg / ElectronLibre : Source code writer
- Paly2 / Palige : Contributor for the source code
- Ataron : Texture creater
# Purpose
@ -18,23 +16,32 @@ stratum.
"metatools_stick.png" by Ataron (CC-BY-NC-SA)
# Todo
- Rewrite the table stocking : a variable containing a copy of the global
table returned by :to_table(), on which we would work, and a save command to
apply it on the node
- Add a check if set is done in Node/fields/
- Add a table handler for meta::set
# 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, and contributed to the last version
# Command tutorial
- Soon to come, please refer to /meta help until then
- help => Get help
- open (x,y,z) => Open the node to manipulate at pos (x,y,z)
- show => Show fields/path list at actual position
- enter <path> => Enter next stratum through <path>
- quit => Quit actual field and go back to previous stratum
- set <name> <value> => Set metadata <name> to <value> (create it if it doesn't exist)
- itemstack => Manipulate itemstacks in Node/inventory/*/
- read <name> => Read itemstack at field name (itemstring and count)
- erase <name> => Erase itemstack at field name
- write <name> <itemstring> [<count>] => Set itemstack in field <name> with item <itemstring> and count <count>. Default count is one, 0 not handled.
- close => Close node
Node metadatas look like this :
0 1 2 3 ...
Node/
Stratum : 0 1 2 ...
Nodes/
|
+- fields
| |

View File

@ -1,38 +0,0 @@
-- Assertion tools for Metatools
function assert_contextid(ctid)
return metatools.contexts[ctid] ~= nil
end
function assert_ownership(ctid, name)
return metatools.playerlocks[name] == ctid
end
function assert_pos(pos)
if type(pos) ~= "string" then
return pos and pos.x and pos.y and pos.z and minetest.pos_to_string(pos)
else
return minetest.string_to_pos(pos) ~= nil
end
end
function assert_mode(mode)
return mode and (mode == "fields" or mode == "inventory")
end
function assert_poslock(pos)
return nodelock[minetest.pos_to_string(pos)] == nil
end
function assert_specific_mode(contextid, mode)
return assert_contextid(contextid) and metatools.contexts[contextid].mode == mode
end
function assert_field_type(ftype)
return ftype and type(ftype) == "string" and (ftype == "int" or ftype == "float" or ftype == "string")
end
function assert_integer(int)
return int and tonumber(int) and tonumber(int) % 1 == 0
end

1118
init.lua Normal file → Executable file

File diff suppressed because it is too large Load Diff

BIN
textures/metatools_stick.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB