Added Settingtypes

This mod now supports customizing it.
This commit is contained in:
Apollo 2022-01-25 20:46:15 -05:00
parent 16dfa66962
commit 35591d4271
3 changed files with 46 additions and 30 deletions

View File

@ -5,6 +5,7 @@ Adds magic gloves which allow you to climb up on things
- 2 pairs of gloves (one requires you to be pointing at nodes or entities, the other doesn't require anything) - 2 pairs of gloves (one requires you to be pointing at nodes or entities, the other doesn't require anything)
- Supports Minetest Game and Mineclone (2, 5 & Mineclonia) - Supports Minetest Game and Mineclone (2, 5 & Mineclonia)
- Allow choosing if crafting is allowed (defaults to not allowed, this way you could use this mod at a server shop)
## How to climb ## How to climb
@ -12,6 +13,13 @@ With a basic glove just look at say some nodes (like a tree), then just rapidly
> The only difference between the basic glove and advanced glove is that the advanced doesn't need you looking at anything. > The only difference between the basic glove and advanced glove is that the advanced doesn't need you looking at anything.
## Settings
All you need to do to allow crafting is:
1. Add `climb_crafting = true` to your `minetest.conf` file
2. (Restart if running, else enjoy)
## Credits ## Credits
- I thank the author of [climbing_pick](https://github.com/AndrejIT/climbing_pick) for the idea, and some ideas from their code. - I thank the author of [climbing_pick](https://github.com/AndrejIT/climbing_pick) for the idea, and some ideas from their code.

View File

@ -77,37 +77,40 @@ minetest.register_tool("climb_glove:adv_glove", {
}) })
-- Crafting -- Crafting
local gm = climb.game_mode() local allow_crafts = minetest.settings.get_bool("climb_crafting") or false
local empty = "" if allow_crafts == true then
local iron = "" local gm = climb.game_mode()
local gold = "" local empty = ""
local diamond = "" local iron = ""
local glove = "climb_glove:basic_glove" -- Used in making a advanced glove local gold = ""
if gm == "MTG" then local diamond = ""
iron = "default:steel_ingot" local glove = "climb_glove:basic_glove" -- Used in making a advanced glove
gold = "default:gold_ingot" if gm == "MTG" then
diamond = "default:diamond" iron = "default:steel_ingot"
elseif gm == "MCL" then gold = "default:gold_ingot"
iron = "mcl_core:iron_ingot" diamond = "default:diamond"
gold = "mcl_core:gold_ingot" elseif gm == "MCL" then
diamond = "mcl_core:diamond" iron = "mcl_core:iron_ingot"
gold = "mcl_core:gold_ingot"
diamond = "mcl_core:diamond"
end
minetest.register_craft({
output = "climb_glove:basic_glove",
recipe = {
{empty, iron, iron},
{gold, diamond, iron},
{gold, gold, empty}
}
})
minetest.register_craft({
output = "climb_glove:adv_glove",
recipe = {
{diamond, iron, iron},
{gold, glove, iron},
{gold, gold, diamond}
}
})
end end
minetest.register_craft({
output = "climb_glove:basic_glove",
recipe = {
{empty, iron, iron},
{gold, diamond, iron},
{gold, gold, empty}
}
})
minetest.register_craft({
output = "climb_glove:adv_glove",
recipe = {
{diamond, iron, iron},
{gold, glove, iron},
{gold, gold, diamond}
}
})
-- Indicate ready -- Indicate ready
minetest.log("action", "[climb_glove] Running version "..climb.version()) minetest.log("action", "[climb_glove] Running version "..climb.version())

5
settingtypes.txt Normal file
View File

@ -0,0 +1,5 @@
# https://github.com/minetest/minetest/blob/master/builtin/settingtypes.txt#L1
# Can anyone craft climbing gloves (also includes upgrading the basic to advanced)
climb_crafting (Climb Glove - Crafting) bool false