Add starting equipment.
This commit is contained in:
parent
52d4311071
commit
5dba3b99ec
3 changed files with 19 additions and 3 deletions
16
init.lua
16
init.lua
|
@ -32,6 +32,11 @@ if fun_caves.use_villages == nil then
|
||||||
fun_caves.use_villages = true
|
fun_caves.use_villages = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fun_caves.starting_equipment = minetest.setting_getbool('fun_caves_starting_equipment')
|
||||||
|
if fun_caves.starting_equipment == nil then
|
||||||
|
fun_caves.starting_equipment = false
|
||||||
|
end
|
||||||
|
|
||||||
fun_caves.DEBUG = false -- for maintenance only
|
fun_caves.DEBUG = false -- for maintenance only
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,6 +384,16 @@ if not armor_mod then
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if fun_caves.starting_equipment then
|
||||||
|
minetest.register_on_newplayer(function(player)
|
||||||
|
local inv = player:get_inventory()
|
||||||
|
inv:add_item("main", 'default:sword_wood')
|
||||||
|
inv:add_item("main", 'default:axe_wood')
|
||||||
|
inv:add_item("main", 'default:pick_wood')
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
if not (player and fun_caves.db.status) then
|
if not (player and fun_caves.db.status) then
|
||||||
return
|
return
|
||||||
|
@ -433,4 +448,3 @@ if fun_caves.db.status then
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -12,3 +12,6 @@ fun_caves_breakable_wood (Breakable Wood) bool false
|
||||||
|
|
||||||
# Unset this to remove primitive villages.
|
# Unset this to remove primitive villages.
|
||||||
fun_caves_use_villages (Villages) bool true
|
fun_caves_use_villages (Villages) bool true
|
||||||
|
|
||||||
|
# Set to give wooden tools to starting players.
|
||||||
|
fun_caves_starting_equipment (Starting Equipment) bool false
|
||||||
|
|
|
@ -12,14 +12,13 @@ minetest.register_node("fun_caves:bark", newnode)
|
||||||
newnode = fun_caves.clone_node("default:tree")
|
newnode = fun_caves.clone_node("default:tree")
|
||||||
newnode.description = "Giant Wood"
|
newnode.description = "Giant Wood"
|
||||||
newnode.tiles = {"fun_caves_tree.png"}
|
newnode.tiles = {"fun_caves_tree.png"}
|
||||||
|
newnode.groups.flammable = 1
|
||||||
newnode.is_ground_content = false
|
newnode.is_ground_content = false
|
||||||
minetest.register_node("fun_caves:tree", newnode)
|
minetest.register_node("fun_caves:tree", newnode)
|
||||||
|
|
||||||
newnode = fun_caves.clone_node("fun_caves:tree")
|
newnode = fun_caves.clone_node("fun_caves:tree")
|
||||||
newnode.description = "Giant Wood With Mineral"
|
newnode.description = "Giant Wood With Mineral"
|
||||||
newnode.tiles = {"fun_caves_tree.png^fun_caves_mineral_aquamarine.png"}
|
newnode.tiles = {"fun_caves_tree.png^fun_caves_mineral_aquamarine.png"}
|
||||||
-- This drop list is more complicated than it ought to be.
|
|
||||||
-- The lua documentation is inaccurate.
|
|
||||||
newnode.drop = {
|
newnode.drop = {
|
||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue