* document, configure and improve the give_initial_stuff
* This mod provides some stuff per player at initial play when first join only
* set initial_stuff = default:wood 2,farming:bread 2,default:furnace 1,default:torch 5
* the initial_stuff is only configured per config files not at menu
* cherry-picked from 18aed0219b
This commit is contained in:
parent
d5cc8c46f6
commit
d7e1e44c24
@ -37,15 +37,17 @@
|
|||||||
# Whether lavacooling should be enabled.
|
# Whether lavacooling should be enabled.
|
||||||
#enable_lavacooling = true
|
#enable_lavacooling = true
|
||||||
|
|
||||||
# Whether the stuff in initial_stuff should be given to new players.
|
# Whether the stuff in initial_stuff should be given to new players
|
||||||
#give_initial_stuff = false
|
# its depends of the configured at the initital_stuff_mod
|
||||||
#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,
|
#give_initial_stuff = true
|
||||||
default:torch 99,default:cobble 99
|
|
||||||
|
|
||||||
# Whether the TNT mod should be enabled.
|
# What initial stuff will be given to player if initial stuff are set to true
|
||||||
|
#initial_stuff = default:wood,farming:bread,default:furnace,default:torch
|
||||||
|
|
||||||
|
# Whether the TNT mod should be enabled
|
||||||
#enable_tnt = <true in singleplayer, false in multiplayer>
|
#enable_tnt = <true in singleplayer, false in multiplayer>
|
||||||
|
|
||||||
# The radius of a TNT explosion.
|
# The radius of a TNT explosion
|
||||||
#tnt_radius = 3
|
#tnt_radius = 3
|
||||||
|
|
||||||
# Enable the stairs mod ABM that replaces the old 'upside down'
|
# Enable the stairs mod ABM that replaces the old 'upside down'
|
||||||
|
26
mods/give_initial_stuff/README.md
Normal file
26
mods/give_initial_stuff/README.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
Minetest mod: give_initial_stuff
|
||||||
|
================================
|
||||||
|
|
||||||
|
This mod provides some stuff per player at initial play when first join only
|
||||||
|
|
||||||
|
Usage and information
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
To activate initial stuff per players do per config file:
|
||||||
|
|
||||||
|
`give_initial_stuff = true`
|
||||||
|
|
||||||
|
To specify the stuff per config file use by example:
|
||||||
|
|
||||||
|
`initial_stuff = default:wood 2,farming:bread 2,default:furnace 1,default:torch 5`
|
||||||
|
|
||||||
|
|
||||||
|
LICENSE
|
||||||
|
-------
|
||||||
|
|
||||||
|
See license.txt for license information.
|
||||||
|
|
||||||
|
#### Authors of source code
|
||||||
|
|
||||||
|
Perttu Ahola (celeron55) <celeron55@gmail.com> (MIT)
|
||||||
|
Various Minetest developers and contributors (MIT)
|
@ -1,8 +1,26 @@
|
|||||||
Minetest Game mod: give_initial_stuff
|
Minetest mod: give_initial_stuff
|
||||||
=====================================
|
================================
|
||||||
|
|
||||||
|
This mod provides some stuff per player at initial play when first join only
|
||||||
|
|
||||||
|
Usage and information
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
To activate initial stuff per players do per config file:
|
||||||
|
|
||||||
|
`give_initial_stuff = true`
|
||||||
|
|
||||||
|
To specify the stuff per config file use by example:
|
||||||
|
|
||||||
|
`initial_stuff = default:wood 2,farming:bread 2,default:furnace 1,default:torch 5`
|
||||||
|
|
||||||
|
|
||||||
|
LICENSE
|
||||||
|
-------
|
||||||
|
|
||||||
See license.txt for license information.
|
See license.txt for license information.
|
||||||
|
|
||||||
Authors of source code
|
#### Authors of source code
|
||||||
----------------------
|
|
||||||
Perttu Ahola (celeron55) <celeron55@gmail.com> (MIT)
|
Perttu Ahola (celeron55) <celeron55@gmail.com> (MIT)
|
||||||
Various Minetest developers and contributors (MIT)
|
Various Minetest developers and contributors (MIT)
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
default
|
default
|
||||||
|
farming
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
local stuff_string = minetest.settings:get("initial_stuff") or
|
local stuff_string = minetest.settings:get("initial_stuff") or
|
||||||
"default:pick_steel,default:axe_steel,default:shovel_steel," ..
|
"default:wood 2,farming:bread 2,default:furnace 1," ..
|
||||||
"default:torch 99,default:cobble 99"
|
"default:torch 5"
|
||||||
|
|
||||||
|
local modname = "give_initial_stuff"
|
||||||
|
local modlogn = "["..modname.."]"
|
||||||
|
|
||||||
give_initial_stuff = {
|
give_initial_stuff = {
|
||||||
items = {}
|
items = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function give_initial_stuff.give(player)
|
function give_initial_stuff.give(player)
|
||||||
minetest.log("action",
|
minetest.log("action",modlogn.." Giving initial stuff to player " .. player:get_player_name())
|
||||||
"Giving initial stuff to player " .. player:get_player_name())
|
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
for _, stack in ipairs(give_initial_stuff.items) do
|
for _, stack in ipairs(give_initial_stuff.items) do
|
||||||
inv:add_item("main", stack)
|
inv:add_item("main", stack)
|
||||||
@ -42,3 +44,4 @@ give_initial_stuff.add_from_csv(stuff_string)
|
|||||||
if minetest.settings:get_bool("give_initial_stuff") then
|
if minetest.settings:get_bool("give_initial_stuff") then
|
||||||
minetest.register_on_newplayer(give_initial_stuff.give)
|
minetest.register_on_newplayer(give_initial_stuff.give)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ enable_lavacooling (Lavacooling) bool true
|
|||||||
|
|
||||||
# If enabled, steel tools, torches and cobblestone will be given to new
|
# If enabled, steel tools, torches and cobblestone will be given to new
|
||||||
# players.
|
# players.
|
||||||
give_initial_stuff (Give initial items) bool false
|
give_initial_stuff (Give initial items) bool true
|
||||||
|
|
||||||
# If enabled, players respawn at the bed they last lay on instead of normal
|
# If enabled, players respawn at the bed they last lay on instead of normal
|
||||||
# spawn.
|
# spawn.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user