forked from mtcontrib/minetest-mod-metatools
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
c875a96af7 | |||
73c80b1201 | |||
0dfec122fe | |||
cff85689d7 | |||
2a4a2b6bfc | |||
ec2ae309da | |||
2ed6e41fcf | |||
0585ad63d4 | |||
fbbe641e08 | |||
e5f7423c71 | |||
6cdef4dbc4 | |||
58e462a485 |
65
README.md
65
README.md
@ -2,9 +2,11 @@ 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
|
||||
@ -16,50 +18,41 @@ 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
|
||||
- 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
|
||||
|
||||
# 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
|
||||
|
||||
- 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
|
||||
- Soon to come, please refer to /meta help until then
|
||||
|
||||
Node metadatas look like this :
|
||||
|
||||
Stratum : 0 1 2 ...
|
||||
Nodes/
|
||||
0 1 2 3 ...
|
||||
Node/
|
||||
|
|
||||
+- fields
|
||||
| |
|
||||
| +- foo
|
||||
| +- bar
|
||||
| +- ...
|
||||
+- inventory
|
||||
|
|
||||
+- main
|
||||
| |
|
||||
| +- 1
|
||||
| +- 2
|
||||
| +- 3
|
||||
| +- ...
|
||||
+- craft
|
||||
| |
|
||||
| +- 1
|
||||
| +- 2
|
||||
| +- 3
|
||||
| +- ...
|
||||
+- ...
|
||||
+- fields
|
||||
| |
|
||||
| +- foo
|
||||
| +- bar
|
||||
| +- ...
|
||||
+- inventory
|
||||
|
|
||||
+- main
|
||||
| |
|
||||
| +- 1
|
||||
| +- 2
|
||||
| +- 3
|
||||
| +- ...
|
||||
+- craft
|
||||
| |
|
||||
| +- 1
|
||||
| +- 2
|
||||
| +- 3
|
||||
| +- ...
|
||||
+- ...
|
||||
|
38
assertions.lua
Normal file
38
assertions.lua
Normal file
@ -0,0 +1,38 @@
|
||||
-- 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
|
||||
|
Reference in New Issue
Block a user