Compare commits
61 Commits
Author | SHA1 | Date | |
---|---|---|---|
6e744b44b1 | |||
3498cf3f86 | |||
7757eb72fd | |||
a7dd13994f | |||
85ece2c8b9 | |||
65a8707a69 | |||
3e9e16b661 | |||
4289dea108 | |||
5625a0cb1c | |||
5e8079b2e8 | |||
fd375c92b3 | |||
7fc2d3a96a | |||
c1b1bef263 | |||
e6268a395f | |||
5d73794096 | |||
8a9f857204 | |||
d950c71dbc | |||
5ee1bea4ce | |||
61ae85a09c | |||
c4fe467e6f | |||
ed11bf3281 | |||
18affcb00e | |||
fa8d602a64 | |||
0959eaef0b | |||
157c6e5004 | |||
50317cc20e | |||
1def071029 | |||
134fbf382d | |||
70682b230b | |||
a07c8bc48e | |||
e0db5834b3 | |||
7f6dd430ce | |||
d1ee125a1a | |||
b980dccaee | |||
4c02a5e5f5 | |||
f8b7a72635 | |||
1034fd7c0e | |||
4bca02f0db | |||
4b97b08aa7 | |||
7745ccd863 | |||
65b51ad3e5 | |||
897fc3a21d | |||
e1eedb69bb | |||
f188580b8c | |||
783a84d3c6 | |||
74a2750a4d | |||
9da500ce2c | |||
610117de08 | |||
53833af635 | |||
b2a7f5430a | |||
0b4f202ffb | |||
eff2fa82f3 | |||
8630fccaea | |||
4d4e8f7d50 | |||
6d3f8ce32a | |||
ed861ea1b9 | |||
44ebb84e89 | |||
5fce8ddbda | |||
39ed2c2c45 | |||
8b309106c3 | |||
9625542468 |
@ -4,5 +4,7 @@ allow_defined_top = true
|
||||
read_globals = {
|
||||
"minetest",
|
||||
"default",
|
||||
"sfinv",
|
||||
"sfinv_buttons",
|
||||
"vector",
|
||||
}
|
||||
|
9
LICENSE
@ -1,9 +0,0 @@
|
||||
« Copyright © 2015-2017, Jean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders X be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
||||
|
||||
Except as contained in this notice, the name of the <copyright holders> shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the <copyright holders>. »
|
86
README.md
@ -1,14 +1,82 @@
|
||||
##  Crafting Guide ##
|
||||
#  Crafting Guide
|
||||
|
||||
#### A Crafting Guide for Minetest that doesn't suck. ####
|
||||
#### `craftguide` is the most comprehensive crafting guide on Minetest.
|
||||
#### Consult the [Minetest Wiki](http://wiki.minetest.net/Crafting_guide) for more details.
|
||||
|
||||
#### `craftguide` is the most comprehensive mod of its category. ####
|
||||
#### Consult the [Minetest Wiki](http://wiki.minetest.net/Crafting_guide) for more details and comparisons. ####
|
||||
This crafting guide is a blue book named *"Crafting Guide"* or a wooden sign.
|
||||
|
||||
#### This crafting guide is usable with a blue book named *"Crafting Guide"*. ####
|
||||
This crafting guide features a **progressive mode**.
|
||||
The progressive mode is a Terraria-like system that only shows recipes you can craft
|
||||
from items you ever had in your inventory. To enable it: `craftguide_progressive_mode = true` in `minetest.conf`.
|
||||
|
||||
#### This crafting guide features two modes : Standard and Progressive. ####
|
||||
The Progressive mode is a Terraria-like system that only shows recipes you can craft from items in inventory.
|
||||
The progressive mode can be enabled with `craftguide_progressive_mode = true` in `minetest.conf`.
|
||||
`craftguide` is also integrated in `sfinv` (Minetest Game inventory). To enable it:
|
||||
`craftguide_sfinv_only = true` in `minetest.conf`.
|
||||
|
||||

|
||||
Use the command `/craft` to show the recipe(s) of the pointed node.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## API
|
||||
|
||||
### Custom recipes
|
||||
|
||||
#### Registering a custom crafting type
|
||||
|
||||
```Lua
|
||||
craftguide.register_craft_type("digging", {
|
||||
description = "Digging",
|
||||
icon = "default_tool_steelpick.png",
|
||||
})
|
||||
```
|
||||
|
||||
#### Registering a custom crafting recipe
|
||||
|
||||
```Lua
|
||||
craftguide.register_craft({
|
||||
type = "digging",
|
||||
width = 1,
|
||||
output = "default:cobble 2",
|
||||
items = {"default:stone"},
|
||||
})
|
||||
```
|
||||
|
||||
### Recipe filters
|
||||
|
||||
Recipe filters can be used to filter the recipes shown to players. Progressive
|
||||
mode is implemented as a recipe filter.
|
||||
|
||||
#### `craftguide.add_recipe_filter(name, function(recipes, player))`
|
||||
|
||||
Adds a recipe filter with the given name. The filter function should return the
|
||||
recipes to be displayed, given the available recipes and an `ObjectRef` to the
|
||||
user. Each recipe is a table of the form returned by
|
||||
`minetest.get_craft_recipe`.
|
||||
|
||||
Example function to hide recipes for items from a mod called "secretstuff":
|
||||
|
||||
```lua
|
||||
craftguide.add_recipe_filter("Hide secretstuff", function(recipes)
|
||||
local filtered = {}
|
||||
for _, recipe in ipairs(recipes) do
|
||||
if recipe.output:sub(1,12) ~= "secretstuff:" then
|
||||
filtered[#filtered + 1] = recipe
|
||||
end
|
||||
end
|
||||
|
||||
return filtered
|
||||
end)
|
||||
```
|
||||
|
||||
#### `craftguide.remove_recipe_filter(name)`
|
||||
|
||||
Removes the recipe filter with the given name.
|
||||
|
||||
#### `craftguide.set_recipe_filter(name, function(recipe, player))`
|
||||
|
||||
Removes all recipe filters and adds a new one.
|
||||
|
||||
#### `craftguide.get_recipe_filters()`
|
||||
|
||||
Returns a map of recipe filters, indexed by name.
|
||||
|
@ -1,2 +1,3 @@
|
||||
sfinv?
|
||||
sfinv_buttons?
|
||||
intllib?
|
||||
intllib?
|
58
license.txt
Normal file
@ -0,0 +1,58 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-2019 Jean-Patrick Guerrero and contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
Licenses of media (textures)
|
||||
----------------------------
|
||||
|
||||
Copyright © Diego Martínez (kaeza): craftguide_*_icon.png (CC BY-SA 3.0)
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
||||
For more details:
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
4
settingtypes.txt
Normal file
@ -0,0 +1,4 @@
|
||||
#For enabling some options of craftguide.
|
||||
|
||||
craftguide_progressive_mode (Progressive Mode) bool false
|
||||
craftguide_sfinv_only (Sfinv only) bool false
|
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 230 B |
BIN
textures/craftguide_clear_icon.png
Normal file
After Width: | Height: | Size: 708 B |
BIN
textures/craftguide_next_icon.png
Normal file
After Width: | Height: | Size: 727 B |
BIN
textures/craftguide_prev_icon.png
Normal file
After Width: | Height: | Size: 728 B |
BIN
textures/craftguide_search_icon.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 305 B |
BIN
textures/craftguide_zoomin_icon.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
textures/craftguide_zoomout_icon.png
Normal file
After Width: | Height: | Size: 2.9 KiB |