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
Executable file → Normal file
65
README.md
Executable file → Normal file
@ -2,9 +2,11 @@ Minetest mod metatools
|
|||||||
######################
|
######################
|
||||||
|
|
||||||
A mod inspired by mgl512's itemframe issue
|
A mod inspired by mgl512's itemframe issue
|
||||||
|
Version : 1.2.2
|
||||||
|
|
||||||
# Authors
|
# Authors
|
||||||
- LeMagnesium / Mg / ElectronLibre : Source code writer
|
- LeMagnesium / Mg / ElectronLibre : Source code writer
|
||||||
|
- Paly2 / Palige : Contributor for the source code
|
||||||
- Ataron : Texture creater
|
- Ataron : Texture creater
|
||||||
|
|
||||||
# Purpose
|
# Purpose
|
||||||
@ -16,50 +18,41 @@ stratum.
|
|||||||
"metatools_stick.png" by Ataron (CC-BY-NC-SA)
|
"metatools_stick.png" by Ataron (CC-BY-NC-SA)
|
||||||
|
|
||||||
# Todo
|
# Todo
|
||||||
- Add a check if set is done in Node/fields/
|
- Rewrite the table stocking : a variable containing a copy of the global
|
||||||
- Add a table handler for meta::set
|
table returned by :to_table(), on which we would work, and a save command to
|
||||||
|
apply it on the node
|
||||||
|
|
||||||
# Special thanks
|
# Special thanks
|
||||||
- mgl512 (Le_Docteur) for its locked itemframe which gave me the idea of a tool
|
- mgl512 (Le_Docteur) for its locked itemframe which gave me the idea of a tool
|
||||||
allowing to see/edit metadatas
|
allowing to see/edit metadatas
|
||||||
- Ataron who created the stick's texture
|
- 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
|
# 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 :
|
Node metadatas look like this :
|
||||||
|
|
||||||
Stratum : 0 1 2 ...
|
0 1 2 3 ...
|
||||||
Nodes/
|
Node/
|
||||||
|
|
|
|
||||||
+- fields
|
+- fields
|
||||||
| |
|
| |
|
||||||
| +- foo
|
| +- foo
|
||||||
| +- bar
|
| +- bar
|
||||||
| +- ...
|
| +- ...
|
||||||
+- inventory
|
+- inventory
|
||||||
|
|
|
|
||||||
+- main
|
+- main
|
||||||
| |
|
| |
|
||||||
| +- 1
|
| +- 1
|
||||||
| +- 2
|
| +- 2
|
||||||
| +- 3
|
| +- 3
|
||||||
| +- ...
|
| +- ...
|
||||||
+- craft
|
+- craft
|
||||||
| |
|
| |
|
||||||
| +- 1
|
| +- 1
|
||||||
| +- 2
|
| +- 2
|
||||||
| +- 3
|
| +- 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
|
||||||
|
|
BIN
textures/metatools_stick.png
Executable file → Normal file
BIN
textures/metatools_stick.png
Executable file → Normal file
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.4 KiB |
Reference in New Issue
Block a user