groups redone! more hardcore, more realism, more groups.
zcg added, inv++added.
xladder merged.
master
Mitori Itoshiki 2013-06-15 16:00:16 +04:00
parent 435e6fd828
commit ff588035bc
86 changed files with 3624 additions and 3365 deletions

View File

@ -2,7 +2,7 @@
-- See README.txt for licensing and other information.
local function is_owner(pos, name)
local owner = minetest.env:get_meta(pos):get_string("owner")
local owner = minetest.get_meta(pos):get_string("owner")
if owner == "" or owner == name then
return true
end
@ -20,7 +20,7 @@ minetest.register_node("bones:bones", {
"bones_front.png"
},
paramtype2 = "facedir",
groups = {dig_immediate=2},
groups = {dig_immediate=2, oddly_breakable_by_hand=7},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45},
}),
@ -96,7 +96,7 @@ minetest.register_on_dieplayer(function(player)
pos.z = math.floor(pos.z+0.5)
local param2 = minetest.dir_to_facedir(player:get_look_dir())
minetest.env:add_node(pos, {name="bones:bones", param2=param2})
minetest.add_node(pos, {name="bones:bones", param2=param2})
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()

View File

@ -131,11 +131,11 @@ if minetest.setting_getbool("creative_mode") then
full_punch_interval = 0.5,
max_drop_level = 3,
groupcaps = {
crumbly = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=6},
cracky = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=6},
snappy = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=6},
choppy = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=6},
oddly_breakable_by_hand = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3},
crumbly = {times={[1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0}, uses=0, maxlevel=7},
cracky = {times={[1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0}, uses=0, maxlevel=7},
snappy = {times={[1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0}, uses=0, maxlevel=7},
choppy = {times={[1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0}, uses=0, maxlevel=7},
oddly_breakable_by_hand = {times={[1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0}, uses=0, maxlevel=7},
}
}
})

View File

@ -15,7 +15,7 @@ minetest.register_node("darkage:chain", {
--wall_bottom = = <default>
--wall_side = = <default>
},
groups = {snappy=1,cracky=2,oddly_breakable_by_hand=2},
groups = {snappy=5,cracky=6,oddly_breakable_by_hand=6},
legacy_wallmounted = true
})
@ -26,7 +26,7 @@ minetest.register_node('darkage:box', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
groups = { snappy = 6 },
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
@ -65,7 +65,7 @@ minetest.register_node('darkage:wood_shelves', {
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
groups = { snappy = 6 },
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
@ -115,7 +115,7 @@ minetest.register_node("darkage:iron_bars", {
is_ground_content = true,
paramtype = "light",
sunlight_propagates = true,
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -140,7 +140,7 @@ minetest.register_node("darkage:iron_grille", {
is_ground_content = true,
paramtype = "light",
sunlight_propagates = true,
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -153,7 +153,7 @@ minetest.register_node("darkage:wood_bars", {
is_ground_content = true,
paramtype = "light",
sunlight_propagates = true,
groups = {snappy=1,choppy=2},
groups = {snappy=6,choppy=6},
sounds = default.node_sound_stone_defaults()
})
@ -166,7 +166,7 @@ minetest.register_node("darkage:wood_grille", {
is_ground_content = true,
paramtype = "light",
sunlight_propagates = true,
groups = {snappy=1,choppy=2},
groups = {snappy=6,choppy=6},
sounds = default.node_sound_stone_defaults()
})
@ -179,7 +179,7 @@ minetest.register_node("darkage:wood_frame", {
is_ground_content = true,
paramtype = "light",
sunlight_propagates = true,
groups = {snappy=1,choppy=2},
groups = {snappy=6,choppy=6},
sounds = default.node_sound_stone_defaults()
})

View File

@ -13,7 +13,7 @@ minetest.register_node("darkage:adobe", {
description = "Adobe",
tiles = {"darkage_adobe.png"},
is_ground_content = true,
groups = {crumbly=3},
groups = {crumbly=6},
sounds = default.node_sound_sand_defaults(),
})
@ -22,7 +22,7 @@ minetest.register_node("darkage:basalt", {
tiles = {"darkage_basalt.png"},
is_ground_content = true,
drop = 'darkage:basalt_cobble',
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -30,7 +30,7 @@ minetest.register_node("darkage:basalt_cobble", {
description = "Basalt Cobble",
tiles = {"darkage_basalt_cobble.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -39,7 +39,7 @@ minetest.register_node("darkage:chalk", {
tiles = {"darkage_chalk.png"},
is_ground_content = true,
drop = 'darkage:chalk_powder 2',
groups = {crumbly=2,cracky=2},
groups = {crumbly=6,cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -50,23 +50,15 @@ minetest.register_node("darkage:cobble_with_plaster", {
is_ground_content = true,
paramtype2 = "facedir",
drop = 'default:cobble',
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("darkage:desert_stone_cobble", {
description = "Desert Stone Cobble",
tiles = {"darkage_desert_stone_cobble.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("darkage:desert_stone_with_iron", {
description = "Desert Iron Ore",
tiles = {"default_desert_stone.png^darkage_mineral_iron.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=6},
drop = 'default:iron_lump',
sounds = default.node_sound_stone_defaults(),
})
@ -75,7 +67,7 @@ minetest.register_node("darkage:darkdirt", {
description = "Dark Dirt",
tiles = {"darkage_darkdirt.png"},
is_ground_content = true,
groups = {crumbly=2},
groups = {crumbly=6},
sounds = default.node_sound_dirt_defaults(),
})
@ -84,7 +76,7 @@ minetest.register_node("darkage:dry_leaves", {
tiles = {"darkage_dry_leaves.png"},
is_ground_content = true,
paramtype = "light",
groups = {snappy=3, flammable=2},
groups = {snappy=6, flammable=6},
sounds = default.node_sound_leaves_defaults()
})
@ -92,7 +84,7 @@ minetest.register_node("darkage:gneiss", {
description = "Gneiss",
tiles = {"darkage_gneiss.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=6},
drop = {
max_items = 1,
items = {
@ -113,7 +105,7 @@ minetest.register_node("darkage:gneiss_cobble", {
description = "Gneiss Cobble",
tiles = {"darkage_gneiss_cobble.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -121,7 +113,7 @@ minetest.register_node("darkage:marble", {
description = "Marble",
tiles = {"darkage_marble.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -130,7 +122,7 @@ minetest.register_node("darkage:mud", {
description = "Mud",
tiles = {"darkage_mud_up.png","darkage_mud.png"},
is_ground_content = true,
groups = {crumbly=3},
groups = {crumbly=6},
drop = 'darkage:mud_lump 4',
sounds = default.node_sound_dirt_defaults({
footstep = "",
@ -142,7 +134,7 @@ minetest.register_node("darkage:ors", {
tiles = {"darkage_ors.png"},
is_ground_content = true,
drop = 'darkage:ors_cobble',
groups = {crumbly=2,cracky=2},
groups = {crumbly=6,cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -150,7 +142,7 @@ minetest.register_node("darkage:ors_cobble", {
description = "Old Red Sandstone Cobble",
tiles = {"darkage_ors_cobble.png"},
is_ground_content = true,
groups = {crumbly=2,cracky=2},
groups = {crumbly=6,cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -159,7 +151,7 @@ minetest.register_node("darkage:sandstone_cobble", {
description = "Sandstone Cobble",
tiles = {"darkage_sandstone_cobble.png"},
is_ground_content = true,
groups = {crumbly=2,cracky=2},
groups = {crumbly=6,cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -167,7 +159,7 @@ minetest.register_node("darkage:serpentine", {
description = "Serpentine",
tiles = {"darkage_serpentine.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -175,7 +167,7 @@ minetest.register_node("darkage:shale", {
description = "Shale",
tiles = {"darkage_shale.png","darkage_shale.png","darkage_shale_side.png"},
is_ground_content = true,
groups = {crumbly=2,cracky=2},
groups = {crumbly=6,cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -183,7 +175,7 @@ minetest.register_node("darkage:schist", {
description = "Schist",
tiles = {"darkage_schist.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -191,7 +183,7 @@ minetest.register_node("darkage:silt", {
description = "Silt",
tiles = {"darkage_silt.png"},
is_ground_content = true,
groups = {crumbly=3},
groups = {crumbly=6},
drop = 'darkage:silt_lump 4',
sounds = default.node_sound_dirt_defaults({
footstep = "",
@ -203,7 +195,7 @@ minetest.register_node("darkage:slate", {
tiles = {"darkage_slate.png","darkage_slate.png","darkage_slate_side.png"},
is_ground_content = true,
drop = 'darkage:slate_cobble',
groups = {cracky=2},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -211,7 +203,7 @@ minetest.register_node("darkage:slate_cobble", {
description = "Slate Cobble",
tiles = {"darkage_slate_cobble.png"},
is_ground_content = true,
groups = {cracky=2},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -219,7 +211,7 @@ minetest.register_node("darkage:slate_tale", {
description = "Slate Tale",
tiles = {"darkage_slate_tale.png"},
is_ground_content = true,
groups = {cracky=2},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -227,24 +219,16 @@ minetest.register_node("darkage:straw", {
description = "Straw",
tiles = {"darkage_straw.png"},
is_ground_content = true,
groups = {snappy=3, flammable=2},
groups = {snappy=6, flammable=6},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("darkage:stone_brick", {
description = "Stone Brick",
tiles = {"darkage_stone_brick.png"},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("darkage:straw_bale", {
description = "Straw Bale",
tiles = {"darkage_straw_bale.png"},
is_ground_content = true,
drop = 'darkage:straw 4',
groups = {snappy=2, flammable=2},
groups = {snappy=6, flammable=6},
sounds = default.node_sound_leaves_defaults(),
})
@ -252,7 +236,7 @@ minetest.register_node("darkage:marble", {
description = "Marble",
tiles = {"darkage_marble.png"},
is_ground_content = true,
groups = {cracky=2},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
@ -260,26 +244,10 @@ minetest.register_node("darkage:marble_tile", {
description = "Marble Tile",
tiles = {"darkage_marble_tile.png"},
is_ground_content = true,
groups = {cracky=2},
groups = {cracky=6},
sounds = default.node_sound_stone_defaults()
})
---------------
-- Overrides
---------------
minetest.registered_nodes["default:desert_stone"].drop= {
max_items = 1,
items = {
{
-- player will get cobbles with 1/3 chance
items = {'darkage:desert_stone_cobble'},
rarity = 2,
},
{
items = {'default:desert_stone'},
}
}
}
---------------
@ -403,14 +371,6 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'darkage:stone_brick 3',
recipe = {
{'default:cobble','default:cobble'},
{'default:cobble','default:cobble'},
}
})
minetest.register_craft({
output = 'darkage:straw 2',
recipe = {

View File

@ -107,37 +107,37 @@ function darkage.register_stairs(modname, item, groups, images, description)
end
darkage.register_stairs("darkage","basalt_cobble",
{cracky=3},
{cracky=6},
{"darkage_basalt_cobble.png"},
"Basalt Cobble"
)
darkage.register_stairs("darkage","slate_tale",
{cracky=3},
{cracky=6},
{"darkage_slate_tale.png"},
"Slate Tale"
)
darkage.register_stairs("darkage","straw",
{snappy=3, flammable=2},
{snappy=6, flammable=2},
{"darkage_straw.png"},
"Straw"
)
darkage.register_stairs("darkage","stone_brick",
{cracky=3},
{cracky=6},
{"darkage_stone_brick.png"},
"Stone Brick"
)
darkage.register_stairs("darkage","ors_cobble",
{cracky=3},
{cracky=6},
{"darkage_ors_cobble.png"},
"Old Red Sandtone"
)
darkage.register_stairs("darkage","desert_stone_cobble",
{cracky=3},
{cracky=6},
{"darkage_desert_stone_cobble.png"},
"Desert Stone Cobble"
)

View File

@ -14,7 +14,7 @@ http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
@ -39,7 +39,6 @@ Cisoun's WTFPL texture pack:
default_jungletree_top.png
default_lava.png
default_leaves.png
default_sand.png
default_sapling.png
default_sign_wall.png
default_stone.png
@ -77,13 +76,17 @@ VanessaE (WTFPL):
default_nc_rb.png
default_nc_side.png
default_grass_*.png
default_desert_sand.png
default_desert_stone.png
default_desert_stone_brick.png
default_sand.png
default_sandstone_brick.png
Calinou (CC BY-SA):
default_brick.png
default_clay_brick.png
default_papyrus.png
default_tool_steelsword.png
default_bronze_block.png
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
@ -102,12 +105,10 @@ PilzAdam (WTFPL):
default_obsidian_glass.png
default_obsidian_shard.png
default_mossycobble.png
default_gold_block.png
default_gold_ingot.png
default_gold_lump.png
default_mineral_gold.png
default_diamond.png
default_diamond_block.png
default_tool_diamondpick.png
default_tool_diamondsword.png
default_tool_diamondshovel.png
@ -119,6 +120,7 @@ PilzAdam (WTFPL):
default_tool_bronzepick.png
default_tool_bronzeshovel.png
default_tool_bronzesword.png
default_snowball.png
jojoa1997 (WTFPL):
default_obsidian.png
@ -126,6 +128,19 @@ jojoa1997 (WTFPL):
InfinityProject (WTFPL):
default_mineral_diamond.png
Splizard (CC BY-SA 3.0):
default_snow.png
default_snow_side.png
default_ice.png
Zeg9 (CC BY-SA 3.0):
default_coal_block.png
default_steel_block.png
default_copper_block.png
default_bronze_block.png
default_gold_block.png
default_diamond_block.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/

585
mods/default/crafting.lua Normal file
View File

@ -0,0 +1,585 @@
minetest.register_craft({
output = 'default:wood 4',
recipe = {
{'default:tree'},
}
})
minetest.register_craft({
output = 'default:junglewood 4',
recipe = {
{'default:jungletree'},
}
})
minetest.register_craft({
output = 'default:stick 4',
recipe = {
{'group:wood'},
}
})
minetest.register_craft({
output = 'default:fence 2',
recipe = {
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:sign_wall',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_wood',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_stone',
recipe = {
{'group:stone', 'group:stone', 'group:stone'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_steel',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_bronze',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:shovel_wood',
recipe = {
{'group:wood'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_stone',
recipe = {
{'group:stone'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_steel',
recipe = {
{'default:steel_ingot'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_bronze',
recipe = {
{'default:bronze_ingot'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_mese',
recipe = {
{'default:mese_crystal'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_wood',
recipe = {
{'group:wood', 'group:wood'},
{'group:wood', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_stone',
recipe = {
{'group:stone', 'group:stone'},
{'group:stone', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_steel',
recipe = {
{'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_bronze',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_wood',
recipe = {
{'group:wood'},
{'group:wood'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_stone',
recipe = {
{'group:stone'},
{'group:stone'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_steel',
recipe = {
{'default:steel_ingot'},
{'default:steel_ingot'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_bronze',
recipe = {
{'default:bronze_ingot'},
{'default:bronze_ingot'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_mese',
recipe = {
{'default:mese_crystal'},
{'default:mese_crystal'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:rail 15',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'default:steel_ingot', 'default:stick', 'default:steel_ingot'},
{'default:steel_ingot', '', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'default:chest',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', '', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:chest_locked',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'default:steel_ingot', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:furnace',
recipe = {
{'group:stone', 'group:stone', 'group:stone'},
{'group:stone', '', 'group:stone'},
{'group:stone', 'group:stone', 'group:stone'},
}
})
minetest.register_craft({
type = "shapeless",
output = "default:bronze_ingot",
recipe = {"default:steel_ingot", "default:copper_ingot"},
})
minetest.register_craft({
output = 'default:steelblock',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'default:steel_ingot 9',
recipe = {
{'default:steelblock'},
}
})
minetest.register_craft({
output = 'default:bronzeblock',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
}
})
minetest.register_craft({
output = 'default:bronze_ingot 9',
recipe = {
{'default:bronzeblock'},
}
})
minetest.register_craft({
output = 'default:goldblock',
recipe = {
{'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
{'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
{'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
}
})
minetest.register_craft({
output = 'default:gold_ingot 9',
recipe = {
{'default:goldblock'},
}
})
minetest.register_craft({
output = 'default:sandstone',
recipe = {
{'group:sand', 'group:sand'},
{'group:sand', 'group:sand'},
}
})
minetest.register_craft({
output = 'default:sand 4',
recipe = {
{'default:sandstone'},
}
})
minetest.register_craft({
output = 'default:clay',
recipe = {
{'default:clay_lump', 'default:clay_lump'},
{'default:clay_lump', 'default:clay_lump'},
}
})
minetest.register_craft({
output = 'default:brick',
recipe = {
{'default:clay_brick', 'default:clay_brick'},
{'default:clay_brick', 'default:clay_brick'},
}
})
minetest.register_craft({
output = 'default:clay_brick 4',
recipe = {
{'default:brick'},
}
})
minetest.register_craft({
output = 'default:paper',
recipe = {
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
}
})
minetest.register_craft({
output = 'default:book',
recipe = {
{'default:paper'},
{'default:paper'},
{'default:paper'},
}
})
minetest.register_craft({
output = 'default:bookshelf',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'default:book', 'default:book', 'default:book'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:ladder 2',
recipe = {
{'default:stick', '', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', '', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
}
})
minetest.register_craft({
output = 'default:mese_crystal 9',
recipe = {
{'default:mese'},
}
})
minetest.register_craft({
output = 'default:mese_crystal_fragment 9',
recipe = {
{'default:mese_crystal'},
}
})
minetest.register_craft({
output = 'default:stonebrick 4',
recipe = {
{'default:stone', 'default:stone'},
{'default:stone', 'default:stone'},
}
})
--
-- Crafting (tool repair)
--
minetest.register_craft({
type = "toolrepair",
additional_wear = -0.02,
})
--
-- Cooking recipes
--
minetest.register_craft({
type = "cooking",
output = "default:glass",
recipe = "group:sand",
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "default:cobble",
})
minetest.register_craft({
type = "cooking",
output = "default:iron_ingot",
recipe = "default:iron_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:copper_ingot",
recipe = "default:copper_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:gold_ingot",
recipe = "default:gold_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:clay_brick",
recipe = "default:clay_lump",
})
--
-- Fuels
--
minetest.register_craft({
type = "fuel",
recipe = "group:tree",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglegrass",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "group:leaves",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:cactus",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:papyrus",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:bookshelf",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:ladder",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "group:wood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "default:lava_source",
burntime = 60,
})
minetest.register_craft({
type = "fuel",
recipe = "default:torch",
burntime = 4,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sign_wall",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:chest",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:chest_locked",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:nyancat",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:nyancat_rainbow",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sapling",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:apple",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:coal_lump",
burntime = 40,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 10,
})

View File

@ -0,0 +1,79 @@
minetest.register_craftitem("default:stick", {
description = "Stick",
inventory_image = "default_stick.png",
})
minetest.register_craftitem("default:paper", {
description = "Paper",
inventory_image = "default_paper.png",
})
minetest.register_craftitem("default:book", {
description = "Book",
inventory_image = "default_book.png",
})
minetest.register_craftitem("default:coal_lump", {
description = "Coal",
inventory_image = "default_coal_lump.png",
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:copper_lump", {
description = "Copper Lump",
inventory_image = "default_copper_lump.png",
})
minetest.register_craftitem("default:mese_crystal", {
description = "Mese Crystal",
inventory_image = "default_mese_crystal.png",
})
minetest.register_craftitem("default:gold_lump", {
description = "Gold Lump",
inventory_image = "default_gold_lump.png",
})
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
inventory_image = "default_clay_lump.png",
})
minetest.register_craftitem("default:steel_ingot", {
description = "Steel Ingot",
inventory_image = "default_steel_ingot.png",
})
minetest.register_craftitem("default:copper_ingot", {
description = "Copper Ingot",
inventory_image = "default_copper_ingot.png",
})
minetest.register_craftitem("default:bronze_ingot", {
description = "Bronze Ingot",
inventory_image = "default_bronze_ingot.png",
})
minetest.register_craftitem("default:gold_ingot", {
description = "Gold Ingot",
inventory_image = "default_gold_ingot.png"
})
minetest.register_craftitem("default:mese_crystal_fragment", {
description = "Mese Crystal Fragment",
inventory_image = "default_mese_crystal_fragment.png",
})
minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
inventory_image = "default_clay_brick.png",
})
minetest.register_craftitem("default:scorched_stuff", {
description = "Scorched Stuff",
inventory_image = "default_scorched_stuff.png",
})

View File

@ -5,7 +5,7 @@ minetest.register_tool("default:pick_iron", {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2},
cracky = {times={[4]=2.80, [5]=1.70, [6]=1.70, [7]=0.70}, uses=20},
},
damage_groups = {fleshy=4},
},
@ -18,7 +18,7 @@ minetest.register_tool("default:axe_iron", {
max_drop_level=1,
groupcaps={
choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
choppy={times={[4]=2.80, [5]=1.70, [6]=1.70, [7]=0.70}, uses=20},
},
damage_groups = {fleshy=4},
},
@ -31,7 +31,7 @@ minetest.register_tool("default:sword_iron", {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
snappy={times={[4]=2.80, [5]=1.70, [6]=1.70, [7]=0.70}, uses=20},
},
damage_groups = {fleshy=4},
}
@ -45,7 +45,7 @@ minetest.register_tool("default:shovel_iron", {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3},
crumbly = {times={[4]=2.80, [5]=1.70, [6]=1.70, [7]=0.70}, uses=20},
},
damage_groups = {fleshy=4},
}
@ -139,39 +139,4 @@ minetest.register_abm({
end
end
end,
})
minetest.register_node("default:rail", {
description = "Rail",
drawtype = "raillike",
tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
inventory_image = "default_rail.png",
wield_image = "default_rail.png",
paramtype = "light",
is_ground_content = true,
walkable = false,
selection_box = {
type = "fixed",
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
groups = {bendy=2,snappy=1,dig_immediate=2,rail=1,attached_node=1},
after_place_node = function(pos, placer, itemstack)
if not mesecon then
minetest.env:get_meta(pos):set_string("cart_acceleration", "0.5")
end
end,
mesecons = {
effector = {
action_on = function(pos, node)
minetest.env:get_meta(pos):set_string("cart_acceleration", "0.5")
end,
action_off = function(pos, node)
minetest.env:get_meta(pos):set_string("cart_acceleration", "0")
end,
},
},
})
})

309
mods/default/functions.lua Normal file
View File

@ -0,0 +1,309 @@
-- mods/default/functions.lua
--
-- Sounds
--
function default.node_sound_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="", gain=1.0}
table.dug = table.dug or
{name="default_dug_node", gain=0.25}
table.place = table.place or
{name="default_place_node_hard", gain=1.0}
return table
end
function default.node_sound_stone_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.5}
default.node_sound_defaults(table)
return table
end
function default.node_sound_dirt_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_dirt_footstep", gain=1.0}
table.dug = table.dug or
{name="default_dug_node_soil", gain=1.5}
table.place = table.place or
{name="default_place_node", gain=1.0}
default.node_sound_defaults(table)
return table
end
function default.node_sound_sand_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_sand_footstep", gain=0.5}
table.dug = table.dug or
{name="default_dug_node_sand", gain=1.0}
table.place = table.place or
{name="default_place_node", gain=1.0}
default.node_sound_defaults(table)
return table
end
function default.node_sound_wood_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_wood_footstep", gain=0.5}
default.node_sound_defaults(table)
return table
end
function default.node_sound_leaves_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.35}
table.dig = table.dig or
{name="default_dig_crumbly", gain=0.4}
table.dug = table.dug or
{name="default_grass_footstep", gain=1.0}
table.place = table.place or
{name="default_place_node", gain=1.0}
default.node_sound_defaults(table)
return table
end
function default.node_sound_glass_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_glass_footstep", gain=0.5}
table.dug = table.dug or
{name="default_break_glass", gain=1.0}
default.node_sound_defaults(table)
return table
end
--
-- Legacy
--
function default.spawn_falling_node(p, nodename)
spawn_falling_node(p, nodename)
end
-- Horrible crap to support old code
-- Don't use this and never do what this does, it's completely wrong!
-- (More specifically, the client and the C++ code doesn't get the group)
function default.register_falling_node(nodename, texture)
minetest.log("error", debug.traceback())
minetest.log('error', "WARNING: default.register_falling_node is deprecated")
if minetest.registered_nodes[nodename] then
minetest.registered_nodes[nodename].groups.falling_node = 1
end
end
--
-- Global callbacks
--
-- Global environment step function
function on_step(dtime)
-- print("on_step")
end
minetest.register_globalstep(on_step)
function on_placenode(p, node)
--print("on_placenode")
end
minetest.register_on_placenode(on_placenode)
function on_dignode(p, node)
--print("on_dignode")
end
minetest.register_on_dignode(on_dignode)
function on_punchnode(p, node)
end
minetest.register_on_punchnode(on_punchnode)
--
-- Lavacooling
--
default.cool_lava_source = function(pos)
minetest.set_node(pos, {name="default:obsidian"})
end
default.cool_lava_flowing = function(pos)
minetest.set_node(pos, {name="default:stone"})
end
minetest.register_abm({
nodenames = {"default:lava_flowing"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider)
end,
})
minetest.register_abm({
nodenames = {"default:lava_source"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider)
end,
})
--
-- Papyrus and cactus growing
--
minetest.register_abm({
nodenames = {"default:cactus"},
neighbors = {"group:sand"},
interval = 50,
chance = 20,
action = function(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if minetest.get_item_group(name, "sand") ~= 0 then
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "default:cactus" and height < 4 do
height = height+1
pos.y = pos.y+1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:cactus"})
end
end
end
end,
})
minetest.register_abm({
nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass"},
interval = 50,
chance = 20,
action = function(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if name == "default:dirt" or name == "default:dirt_with_grass" then
if minetest.find_node_near(pos, 3, {"group:water"}) == nil then
return
end
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "default:papyrus" and height < 4 do
height = height+1
pos.y = pos.y+1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:papyrus"})
end
end
end
end,
})
--
-- Leafdecay
--
-- To enable leaf decay for a node, add it to the "leafdecay" group.
--
-- The rating of the group determines how far from a node in the group "tree"
-- the node can be without decaying.
--
-- If param2 of the node is ~= 0, the node will always be preserved. Thus, if
-- the player places a node of that kind, you will want to set param2=1 or so.
--
-- If the node is in the leafdecay_drop group then the it will always be dropped
-- as an item
default.leafdecay_trunk_cache = {}
default.leafdecay_enable_cache = true
-- Spread the load of finding trunks
default.leafdecay_trunk_find_allow_accumulator = 0
minetest.register_globalstep(function(dtime)
local finds_per_second = 5000
default.leafdecay_trunk_find_allow_accumulator =
math.floor(dtime * finds_per_second)
end)
minetest.register_abm({
nodenames = {"group:leafdecay"},
neighbors = {"air", "group:liquid"},
-- A low interval and a high inverse chance spreads the load
interval = 2,
chance = 5,
action = function(p0, node, _, _)
--print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")")
local do_preserve = false
local d = minetest.registered_nodes[node.name].groups.leafdecay
if not d or d == 0 then
--print("not groups.leafdecay")
return
end
local n0 = minetest.get_node(p0)
if n0.param2 ~= 0 then
--print("param2 ~= 0")
return
end
local p0_hash = nil
if default.leafdecay_enable_cache then
p0_hash = minetest.hash_node_position(p0)
local trunkp = default.leafdecay_trunk_cache[p0_hash]
if trunkp then
local n = minetest.get_node(trunkp)
local reg = minetest.registered_nodes[n.name]
-- Assume ignore is a trunk, to make the thing work at the border of the active area
if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then
--print("cached trunk still exists")
return
end
--print("cached trunk is invalid")
-- Cache is invalid
table.remove(default.leafdecay_trunk_cache, p0_hash)
end
end
if default.leafdecay_trunk_find_allow_accumulator <= 0 then
return
end
default.leafdecay_trunk_find_allow_accumulator =
default.leafdecay_trunk_find_allow_accumulator - 1
-- Assume ignore is a trunk, to make the thing work at the border of the active area
local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"})
if p1 then
do_preserve = true
if default.leafdecay_enable_cache then
--print("caching trunk")
-- Cache the trunk
default.leafdecay_trunk_cache[p0_hash] = p1
end
end
if not do_preserve then
-- Drop stuff other than the node itself
itemstacks = minetest.get_node_drops(n0.name)
for _, itemname in ipairs(itemstacks) do
if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0 or
itemname ~= n0.name then
local p_drop = {
x = p0.x - 0.5 + math.random(),
y = p0.y - 0.5 + math.random(),
z = p0.z - 0.5 + math.random(),
}
minetest.add_item(p_drop, itemname)
end
end
-- Remove node
minetest.remove_node(p0)
nodeupdate(p0)
end
end
})

File diff suppressed because it is too large Load Diff

View File

@ -173,6 +173,68 @@ minetest.register_ore({
height_min = -31000,
height_max = -64,
})
if minetest.setting_get("mg_name") == "indev" then
-- Floatlands and high mountains springs
minetest.register_ore({
ore_type = "scatter",
ore = "default:water_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 40*40*40,
clust_num_ores = 8,
clust_size = 3,
height_min = 100,
height_max = 31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:lava_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 50*50*50,
clust_num_ores = 5,
clust_size = 2,
height_min = 10000,
height_max = 31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:sand",
wherein = "default:stone",
clust_scarcity = 20*20*20,
clust_num_ores = 5*5*3,
clust_size = 5,
height_min = 500,
height_max = 31000,
})
-- Underground springs
minetest.register_ore({
ore_type = "scatter",
ore = "default:water_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 25*25*25,
clust_num_ores = 8,
clust_size = 3,
height_min = -10000,
height_max = -10,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:lava_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 35*35*35,
clust_num_ores = 5,
clust_size = 2,
height_min = -31000,
height_max = -100,
})
end
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
minetest.log('action', "WARNING: default.generate_ore is deprecated")
@ -203,8 +265,8 @@ function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume
local y2 = y0+y1
local z2 = z0+z1
local p2 = {x=x2, y=y2, z=z2}
if minetest.env:get_node(p2).name == wherein then
minetest.env:set_node(p2, {name=name})
if minetest.get_node(p2).name == wherein then
minetest.set_node(p2, {name=name})
end
end
end
@ -217,10 +279,10 @@ end
function default.make_papyrus(pos, size)
for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z}
local nn = minetest.env:get_node(p).name
local nn = minetest.get_node(p).name
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
minetest.env:set_node(p, {name="default:papyrus"})
minetest.set_node(p, {name="default:papyrus"})
else
return
end
@ -258,11 +320,11 @@ function default.make_nyancat(pos, facedir, length)
tailvec.z = 1
end
local p = {x=pos.x, y=pos.y, z=pos.z}
minetest.env:set_node(p, {name="default:nyancat", param2=facedir})
minetest.set_node(p, {name="default:nyancat", param2=facedir})
for i=1,length do
p.x = p.x + tailvec.x
p.z = p.z + tailvec.z
minetest.env:set_node(p, {name="default:nyancat_rainbow"})
minetest.set_node(p, {name="default:nyancat_rainbow"})
end
end
@ -298,17 +360,17 @@ minetest.register_on_generated(function(minp, maxp, seed)
for divz=0+1,divs-1-1 do
local cx = minp.x + math.floor((divx+0.5)*divlen)
local cz = minp.z + math.floor((divz+0.5)*divlen)
if minetest.env:get_node({x=cx,y=1,z=cz}).name == "default:water_source" and
minetest.env:get_node({x=cx,y=0,z=cz}).name == "default:sand" then
if minetest.get_node({x=cx,y=1,z=cz}).name == "default:water_source" and
minetest.get_node({x=cx,y=0,z=cz}).name == "default:sand" then
local is_shallow = true
local num_water_around = 0
if minetest.env:get_node({x=cx-divlen*2,y=1,z=cz+0}).name == "default:water_source" then
if minetest.get_node({x=cx-divlen*2,y=1,z=cz+0}).name == "default:water_source" then
num_water_around = num_water_around + 1 end
if minetest.env:get_node({x=cx+divlen*2,y=1,z=cz+0}).name == "default:water_source" then
if minetest.get_node({x=cx+divlen*2,y=1,z=cz+0}).name == "default:water_source" then
num_water_around = num_water_around + 1 end
if minetest.env:get_node({x=cx+0,y=1,z=cz-divlen*2}).name == "default:water_source" then
if minetest.get_node({x=cx+0,y=1,z=cz-divlen*2}).name == "default:water_source" then
num_water_around = num_water_around + 1 end
if minetest.env:get_node({x=cx+0,y=1,z=cz+divlen*2}).name == "default:water_source" then
if minetest.get_node({x=cx+0,y=1,z=cz+divlen*2}).name == "default:water_source" then
num_water_around = num_water_around + 1 end
if num_water_around >= 2 then
is_shallow = false
@ -316,8 +378,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
if is_shallow then
for x1=-divlen,divlen do
for z1=-divlen,divlen do
if minetest.env:get_node({x=cx+x1,y=0,z=cz+z1}).name == "default:sand" then
minetest.env:set_node({x=cx+x1,y=0,z=cz+z1}, {name="default:clay"})
if minetest.get_node({x=cx+x1,y=0,z=cz+z1}).name == "default:sand" then
minetest.set_node({x=cx+x1,y=0,z=cz+z1}, {name="default:clay"})
end
end
end
@ -326,7 +388,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
end
-- Generate papyrus
local perlin1 = minetest.env:get_perlin(354, 3, 0.7, 100)
local perlin1 = minetest.get_perlin(354, 3, 0.7, 100)
-- Assume X and Z lengths are equal
local divlen = 8
local divs = (maxp.x-minp.x)/divlen+1;
@ -343,15 +405,15 @@ minetest.register_on_generated(function(minp, maxp, seed)
for i=0,papyrus_amount do
local x = pr:next(x0, x1)
local z = pr:next(z0, z1)
if minetest.env:get_node({x=x,y=1,z=z}).name == "default:dirt_with_grass" and
minetest.env:find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then
if minetest.get_node({x=x,y=1,z=z}).name == "default:dirt_with_grass" and
minetest.find_node_near({x=x,y=1,z=z}, 1, "default:water_source") then
default.make_papyrus({x=x,y=2,z=z}, pr:next(2, 4))
end
end
end
end
-- Generate cactuses
local perlin1 = minetest.env:get_perlin(230, 3, 0.6, 100)
local perlin1 = minetest.get_perlin(230, 3, 0.6, 100)
-- Assume X and Z lengths are equal
local divlen = 16
local divs = (maxp.x-minp.x)/divlen+1;
@ -371,20 +433,20 @@ minetest.register_on_generated(function(minp, maxp, seed)
-- Find ground level (0...15)
local ground_y = nil
for y=30,0,-1 do
if minetest.env:get_node({x=x,y=y,z=z}).name ~= "air" then
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
ground_y = y
break
end
end
-- If desert sand, make cactus
if ground_y and minetest.env:get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then
if ground_y and minetest.get_node({x=x,y=ground_y,z=z}).name == "default:desert_sand" then
default.make_cactus({x=x,y=ground_y+1,z=z}, pr:next(3, 4))
end
end
end
end
-- Generate grass
local perlin1 = minetest.env:get_perlin(329, 3, 0.6, 100)
local perlin1 = minetest.get_perlin(329, 3, 0.6, 100)
-- Assume X and Z lengths are equal
local divlen = 16
local divs = (maxp.x-minp.x)/divlen+1;
@ -404,7 +466,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
-- Find ground level (0...15)
local ground_y = nil
for y=30,0,-1 do
if minetest.env:get_node({x=x,y=y,z=z}).name ~= "air" then
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
ground_y = y
break
end
@ -412,18 +474,18 @@ minetest.register_on_generated(function(minp, maxp, seed)
if ground_y then
local p = {x=x,y=ground_y+1,z=z}
local nn = minetest.env:get_node(p).name
local nn = minetest.get_node(p).name
-- Check if the node can be replaced
if minetest.registered_nodes[nn] and
minetest.registered_nodes[nn].buildable_to then
nn = minetest.env:get_node({x=x,y=ground_y,z=z}).name
nn = minetest.get_node({x=x,y=ground_y,z=z}).name
-- If desert sand, make dry shrub
if nn == "default:desert_sand" then
minetest.env:set_node(p,{name="default:dry_shrub"})
minetest.set_node(p,{name="default:dry_shrub"})
-- If grass, make junglegrass
elseif nn == "default:dirt_with_grass" then
minetest.env:set_node(p,{name="default:junglegrass"})
minetest.set_node(p,{name="default:junglegrass"})
end
end
end

1191
mods/default/nodes.lua Normal file

File diff suppressed because it is too large Load Diff

607
mods/default/snow.lua Normal file
View File

@ -0,0 +1,607 @@
---
---AFTERPARTY SNOW ---
---
minetest.register_node("default:needles", {
description = "Pine Needles",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"snow_needles.png"},
paramtype = "light",
groups = {snappy=3, leafdecay=3, flammable=2},
drop = {
max_items = 1,
items = {
{
-- player will get xmas tree with 1/50 chance
items = {'default:xmas_tree'},
rarity = 50,
},
{
-- player will get sapling with 1/20 chance
items = {'default:sapling_pine'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'default:needles'},
}
}
},
--Remove snow above leaves after decay.
after_destruct = function(pos, node, digger)
pos.y = pos.y + 1
local nodename = minetest.get_node(pos).name
if nodename == "default:snow" then
minetest.remove_node(pos)
end
end,
sounds = default.node_sound_leaves_defaults(),
})
--Decorated Pine leaves.
minetest.register_node("default:needles_decorated", {
description = "Decorated Pine Needles",
drawtype = "allfaces_optional",
tiles = {"snow_needles_decorated.png"},
paramtype = "light",
groups = {snappy=3, leafdecay=3, flammable=2},
drop = {
max_items = 1,
items = {
{
-- player will get xmas tree with 1/20 chance
items = {'default:xmas_tree'},
rarity = 50,
},
{
-- player will get sapling with 1/20 chance
items = {'default:sapling_pine'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {'default:needles_decorated'},
}
}
},
--Remove snow above leaves after decay.
after_destruct = function(pos, node, digger)
pos.y = pos.y + 1
local nodename = minetest.get_node(pos).name
if nodename == "default:snow" then
minetest.remove_node(pos)
end
end,
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:xmas_tree", {
description = "Christmas Tree",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"snow_xmas_tree.png"},
inventory_image = "snow_xmas_tree.png",
wield_image = "snow_xmas_tree.png",
paramtype = "light",
walkable = false,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("default:sapling_pine", {
description = "Pine Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"snow_sapling_pine.png"},
inventory_image = "snow_sapling_pine.png",
wield_image = "snow_sapling_pine.png",
paramtype = "light",
walkable = false,
groups = {snappy=2,dig_immediate=3,flammable=2},
sounds = default.node_sound_defaults(),
})
minetest.register_node("default:star", {
description = "Star",
drawtype = "torchlike",
tiles = {"snow_star.png"},
inventory_image = "snow_star.png",
wield_image = "snow_star.png",
paramtype = "light",
walkable = false,
groups = {snappy=2,dig_immediate=3},
sounds = default.node_sound_defaults(),
})
minetest.register_craft({
type = "fuel",
recipe = "default:needles",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sapling_pine",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:needles_decorated",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:xmas_tree",
burntime = 10,
})
--Snowballs
-------------
snowball_GRAVITY=9
snowball_VELOCITY=19
--Shoot snowball.
local snow_shoot_snowball=function (item, player, pointed_thing)
local playerpos=player:getpos()
local obj=minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, "default:snowball_entity")
local dir=player:get_look_dir()
obj:setvelocity({x=dir.x*snowball_VELOCITY, y=dir.y*snowball_VELOCITY, z=dir.z*snowball_VELOCITY})
obj:setacceleration({x=dir.x*-3, y=-snowball_GRAVITY, z=dir.z*-3})
item:take_item()
return item
end
--The snowball Entity
snow_snowball_ENTITY={
physical = false,
timer=0,
textures = {"snow_snowball.png"},
lastpos={},
collisionbox = {0,0,0,0,0,0},
}
--Snowball_entity.on_step()--> called when snowball is moving.
snow_snowball_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:getpos()
local node = minetest.get_node(pos)
--Become item when hitting a node.
if self.lastpos.x~=nil then --If there is no lastpos for some reason.
if node.name ~= "air" then
minetest.place_node(self.lastpos,{name="default:snow"})
self.object:remove()
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Node will be added at last pos outside the node
end
minetest.register_entity("default:snowball_entity", snow_snowball_ENTITY)
--Snowball.
minetest.register_craftitem("default:snowball", {
description = "Snowball",
inventory_image = "snow_snowball.png",
on_use = snow_shoot_snowball,
})
--Snow.
minetest.register_node("default:snow", {
description = "Snow",
tiles = {"snow_snow.png"},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
param2 = nil,
--param2 is reserved for what vegetation is hiding inside.
--mapgen defines the vegetation.
--1 = Moss
groups = {crumbly=3,melts=3},
buildable_to = true,
drop = 'default:snowball',
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.35, 0.5}
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.35, 0.5}
},
},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.45},
}),
--Update dirt node underneath default.
after_destruct = function(pos, node, digger)
if node.param2 == 1 then
local n = minetest.get_node(pos).name
if n == "air" or n == "default:water_flowing" or n == "default:water_source" then
minetest.add_node(pos,{name="default:moss",param2=1})
end
end
pos.y = pos.y - 1
local nodename = minetest.get_node(pos).name
if nodename == "default:dirt_with_snow" then
minetest.add_node(pos,{name="default:dirt_with_grass"})
end
end,
on_construct = function(pos, newnode)
pos.y = pos.y - 1
local nodename = minetest.get_node(pos).name
if nodename == "default:dirt_with_grass" then
minetest.remove_node(pos)
minetest.add_node(pos,{name="default:dirt_with_snow"})
elseif nodename == "air" then
pos.y = pos.y + 1
minetest.remove_node(pos)
end
end,
})
--Snow with dirt.
minetest.register_node("default:dirt_with_snow", {
description = "Dirt with Snow",
tiles = {"snow_snow.png", "default_dirt.png", "default_dirt.png^snow_snow_side.png"},
is_ground_content = true,
groups = {crumbly=3},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.4},
}),
--Place snow above this node when placed.
after_place_node = function(pos, newnode)
pos.y = pos.y + 1
local nodename = minetest.get_node(pos).name
if nodename == "air" then
minetest.add_node(pos,{name="default:snow"})
end
end,
})
--Gets rid of snow when the node underneath is dug.
local unsnowify = function(pos, node, digger)
if node.name == "default:dry_shrub" then
pos.y = pos.y - 1
local nodename = minetest.get_node(pos).name
if nodename == "default:dirt_with_snow" then
minetest.add_node(pos,{name="default:dirt_with_grass"})
end
pos.y = pos.y + 1
end
pos.y = pos.y + 1
local nodename = minetest.get_node(pos).name
if nodename == "default:snow" then
minetest.remove_node(pos)
local obj=minetest.add_entity({x=pos.x,y=pos.y,z=pos.z}, "default:snowball_entity")
obj:setacceleration({x=0, y=-snowball_GRAVITY, z=0})
end
end
minetest.register_on_dignode(unsnowify)
--Snow block.
minetest.register_node("default:snow_block", {
description = "Snow",
tiles = {"snow_snow.png"},
--param2 is reserved for what vegetation is hiding inside.
--mapgen defines the vegetation.
--1 = Moss
--2 = Papyrus
--3 = Dry shrub
is_ground_content = true,
groups = {crumbly=3,melts=2,falling_node=1},
drop = 'default:snow_block',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
--Update dirt node underneath default.
after_destruct = function(pos, node, digger)
if node.param2 == 1 then
local n = minetest.get_node(pos).name
if n == "air" or n == "default:water_flowing" or n == "default:water_source" then
minetest.add_node(pos,{name="default:moss",param2=1})
end
elseif node.param2 == 2 then
local n = minetest.get_node(pos).name
if n == "air" or n == "default:water_flowing" or n == "default:water_source" then
minetest.add_node(pos,{name="default:papyrus"})
pos.y = pos.y + 1
local n = minetest.get_node(pos)
if n.name == "default:snow_block" and n.param2 == 2 then
minetest.remove_node(pos)
pos.y = pos.y - 1
minetest.add_node(pos,{name="default:snow_block",param2=2})
end
end
elseif node.param2 == 3 then
local n = minetest.get_node(pos).name
if n == "air" or n == "default:water_flowing" or n == "default:water_source" then
minetest.add_node(pos,{name="default:dry_shrub"})
end
end
end,
})
--Snow brick.
minetest.register_node("default:snow_brick", {
description = "Snow Brick",
tiles = {"snow_snow_brick.png"},
is_ground_content = true,
groups = {crumbly=3,melts=2},
drop = 'default:snow_brick',
sounds = default.node_sound_dirt_defaults(),
})
--Ice.
minetest.register_node("default:ice", {
description = "Ice",
tiles = {"snow_ice.png"},
is_ground_content = true,
use_texture_alpha = true,
drawtype = "glasslike",
groups = {snappy=2,cracky=3,melts=1},
drop = 'default:ice',
paramtype = "light",
sunlight_propagates = true,
sounds = default.node_sound_glass_defaults(),
})
--Moss.
minetest.register_node("default:moss", {
description = "Moss",
tiles = {"snow_moss.png"},
drawtype = "signlike",
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
selection_box = {
type = "wallmounted",
},
is_ground_content = true,
groups = {crumbly=3, flammable=2, attached_node=1},
})
minetest.register_craft({
output = 'default:snow_block',
recipe = {
{'default:snowball', 'default:snowball'},
{'default:snowball', 'default:snowball'},
},
})
minetest.register_craft({
output = 'default:snow_brick',
recipe = {
{'default:snow_block', 'default:snow_block'},
{'default:snow_block', 'default:snow_block'},
},
})
local function stop_slip(player, time)
minetest.after(time, function()
player:set_physics_override(1, 1, 1)
end)
end
local SLIPPERY_ICE = true --experimental and default disabled
--ice (slippery)
if SLIPPERY_ICE then --experimental
minetest.register_abm({
nodenames = {"default:ice"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
for _,object in ipairs(minetest.get_objects_inside_radius(pos, 0.9)) do
if object:is_player() then
--minetest.sound_play("dplus_hurt", {pos = pos, gain = 0.5, max_hear_distance = 10})
object:set_physics_override(0.8, 1, 1)--(speed, jump, gravity)
local po = object:getpos()
local dir = object:get_look_dir()
local tab = object:get_player_control()
if tab["right"] or tab["left"] or tab["down"] or tab["up"] then
--object:setpos({x=po.x+math.ceil(dir.x)*i,y=po.y, z=po.z+math.ceil(dir.z)*i}, true)
object:moveto({x=po.x+math.ceil(dir.x)*0.03,y=po.y, z=po.z+math.ceil(dir.z)*0.03}, true)
end
stop_slip(object, 1)
end
end
end})
end
--remove dirt_with_snow (when snow digged)
minetest.register_on_dignode(function(pos, oldnode, digger)
if oldnode.name == "default:snow" then
pos.y = pos.y-1
if minetest.get_node(pos).name == "default:dirt_with_snow" then
minetest.set_node(pos, {name="default:dirt_with_grass"})
end
end
end)
--Melting
--Any node part of the group melting will melt when near warm nodes such as lava, fire, torches, etc.
--The amount of water that replaces the node is defined by the number on the group:
--1: one water_source
--2: four water_flowings
--3: one water_flowing
minetest.register_abm({
nodenames = {"group:melts"},
neighbors = {"group:igniter","default:torch","default:furnace_active","group:hot"},
interval = 2,
chance = 2,
action = function(pos, node, active_object_count, active_object_count_wider)
local intensity = minetest.get_item_group(node.name,"melts")
if intensity == 1 then
minetest.add_node(pos,{name="default:water_source"})
elseif intensity == 2 then
local check_place = function(pos,node)
if minetest.get_node(pos).name == "air" then
minetest.place_node(pos,node)
end
end
minetest.add_node(pos,{name="default:water_flowing"})
check_place({x=pos.x+1,y=pos.y,z=pos.z},{name="default:water_flowing"})
check_place({x=pos.x-1,y=pos.y,z=pos.z},{name="default:water_flowing"})
check_place({x=pos.x,y=pos.y+1,z=pos.z},{name="default:water_flowing"})
check_place({x=pos.x,y=pos.y-1,z=pos.z},{name="default:water_flowing"})
elseif intensity == 3 then
minetest.add_node(pos,{name="default:water_flowing"})
end
nodeupdate(pos)
end,
})
--Freezing
--Water freezes when in contact with default.
minetest.register_abm({
nodenames = {"default:water_source"},
neighbors = {"default:snow", "default:snow_block"},
interval = 20,
chance = 4,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.add_node(pos,{name="default:ice"})
end,
})
--Spread moss to cobble.
minetest.register_abm({
nodenames = {"default:cobble"},
neighbors = {"default:moss"},
interval = 20,
chance = 6,
action = function(pos, node, active_object_count, active_object_count_wider)
minetest.add_node(pos,{name="default:mossycobble"})
end,
})
--Grow saplings
minetest.register_abm({
nodenames = {"default:sapling_pine"},
interval = 10,
chance = 50,
action = function(pos, node, active_object_count, active_object_count_wider)
default.make_pine(pos,false)
end,
})
--Grow saplings
minetest.register_abm({
nodenames = {"default:xmas_tree"},
interval = 10,
chance = 50,
action = function(pos, node, active_object_count, active_object_count_wider)
default.make_pine(pos,false,true)
end,
})
if default.enable_snowfall then
--Snowing
snow_fall=function (pos)
local obj=minetest.add_entity(pos, "default:fall_entity")
obj:setvelocity({x=0, y=-1, z=0})
end
-- The snowfall Entity
snow_fall_ENTITY={
physical = true,
timer=0,
textures = {"snow_snowfall.png"},
lastpos={},
collisionbox = {0,0,0,0,0,0},
}
-- snowfall_entity.on_step()--> called when snow is falling
snow_fall_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:getpos()
local node = minetest.get_node(pos)
if self.lastpos and self.object:getvelocity().y == 0 then
if minetest.get_node({x=self.lastpos.x,z=self.lastpos.z,y=self.lastpos.y}).name == "default:moss" then
minetest.add_node({x=self.lastpos.x,z=self.lastpos.z,y=self.lastpos.y},{name="default:snow",param2=1})
self.object:remove()
return
end
minetest.place_node(self.lastpos,{name="default:snow"})
self.object:remove()
end
if self.timer > 120 then
self.object:remove()
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Node will be added at last pos outside the node
end
minetest.register_entity("default:fall_entity", snow_fall_ENTITY)
--Regenerate Snow
minetest.register_abm({
nodenames = {"default:dirt_with_grass", "default:desert_sand", "default:moss"},
interval = 50,
chance = 150,
action = function(pos, node, active_object_count, active_object_count_wider)
--Check we are in the right biome
local env = minetest.env
local perlin1 = env:get_perlin(112,3, 0.5, 150)
local test = perlin1:get2d({x=pos.x, y=pos.z})
local in_biome = false
local smooth = default.smooth
if smooth and (test > 0.73 or (test > 0.43 and math.random(0,29) > (0.73 - test) * 100 )) then
in_biome = true
elseif not smooth and test > 0.53 then
in_biome = true
end
if in_biome then
--Check if block is under cover
local ground_y = nil
for y=15,0,-1 do
if env:get_node({x=pos.x,y=y+pos.y,z=pos.z}).name ~= "air" then
ground_y = pos.y+y
break
end
end
if ground_y then
local n = env:get_node({x=pos.x,y=ground_y,z=pos.z})
if (n.name ~= "default:snow" and n.name ~= "default:snow_block" and n.name ~= "default:ice" and n.name ~= "default:water_source" and n.name ~= "default:papyrus") then
local obj = minetest.get_objects_inside_radius({x=pos.x,y=ground_y+20,z=pos.z}, 15)
for i,v in pairs(obj) do
e = v:get_luaentity()
if e ~= nil and e.name == "default:fall_entity" then
return
end
end
snow_fall({x=pos.x,y=ground_y+15,z=pos.z})
if default.debug then
print("snowfall at x"..pos.x.." y"..pos.z)
end
end
end
end
end
})
end
minetest.register_alias("snow:snow", "default:snow")
minetest.register_alias("snow:ice", "default:ice")
minetest.register_alias("default:moss", "dwarves:moss")
minetest.register_alias("snow:dirt_with_snow", "default:dirt_with_snow")
minetest.register_alias("snow:snow_block", "default:snow_block")
minetest.register_alias("snow:snowball", "default:snowball")
minetest.register_alias("snow:needles", "default:needles")
minetest.register_alias("snow:snow_brick", "default:snow_brick")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

270
mods/default/tools.lua Normal file
View File

@ -0,0 +1,270 @@
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
crumbly = {times={[6]=1.2, [7]=0.70}, uses=0},
snappy = {times={[6]=0.70, [7]=0.40}, uses=0},
oddly_breakable_by_hand = {times={[1]=10.00,[2]=8.50,[3]=7.00,[4]=4.00,[5]=2.70, [6]=2.0, [7]=1.40}, uses=0}
},
damage_groups = {fleshy=1},
}
})
-- Picks
minetest.register_tool("default:pick_wood", {
description = "Wooden Pickaxe",
inventory_image = "default_tool_woodpick.png",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
cracky = {times={[6]=1.6, [7]=1.0}, uses=10},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:pick_stone", {
description = "Stone Pickaxe",
inventory_image = "default_tool_stonepick.png",
tool_capabilities = {
full_punch_interval = 1.3,
max_drop_level=0,
groupcaps={
cracky = {times={[5]=1.70, [6]=1.0, [7]=0.8}, uses=20},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:pick_steel", {
description = "Steel Pickaxe",
inventory_image = "default_tool_steelpick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[4]=1.80, [5]=1.3, [6]=0.8, [7]=0.5}, uses=25},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:pick_bronze", {
description = "Bronze Pickaxe",
inventory_image = "default_tool_bronzepick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky = {times={[3]=2.80, [4]=2.10, [5]=1.40, [6]=0.5, [7]=0.3}, uses=30},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:pick_mese", {
description = "Mese Pickaxe",
inventory_image = "default_tool_mesepick.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[2]=3.0, [3]=2.4, [4]=1.2, [5]=1.70, [6]=0.3, [7]=0.1}, uses=20},
},
damage_groups = {fleshy=5},
},
})
-- Shovels
minetest.register_tool("default:shovel_wood", {
description = "Wooden Shovel",
inventory_image = "default_tool_woodshovel.png",
wield_image = "default_tool_woodshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
crumbly = {times={[6]=1.60, [7]=1.0}, uses=10},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:shovel_stone", {
description = "Stone Shovel",
inventory_image = "default_tool_stoneshovel.png",
wield_image = "default_tool_stoneshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.4,
max_drop_level=0,
groupcaps={
crumbly = {times={[5]=1.70, [6]=1.0, [7]=0.80}, uses=20},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:shovel_steel", {
description = "Steel Shovel",
inventory_image = "default_tool_steelshovel.png",
wield_image = "default_tool_steelshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
crumbly = {times={[4]=2.80, [5]=1.70, [6]=1.70, [7]=0.70}, uses=25},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:shovel_bronze", {
description = "Bronze Shovel",
inventory_image = "default_tool_bronzeshovel.png",
wield_image = "default_tool_bronzeshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
crumbly = {times={[3]=2.80, [4]=2.10, [5]=1.70, [6]=1.30, [7]=0.60}, uses=40},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:shovel_mese", {
description = "Mese Shovel",
inventory_image = "default_tool_meseshovel.png",
wield_image = "default_tool_meseshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
crumbly = {times={[2]=3.0, [3]=2.4, [4]=1.2, [5]=1.70, [6]=1.30, [7]=0.50}, uses=20},
},
damage_groups = {fleshy=4},
},
})
-- Axes
minetest.register_tool("default:axe_wood", {
description = "Wooden Axe",
inventory_image = "default_tool_woodaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
groupcaps={
choppy = {times={[6]=1.60, [7]=1.0}, uses=10},
},
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:axe_stone", {
description = "Stone Axe",
inventory_image = "default_tool_stoneaxe.png",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
choppy={times={[5]=1.70, [6]=1.0, [7]=0.80}, uses=20},
},
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:axe_steel", {
description = "Steel Axe",
inventory_image = "default_tool_steelaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[3]=2.50, [4]=1.40, [7]=1.00}, uses=25},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:axe_bronze", {
description = "Bronze Axe",
inventory_image = "default_tool_bronzeaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[3]=2.50, [4]=1.40, [7]=1.00}, uses=30},
},
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:axe_mese", {
description = "Mese Axe",
inventory_image = "default_tool_meseaxe.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
choppy={times={[3]=2.20, [4]=1.00, [7]=0.60}, uses=20},
},
damage_groups = {fleshy=6},
},
})
-- Swords
minetest.register_tool("default:sword_wood", {
description = "Wooden Sword",
inventory_image = "default_tool_woodsword.png",
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=0,
groupcaps={
snappy={times={[4]=1.6, [7]=0.40}, uses=10},
},
damage_groups = {fleshy=2},
}
})
minetest.register_tool("default:sword_stone", {
description = "Stone Sword",
inventory_image = "default_tool_stonesword.png",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
snappy={times={[4]=1.4, [7]=0.40}, uses=20},
},
damage_groups = {fleshy=4},
}
})
minetest.register_tool("default:sword_steel", {
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[3]=2.5, [4]=1.20, [7]=0.35}, uses=25},
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("default:sword_bronze", {
description = "Bronze Sword",
inventory_image = "default_tool_bronzesword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[3]=2.5, [4]=1.20, [7]=0.35}, uses=40},
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("default:sword_mese", {
description = "Mese Sword",
inventory_image = "default_tool_mesesword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[3]=2.0, [4]=1.00, [7]=0.35}, uses=30},
},
damage_groups = {fleshy=7},
}
})

View File

@ -31,7 +31,7 @@ minetest.register_node("dwarves:barrel", {
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
groups = {choppy=6,oddly_breakable_by_hand=5},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
water=5000;

View File

@ -3,7 +3,7 @@ minetest.register_node("dwarves:hive_artificial", {
tiles = {"dwarves_hive_top.png", "dwarves_hive_top.png", "dwarves_hive_side.png",
"dwarves_hive_side.png", "dwarves_hive_side.png", "dwarves_hive_front.png"},
paramtype2 = "facedir",
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
groups = {choppy=6,oddly_breakable_by_hand=5},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
@ -49,7 +49,7 @@ minetest.register_node("dwarves:hive", {
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
groups = {choppy=6,oddly_breakable_by_hand=4},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)

View File

@ -14,9 +14,9 @@ minetest.register_tool("dwarves:heal", {
inventory_image = "dwarves_tool_heal.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=0.75, [2]=0.95, [3]=0.80}, uses=50, maxlevel=4},
fleshy={times={[3]=0.75, [4]=0.95, [7]=0.80}, uses=50},
},
damage_groups = {fleshy=-4},
}
@ -30,7 +30,7 @@ minetest.register_tool("dwarves:dagger_steel", {
full_punch_interval = 0.5,
max_drop_level=0,
groupcaps={
choppy={times={[1]=4.25, [2]=2.45, [3]=2.25}, uses=150, maxlevel=2},
choppy={times={[3]=4.25, [4]=2.45, [7]=2.25}, uses=150},
},
damage_groups = {fleshy=7},
}
@ -41,9 +41,9 @@ minetest.register_tool("dwarves:dagger_ebony", {
inventory_image = "dwarves_tool_ebonyknife.png",
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level=1,
groupcaps={
choppy={times={[1]=4.25, [2]=2.45, [3]=2.25}, uses=150, maxlevel=2},
choppy={times={[3]=4.25, [4]=2.45, [7]=2.25}, uses=150},
},
damage_groups = {fleshy=9},
}
@ -54,9 +54,9 @@ minetest.register_tool("dwarves:dagger_obs", {
inventory_image = "dwarves_tool_obsdagger.png",
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level=1,
groupcaps={
choppy={times={[1]=4.25, [2]=2.45, [3]=2.25}, uses=75, maxlevel=2},
choppy={times={[3]=4.25, [4]=2.45, [7]=2.25}, uses=75},
},
damage_groups = {fleshy=7},
}
@ -67,47 +67,23 @@ minetest.register_tool("dwarves:axe", {
inventory_image = "dwarves_sonic_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=5,
groupcaps={
cracky={times={[1]=0.01, [2]=0.01, [3]=0.01, [4]=0.1, [5]=0.501, [6]=0.501}, uses=200, maxlevel=6},
crumbly={times={[1]=0.01, [2]=0.01, [3]=0.01, [4]=0.1, [5]=0.501, [6]=0.501}, uses=200, maxlevel=6},
snappy={times={[1]=0.01, [2]=0.01, [3]=0.01, [4]=0.1, [5]=0.5, [6]=0.501}, uses=200, maxlevel=6}
cracky={times={[3]=0.01, [4]=0.01, [2]=0.01, [4]=0.1, [5]=0.501, [1]=0.501}, uses=200},
crumbly={times={[3]=0.01, [4]=0.01, [2]=0.01, [4]=0.1, [5]=0.501, [1]=0.501}, uses=200},
snappy={times={[3]=0.01, [4]=0.01, [2]=0.01, [4]=0.1, [5]=0.5, [1]=0.501}, uses=200}
}
},
})
minetest.register_node("dwarves:glass", {
description = "Ultimate Glass",
drawtype = "glasslike",
tiles = {"default_glass.png"},
inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light",
sunlight_propagates = true,
is_ground_content = true,
groups = {snappy=6,cracky=6, level=6},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_node("dwarves:glass_vis", {
description = "Invisible Glass",
drawtype = "glasslike",
tiles = {"default_glass_vis.png"},
inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light",
sunlight_propagates = true,
is_ground_content = true,
groups = {snappy=3,cracky=3, level=1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_tool("dwarves:pick_ebony", {
description = "Ebony Pickaxe",
inventory_image = "dwarves_tool_ebonypick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
cracky={times={[1]=2.5, [2]=1.5, [3]=1.0}, uses=60, maxlevel=4},
cracky={times={[4]=2.80, [5]=1.70, [6]=1.30, [7]=0.5}, uses=60},
},
damage_groups = {fleshy=4},
},
@ -117,9 +93,9 @@ minetest.register_tool("dwarves:axe_ebony", {
description = "Ebony Axe",
inventory_image = "dwarves_tool_ebonyaxe.png",
tool_capabilities = {
max_drop_level=3,
groupcaps={
choppy={times={[1]=2.5, [2]=1.5, [3]=1.0}, uses=60, maxlevel=4},
choppy={times={[4]=2.80, [5]=1.70, [6]=1.30, [7]=0.5}, uses=60},
},
damage_groups = {fleshy=4},
},
@ -130,9 +106,9 @@ minetest.register_tool("dwarves:shovel_ebony", {
inventory_image = "dwarves_tool_ebonyshovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
crumbly={times={[1]=2.5, [2]=1.5, [3]=1.0}, uses=60, maxlevel=4},
crumbly={times={[4]=2.80, [5]=1.70, [6]=1.30, [7]=0.5}, uses=60},
},
damage_groups = {fleshy=2},
},
@ -143,9 +119,9 @@ minetest.register_tool("dwarves:sword_ebony", {
inventory_image = "dwarves_tool_ebonysword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=0.75, [2]=0.95, [3]=0.80}, uses=50, maxlevel=4},
fleshy={times={[3]=0.75, [4]=0.95, [7]=0.80}, uses=50},
},
damage_groups = {fleshy=7},
}
@ -155,9 +131,9 @@ minetest.register_tool("dwarves:pick_obs", {
description = "Obsidian Pickaxe",
inventory_image = "dwarves_tool_obspick.png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
cracky={times={[1]=4.5, [2]=2.0, [3]=1.5}, uses=100, maxlevel=2}
cracky={times={[5]=1.70, [6]=1.0, [7]=0.80}, uses=100}
},
damage_groups = {fleshy=4},
},
@ -167,9 +143,9 @@ minetest.register_tool("dwarves:shovel_obs", {
description = "Obsidian Shovel",
inventory_image = "dwarves_tool_obsshovel.png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
crumbly={times={[1]=2.25, [2]=1.25, [3]=1.00}, uses=75, maxlevel=2}
crumbly={times={[5]=1.70, [6]=1.0, [7]=0.80}, uses=75}
},
damage_groups = {fleshy=2},
},
@ -180,9 +156,9 @@ minetest.register_tool("dwarves:axe_obs", {
description = "Obsidian Axe",
inventory_image = "dwarves_tool_obsaxe.png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
choppy={times={[1]=4.25, [2]=2.45, [3]=2.25}, uses=75, maxlevel=2},
choppy={times={[5]=1.70, [6]=1.0, [7]=0.80}, uses=75},
},
damage_groups = {fleshy=4},
},
@ -193,9 +169,9 @@ minetest.register_tool("dwarves:club_obs", {
inventory_image = "dwarves_tool_obsclub.png",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=4},
snappy={times={[3]=1.90, [4]=0.90, [7]=0.30}, uses=40},
},
damage_groups = {fleshy=6},
}
@ -206,9 +182,9 @@ minetest.register_tool("dwarves:durin_axe", {
inventory_image = "dwarves_tool_durinaxe.png",
tool_capabilities = {
full_punch_interval = 0.75,
max_drop_level=1,
groupcaps={
choppy={times={[1]=3.50, [2]=1.50, [3]=1.60}, uses=200, maxlevel=1},
choppy={times={[3]=3.50, [4]=1.50, [7]=1.60}, uses=200},
},
damage_groups = {fleshy=14},
}
@ -219,9 +195,9 @@ minetest.register_tool("dwarves:sword_obs", {
inventory_image = "dwarves_tool_obssword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=4},
snappy={times={[3]=1.90, [4]=0.90, [7]=0.30}, uses=40},
},
damage_groups = {fleshy=10},
}
@ -232,9 +208,9 @@ minetest.register_tool("dwarves:bataxe_pob", {
inventory_image = "dwarves_tool_pobataxe.png",
tool_capabilities = {
full_punch_interval = 1.75,
max_drop_level=1,
groupcaps={
choppy={times={[1]=3.50, [2]=1.50, [3]=1.60}, uses=200, maxlevel=1},
choppy={times={[3]=3.50, [4]=1.50, [7]=1.60}, uses=200},
},
damage_groups = {fleshy=14},
}
@ -245,9 +221,8 @@ minetest.register_tool("dwarves:pick_adam", {
inventory_image = "dwarves_tool_adampick.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=175, maxlevel=5},
cracky = {times={[1]=3.0, [2]=2.8, [3]=2.4, [4]=2.1, [5]=1.6, [6]=1.1, [7]=0.6}, uses=175},
},
damage_groups = {fleshy=5},
},
@ -258,9 +233,8 @@ minetest.register_tool("dwarves:axe_adam", {
inventory_image = "dwarves_tool_adamaxe.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=200, maxlevel=5},
choppy={times={[1]=3.0, [2]=2.6, [3]=2.2, [4]=1.7, [5]=1.2, [6]=0.7, [7]=0.2}, uses=200},
},
damage_groups = {fleshy=6},
},
@ -273,9 +247,9 @@ minetest.register_tool("dwarves:shovel_adam", {
wield_image = "dwarves_tool_adamshovel.png^[transformR90",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=200, maxlevel=5},
crumbly = {times={[1]=3.0, [2]=2.6, [3]=2.2, [4]=1.7, [5]=1.2, [6]=0.7, [7]=0.2}, uses=200},
},
damage_groups = {fleshy=4},
},
@ -285,9 +259,9 @@ minetest.register_tool("dwarves:axe_pobe", {
description = "Pobe Axe",
inventory_image = "dwarves_tool_pobaxe.png",
tool_capabilities = {
max_drop_level=1,
groupcaps={
choppy={times={[1]=0.90, [2]=0.70, [3]=0.45}, uses=75, maxlevel=5},
choppy={times={[1]=2.3, [2]=2.1, [3]=1.8, [4]=1.3, [5]=0.8, [6]=0.4, [7]=0.2}, uses=75},
},
damage_groups = {fleshy=7},
},
@ -299,9 +273,9 @@ minetest.register_tool("dwarves:sword_pobe", {
inventory_image = "dwarves_tool_pobsword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=4},
snappy={times={[3]=1.90, [4]=0.90, [7]=0.30}, uses=40},
},
damage_groups = {fleshy=7},
}
@ -894,7 +868,29 @@ minetest.register_craft({
-- Node definitions
--
-- default node sounds
minetest.register_node("dwarves:glass", {
description = "Ultimate Glass",
drawtype = "glasslike",
tiles = {"default_glass.png"},
inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light",
sunlight_propagates = true,
is_ground_content = true,
groups = {snappy=6,cracky=6},
sounds = default.node_sound_glass_defaults(),
})
--[[minetest.register_node("dwarves:glass_vis", {
description = "Invisible Glass",
drawtype = "glasslike",
tiles = {"default_glass_vis.png"},
inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light",
sunlight_propagates = true,
is_ground_content = true,
groups = {snappy=3,cracky=3},
sounds = default.node_sound_glass_defaults(),
})--]]
minetest.register_node("dwarves:glass_lamp", {
description = "Glass Lamp",
@ -905,7 +901,7 @@ minetest.register_node("dwarves:glass_lamp", {
light_source = LIGHT_MAX,
sunlight_propagates = true,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
groups = {cracky=7,oddly_breakable_by_hand=5},
sounds = default.node_sound_glass_defaults(),
})
@ -913,7 +909,7 @@ minetest.register_node("dwarves:stone_with_obsidian", {
description = "Obsidian Ore",
tiles = {"default_stone.png^dwarves_mineral_obsidian.png"},
is_ground_content = true,
groups = {cracky=3},
groups = {cracky=5},
drop = {
max_items = 4,
items = {
@ -945,7 +941,7 @@ minetest.register_node("dwarves:diamond_ore", {
description = "Diamond Ore",
tiles = {"dwarves_mineral_diamond.png"},
is_ground_content = true,
groups = {cracky=1, level=5},
groups = {cracky=2},
drop = {
max_items = 1,
items = {
@ -961,7 +957,7 @@ minetest.register_node("dwarves:mithril_ore", {
description = "Mithril Ore",
tiles = {"default_stone.png^dwarves_mineral_mithril.png"},
is_ground_content = true,
groups = {cracky=1, level=5},
groups = {cracky=2},
drop = {
max_items = 1,
items = {
@ -977,7 +973,7 @@ minetest.register_node("dwarves:ebony_ore", {
description = "Ebony Ore",
tiles = {"default_stone.png^dwarves_mineral_ebony.png"},
is_ground_content = true,
groups = {cracky=2, level=3},
groups = {cracky=4},
drop = {
max_items = 1,
items = {
@ -993,7 +989,7 @@ minetest.register_node("dwarves:sapphire_ore", {
description = "Sapphire Ore",
tiles = {"dwarves_mineral_sapphire.png"},
is_ground_content = true,
groups = {cracky=1, level=5},
groups = {cracky=2},
drop = {
max_items = 1,
items = {
@ -1009,7 +1005,7 @@ minetest.register_node("dwarves:ruby_ore", {
description = "Ruby Ore",
tiles = {"dwarves_mineral_ruby.png"},
is_ground_content = true,
groups = {cracky=2, level=4},
groups = {cracky=3},
drop = {
max_items = 1,
items = {
@ -1025,7 +1021,7 @@ minetest.register_node("dwarves:emerald_ore", {
description = "Emerald Ore",
tiles = {"dwarves_mineral_emerald.png"},
is_ground_content = true,
groups = {cracky=2, level=4},
groups = {cracky=3},
drop = {
max_items = 1,
items = {
@ -1061,7 +1057,7 @@ minetest.register_node("dwarves:obsidian", {
},
}
},
groups = {snappy=1,bendy=2,cracky=1,melty=2,level=4},
groups = {cracky=4},
sounds = default.node_sound_stone_defaults(),
})
@ -1070,10 +1066,34 @@ minetest.register_node("dwarves:castiron", {
description = "Cast Iron",
tiles = {"dwarves_castiron.png"},
is_ground_content = true,
groups = {cracky=1,level=4},
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("dwarves:mossytree", {
description = "Mossy Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "dwarves_mossytree.png"},
is_ground_content = true,
groups = {tree=1,choppy=5,oddly_breakable_by_hand=4,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("dwarves:mossywood", {
description = "Mossy Wooden Planks",
tiles = {"dwarves_mossywood.png"},
is_ground_content = true,
groups = {choppy=6,oddly_breakable_by_hand=5,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("dwarves:rotten_wood", {
description = "Rotten Wooden Planks",
tiles = {"dwarves_rotten_wood.png"},
is_ground_content = true,
groups = {choppy=6,oddly_breakable_by_hand=5,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craftitem("dwarves:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "dwarves_obsshard.png",
@ -1084,31 +1104,6 @@ minetest.register_craftitem("dwarves:charcoal", {
inventory_image = "default_coal_lump.png",
})
minetest.register_node("dwarves:mossytree", {
description = "Mossy Tree",
tiles = {"default_tree_top.png", "default_tree_top.png", "dwarves_mossytree.png"},
is_ground_content = true,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("dwarves:mossywood", {
description = "Mossy Wooden Planks",
tiles = {"dwarves_mossywood.png"},
is_ground_content = true,
groups = {schoppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("dwarves:rotten_wood", {
description = "Rotten Wooden Planks",
tiles = {"dwarves_rotten_wood.png"},
is_ground_content = true,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craftitem("dwarves:obsidian_lump", {
description = "Obsidian Chunk",
inventory_image = "dwarves_obsidian_lump.png",

View File

@ -83,13 +83,16 @@ end
end)--]]
--it will fail if clust_num_ores > clust_size^3
--clust_num_ores < clust_size^3
minetest.register_ore({
ore_type = "scatter",
ore = "dwarves:stone_with_obsidian",
wherein = "default:stone",
clust_scarcity = 13*13*13,
clust_num_ores = 4,
clust_size = 3+math.random(0,3),
clust_size = 4+math.random(0,3),
height_min = -31000,
height_max = 64,
})
@ -100,7 +103,7 @@ minetest.register_ore({
wherein = "default:stone",
clust_scarcity = 16*16*16,
clust_num_ores = 2,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = -31000,
height_max = -64,
})
@ -111,7 +114,7 @@ minetest.register_ore({
wherein = "default:stone",
clust_scarcity = 18*18*18,
clust_num_ores = 2,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = -31000,
height_max = -64,
})
@ -122,7 +125,7 @@ minetest.register_ore({
wherein = "default:stone",
clust_scarcity = 16*16*16,
clust_num_ores = 1,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = -31000,
height_max = -128,
})
@ -133,7 +136,7 @@ minetest.register_ore({
wherein = "default:stone",
clust_scarcity = 18*18*18,
clust_num_ores = 1,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = -31000,
height_max = -128,
})
@ -144,7 +147,7 @@ minetest.register_ore({
wherein = "default:stone",
clust_scarcity = 20*20*20,
clust_num_ores = 1,
clust_size = 1+math.random(0,4),
clust_size = 2+math.random(0,4),
height_min = -31000,
height_max = -256,
})
@ -160,7 +163,7 @@ minetest.register_ore({
height_max = -64,
})
minetest.register_ore({
--[[minetest.register_ore({
ore_type = "scatter",
ore = "dwarves:stone_with_obsidian",
wherein = "flolands:floatstone",
@ -177,7 +180,7 @@ minetest.register_ore({
wherein = "flolands:floatstone",
clust_scarcity = 16*16*16,
clust_num_ores = 2,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = 31000,
height_max = 1000,
})
@ -188,7 +191,7 @@ minetest.register_ore({
wherein = "flolands:floatstone",
clust_scarcity = 18*18*18,
clust_num_ores = 2,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = 31000,
height_max = 1000,
})
@ -199,7 +202,7 @@ minetest.register_ore({
wherein = "flolands:floatstone",
clust_scarcity = 16*16*16,
clust_num_ores = 1,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = 31000,
height_max = 1000,
})
@ -210,7 +213,7 @@ minetest.register_ore({
wherein = "flolands:floatstone",
clust_scarcity = 18*18*18,
clust_num_ores = 1,
clust_size = 1+math.random(0,2),
clust_size = 2+math.random(0,2),
height_min = 31000,
height_max = 1000,
})
@ -221,7 +224,7 @@ minetest.register_ore({
wherein = "flolands:floatstone",
clust_scarcity = 20*20*20,
clust_num_ores = 1,
clust_size = 1+math.random(0,4),
clust_size = 2+math.random(0,4),
height_min = 31000,
height_max = 1000,
})
@ -235,7 +238,7 @@ minetest.register_ore({
clust_size = 2+math.random(0,4),
height_min = 31000,
height_max = 1000,
})
})--]]
minetest.register_ore({
ore_type = "scatter",
@ -246,4 +249,15 @@ minetest.register_ore({
clust_size = 1,
height_min = -31000,
height_max = 31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "dwarves:hive",
wherein = "default:jungleleaves",
clust_scarcity = 25*25*25,
clust_num_ores = 1,
clust_size = 1,
height_min = -31000,
height_max = 31000,
})

View File

@ -8,7 +8,7 @@ minetest.register_node("dwarves:wooden_raft", {
tile_images = {"default_wood.png"},
is_ground_content = true,
visual_scale = 1.5,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
groups = {choppy=6,oddly_breakable_by_hand=5,flammable=3},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)

View File

@ -28,7 +28,7 @@ minetest.register_node("farming:cotton_1", {
{-0.5, -0.5, -0.5, 0.5, -0.5+6/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -52,7 +52,7 @@ minetest.register_node("farming:cotton_2", {
{-0.5, -0.5, -0.5, 0.5, -0.5+12/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -72,7 +72,7 @@ minetest.register_node("farming:cotton", {
after_dig_node = function(pos)
minetest.env:add_node(pos, {name="farming:cotton_2"})
end,
groups = {snappy=3, flammable=2, not_in_creative_inventory=1, sickle=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1, sickle=1},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -27,7 +27,7 @@ minetest.register_node("farming:lime_1", {
{-0.5, -0.5, -0.5, 0.5, -0.5+4/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -43,7 +43,7 @@ minetest.register_node("farming:lime_2", {
{-0.5, -0.5, -0.5, 0.5, -0.5+7/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -59,7 +59,7 @@ minetest.register_node("farming:lime_3", {
{-0.5, -0.5, -0.5, 0.5, -0.5+13/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -80,7 +80,7 @@ minetest.register_node("farming:lime_grown", {
after_dig_node = function(pos)
minetest.env:add_node(pos, {name="farming:lime_2"})
end,
groups = {snappy=3, flammable=2, not_in_creative_inventory=1, sickle=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1, sickle=1},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -32,7 +32,7 @@ minetest.register_node("farming:pumpkin_1", {
{-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
},
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, not_in_creative_inventory=1},
groups = {choppy=6, oddly_breakable_by_hand=2, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
})
@ -53,7 +53,7 @@ minetest.register_node("farming:pumpkin_2", {
{-0.35, -0.5, -0.35, 0.35, 0.2, 0.35}
},
},
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, not_in_creative_inventory=1},
groups = {choppy=6, oddly_breakable_by_hand=2, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
})
@ -61,7 +61,7 @@ minetest.register_node("farming:pumpkin", {
description = "Pumpkin",
paramtype2 = "facedir",
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png"},
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2},
groups = {choppy=6, oddly_breakable_by_hand=2, flammable=2},
sounds = default.node_sound_wood_defaults(),
on_punch = function(pos, node, puncher)
@ -104,7 +104,7 @@ minetest.register_node("farming:pumpkin_face", {
description = "Pumpkin",
paramtype2 = "facedir",
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face.png"},
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2},
groups = {choppy=6, oddly_breakable_by_hand=2, flammable=2},
sounds = default.node_sound_wood_defaults(),
})
@ -113,7 +113,7 @@ minetest.register_node("farming:pumpkin_face_light", {
paramtype2 = "facedir",
light_source = LIGHT_MAX-2,
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_light.png"},
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2},
groups = {choppy=6, oddly_breakable_by_hand=2, flammable=2},
sounds = default.node_sound_wood_defaults(),
})
@ -164,7 +164,7 @@ minetest.register_node("farming:scarecrow", {
{-12/16, -1.5, -0.5, 12/16, 0.5, 0.5}
}
},
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2},
groups = {choppy=6, oddly_breakable_by_hand=2, flammable=2},
after_place_node = function(pos, placer)
local node = minetest.env:get_node(pos)
@ -245,7 +245,7 @@ minetest.register_node("farming:scarecrow_light", {
{-12/16, -1.5, -0.5, 12/16, 0.5, 0.5}
}
},
groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2},
groups = {choppy=6, oddly_breakable_by_hand=2, flammable=2},
after_place_node = function(pos, placer)
local node = minetest.env:get_node(pos)

View File

@ -27,7 +27,7 @@ minetest.register_node("farming:rice_1", {
{-0.5, -0.5, -0.5, 0.5, -0.5+4/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -43,7 +43,7 @@ minetest.register_node("farming:rice_2", {
{-0.5, -0.5, -0.5, 0.5, -0.5+7/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -59,7 +59,7 @@ minetest.register_node("farming:rice_3", {
{-0.5, -0.5, -0.5, 0.5, -0.5+13/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -77,7 +77,7 @@ minetest.register_node("farming:rice", {
{ items = {'farming:rice_seed'}, rarity = 5},
}
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1, sickle=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1, sickle=1},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -27,7 +27,7 @@ minetest.register_node("farming:tea_1", {
{-0.5, -0.5, -0.5, 0.5, -0.5+4/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -43,7 +43,7 @@ minetest.register_node("farming:tea_2", {
{-0.5, -0.5, -0.5, 0.5, -0.5+7/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -59,7 +59,7 @@ minetest.register_node("farming:tea_3", {
{-0.5, -0.5, -0.5, 0.5, -0.5+13/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -82,7 +82,7 @@ minetest.register_node("farming:tea", {
after_dig_node = function(pos)
minetest.env:add_node(pos, {name="farming:tea_2"})
end,
groups = {snappy=3, flammable=2, not_in_creative_inventory=1, sickle=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1, sickle=1},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -23,7 +23,7 @@ minetest.register_node("farming:weed", {
{ items = {'farming:lime_seed'}, rarity = 34 }
}
},
groups = {snappy=3, flammable=2, sickle=1},
groups = {snappy=6, flammable=2, sickle=1},
sounds = default.node_sound_leaves_defaults()
})

View File

@ -27,7 +27,7 @@ minetest.register_node("farming:wheat_1", {
{-0.5, -0.5, -0.5, 0.5, -0.5+4/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -43,7 +43,7 @@ minetest.register_node("farming:wheat_2", {
{-0.5, -0.5, -0.5, 0.5, -0.5+7/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -59,7 +59,7 @@ minetest.register_node("farming:wheat_3", {
{-0.5, -0.5, -0.5, 0.5, -0.5+13/16, 0.5}
},
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -77,7 +77,7 @@ minetest.register_node("farming:wheat", {
{ items = {'farming:wheat_seed'}, rarity = 5},
}
},
groups = {snappy=3, flammable=2, not_in_creative_inventory=1, sickle=1},
groups = {snappy=6, flammable=2, not_in_creative_inventory=1, sickle=1},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -22,7 +22,7 @@ minetest.register_node("flowers:dandelion_white", {
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_white=1},
groups = {snappy=7,flammable=2,flower=1,flora=1,attached_node=1,color_white=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -40,7 +40,7 @@ minetest.register_node("flowers:dandelion_yellow", {
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_yellow=1},
groups = {snappy=7,flammable=2,flower=1,flora=1,attached_node=1,color_yellow=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -58,7 +58,7 @@ minetest.register_node("flowers:geranium", {
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_blue=1},
groups = {snappy=7,flammable=2,flower=1,flora=1,attached_node=1,color_blue=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -76,7 +76,7 @@ minetest.register_node("flowers:rose", {
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_red=1},
groups = {snappy=7,flammable=2,flower=1,flora=1,attached_node=1,color_red=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -94,7 +94,7 @@ minetest.register_node("flowers:tulip", {
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_orange=1},
groups = {snappy=7,flammable=2,flower=1,flora=1,attached_node=1,color_orange=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -112,7 +112,7 @@ minetest.register_node("flowers:viola", {
paramtype = "light",
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,color_violet=1},
groups = {snappy=7,flammable=2,flower=1,flora=1,attached_node=1,color_violet=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",

View File

@ -36,7 +36,7 @@ minetest.register_node("hatch:trapdoor", {
tiles = {"door_trapdoor.png", "door_trapdoor.png", "default_wood.png", "default_wood.png", "default_wood.png", "default_wood.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
groups = {snappy=6,choppy=6,oddly_breakable_by_hand=5,flammable=2,door=1},
sounds = default.node_sound_wood_defaults(),
drop = "hatch:trapdoor",
node_box = {
@ -63,7 +63,7 @@ minetest.register_node("hatch:trapdoor_open", {
paramtype2 = "facedir",
pointable = true,
stack_max = 0,
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
groups = {snappy=6,choppy=6,oddly_breakable_by_hand=5,flammable=2,door=1},
sounds = default.node_sound_wood_defaults(),
drop = "hatch:trapdoor",
node_box = {

View File

@ -0,0 +1,2 @@
default?
creative?

View File

@ -1,30 +1,65 @@
--[[
Inventory Plus for Minetest
Inventory Plus+ for Minetest
Copyright (c) 2012 cornernote, Brett O'Donnell <cornernote@gmail.com>
Source Code: https://github.com/cornernote/minetest-particles
Copyright (c) 2013 Zeg9 <dazeg9@gmail.com>
Source Code: https://github.com/Zeg9/minetest-inventory_plus
License: GPLv3
]]--
--[[
TODO:
* Include a few button textures, especially for "abandoned" mods
-> Done: bags
-> Todo: home GUI, mobf settings (if it still exists),...
* Limit the number of buttons displayed, and then:
* Multiple button pages (inventory can only display 9 buttons, and creative 6)
* Fallback to text if no image is present ?
]]--
-- expose api
inventory_plus = {}
-- tell that we are inventory++, not inventory_plus
-- ...so mods know if they can use our functions like remove_button
inventory_plus.plusplus = true
-- define buttons
inventory_plus.buttons = {}
-- default inventory page
inventory_plus.default = minetest.setting_get("inventory_default") or "main"
-- original inventory formspec, per player
inventory_plus.inventory = {}
-- register_button
inventory_plus.register_button = function(player,name,label)
inventory_plus.register_button = function(player,name,...)
local player_name = player:get_player_name()
if inventory_plus.buttons[player_name] == nil then
inventory_plus.buttons[player_name] = {}
end
inventory_plus.buttons[player_name][name] = label
for _, i in ipairs(inventory_plus.buttons[player_name]) do
if i == name then return end -- only register buttons once
end
table.insert(inventory_plus.buttons[player_name], name)
end
inventory_plus.remove_button = function(player,name)
local player_name = player:get_player_name()
if inventory_plus.buttons[player_name] == nil then
inventory_plus.buttons[player_name] = {}
end
local index = nil
for i, n in ipairs(inventory_plus.buttons[player_name]) do
if n == name then
index = i
end
end
table.remove(inventory_plus.buttons[player_name], index)
end
-- set_inventory_formspec
@ -41,88 +76,38 @@ end
-- get_formspec
inventory_plus.get_formspec = function(player,page)
local formspec = "size[13,7.5]"..
"list[current_player;main;5,3.5;8,4;]"
-- craft page
if page=="main" then
formspec = formspec
.."list[current_player;craftpreview;12,1;1,1;]"
if minetest.setting_getbool("inventory_craft_small") then
formspec = formspec.."list[current_player;craft;8,0;2,2;]"
player:get_inventory():set_width("craft", 2)
player:get_inventory():set_size("craft", 2*2)
else
formspec = formspec.."list[current_player;craft;8,0;3,3;]"
player:get_inventory():set_width("craft", 3)
player:get_inventory():set_size("craft", 3*3)
local get_buttons = function(ox,oy,mx) -- origin x, origin y, max x
if not inventory_plus.buttons[player:get_player_name()] then
return ""
end
end
-- creative page
if page=="creative" then
return player:get_inventory_formspec()
.."button[5,0;2,0.5;main;Back]"
end
-- main page
if page=="main" then
-- buttons
local x,y=0,0
for k,v in pairs(inventory_plus.buttons[player:get_player_name()]) do
formspec = formspec .. "button["..x..".5,"..y..";2,0.5;"..k..";"..v.."]"
x=x+2
if x == 4 then
x=0
y=y+1
local formspec = ""
local x,y=ox,oy
for _, i in ipairs(inventory_plus.buttons[player:get_player_name()]) do
formspec = formspec .. "image_button["..x..","..y..";1,1;inventory_plus_"..i..".png;"..i..";]"
x=x+1
if x >= ox+mx then
y = y+1
x = ox
end
end
return formspec
end
-- craft page
if page=="main" then
if minetest.setting_getbool("creative_mode") then
return player:get_inventory_formspec()
.. get_buttons(6,0,2)
else
return inventory_plus.inventory[player:get_player_name()]
.. get_buttons(0,0,3)
end
end
return formspec
end
-- trash slot
inventory_plus.trash = minetest.create_detached_inventory("trash", {
allow_put = function(inv, listname, index, stack, player)
if minetest.setting_getbool("creative_mode") then
return stack:get_count()
else
return 0
end
end,
on_put = function(inv, listname, index, stack, player)
inv:set_stack(listname, index, nil)
end,
})
inventory_plus.trash:set_size("main", 1)
-- refill slot
inventory_plus.refill = minetest.create_detached_inventory("refill", {
allow_put = function(inv, listname, index, stack, player)
if minetest.setting_getbool("creative_mode") then
return stack:get_count()
else
return 0
end
end,
on_put = function(inv, listname, index, stack, player)
inv:set_stack(listname, index, ItemStack(stack:get_name().." "..stack:get_stack_max()))
end,
})
inventory_plus.refill:set_size("main", 1)
-- register_on_joinplayer
minetest.register_on_joinplayer(function(player)
if minetest.setting_getbool("inventory_craft_small") then
player:get_inventory():set_width("craft", 2)
player:get_inventory():set_size("craft", 2*2)
else
player:get_inventory():set_width("craft", 3)
player:get_inventory():set_size("craft", 3*3)
end
if minetest.setting_getbool("creative_mode") then
inventory_plus.register_button(player,"creative_prev","Creative")
if inventory_plus.inventory[player:get_player_name()] == nil then
inventory_plus.inventory[player:get_player_name()] = player:get_inventory_formspec()
end
minetest.after(1,function()
inventory_plus.set_inventory_formspec(player,inventory_plus.get_formspec(player, inventory_plus.default))
@ -133,13 +118,18 @@ end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
-- main
if fields.main then
inventory_plus.set_inventory_formspec(player, inventory_plus.get_formspec(player,"main"))
if minetest.setting_getbool("creative_mode") then
minetest.after(0.01,function()
inventory_plus.set_inventory_formspec(player, inventory_plus.get_formspec(player,"main"))
end)
else
inventory_plus.set_inventory_formspec(player, inventory_plus.get_formspec(player,"main"))
end
return
end
-- creative
if fields.creative_prev or fields.creative_next then
minetest.after(0.01,function()
inventory_plus.set_inventory_formspec(player, inventory_plus.get_formspec(player,"creative"))
inventory_plus.set_inventory_formspec(player, inventory_plus.get_formspec(player,"main"))
end)
return
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

View File

@ -158,7 +158,7 @@ minetest.register_node("torch:torch", {
wall_bottom = {-0.1, -0.5, -0.1, 0.1, 0.2, 0.1},
wall_side = {-0.5, -0.3, -0.1, -0.3, 0.3, 0.1},
},
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,attached_node=1},
groups = {tree=1,snappy=1,choppy=7,oddly_breakable_by_hand=6,attached_node=1},
})
--[[check if the torch is actually on a walkable node

View File

@ -34,7 +34,7 @@ for _, row in ipairs(wool.dyes) do
minetest.register_node("wool:"..name, {
description = desc.." Wool",
tiles = {"wool_"..name..".png"},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1},
groups = {snappy=7,choppy=7,oddly_breakable_by_hand=6,flammable=3,wool=1},
})
if craft_color_group then
-- Crafting from dye and white wool

View File

@ -21,8 +21,8 @@
-- <http://www.gnu.org/licenses/>
-- set inventory_craft_small=1 in minetest.conf to limit inventory craft to 2x2
--[[if minetest.setting_getbool("inventory_craft_small")
--set inventory_craft_small=1 in minetest.conf to limit inventory craft to 2x2
if minetest.setting_getbool("inventory_craft_small")
and not minetest.setting_getbool("creative_mode")
and not minetest.get_modpath("inventory_plus") then
minetest.register_on_joinplayer(function(player)
@ -162,7 +162,7 @@ workbench.register = function(width, recipe)
description = "WorkBench "..width.."x"..width,
tile_images = {"workbench_"..width.."x"..width.."_top.png","workbench_"..width.."x"..width.."_bottom.png","workbench_"..width.."x"..width.."_side.png"},
paramtype2 = "facedir",
groups = {cracky=2,craft_width=width,oddly_breakable_by_hand=1},
groups = {craft_width=width,choppy=6,oddly_breakable_by_hand=5},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
on_construct = workbench.on_construct,

View File

@ -1,7 +1,7 @@
-- xFences mod by xyz
-- most code is taken from xPanes
local REPLACE_DEFAULT_FENCES = false
local REPLACE_DEFAULT_FENCES = true
local function rshift(x, by)
return math.floor(x / 2 ^ by)
@ -121,3 +121,5 @@ if REPLACE_DEFAULT_FENCES then
})
minetest.register_alias("default:fence_wood", "xfences:fence")
end
minetest.register_alias("default:fence_wood", "default:fence")
minetest.register_alias("default:fence", "xfences:fence")

View File

@ -1 +0,0 @@
default

View File

@ -1,27 +0,0 @@
minetest.register_node(":default:ladder", {
description = "Ladder",
drawtype = "nodebox",
tiles = {"default_wood.png"},
inventory_image = "default_ladder.png",
wield_image = "default_ladder.png",
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
climbable = true,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, 0.5, 0.5, 0.5, 0.3},
},
node_box = {
type = "fixed",
fixed = {{-0.4, -0.5, 0.5, -0.32, 0.5, 0.37},
{0.45, -0.5, 0.5, 0.32, 0.5, 0.37},
{-0.32, -0.5+(1/4)-(1/8)-(1/16), 0.47, 0.32, -0.5+(1/4)-(1/8)+(1/16), 0.4},
{-0.32, -0.5+(2/4)-(1/8)-(1/16), 0.47, 0.32, -0.5+(2/4)-(1/8)+(1/16), 0.4},
{-0.32, -0.5+(3/4)-(1/8)-(1/16), 0.47, 0.32, -0.5+(3/4)-(1/8)+(1/16), 0.4},
{-0.32, -0.5+(4/4)-(1/8)-(1/16), 0.47, 0.32, -0.5+(4/4)-(1/8)+(1/16), 0.4},},
},
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=3,flammable=2},
sounds = default.node_sound_wood_defaults(),
})

1
mods/zcg/depends.txt Normal file
View File

@ -0,0 +1 @@
inventory_plus

168
mods/zcg/init.lua Normal file
View File

@ -0,0 +1,168 @@
-- ZCG mod for minetest
-- See README for more information
-- Released by Zeg9 under WTFPL
zcg = {}
zcg.users = {}
zcg.crafts = {}
zcg.itemlist = {}
zcg.items_in_group = function(group)
local items = {}
for name, item in pairs(minetest.registered_items) do
for _, g in ipairs(group:split(',')) do
if item.groups[g] then
table.insert(items,name)
end
end
end
return items
end
local table_copy = function(table)
out = {}
for k,v in pairs(table) do
out[k] = v
end
return out
end
zcg.add_craft = function(input, output, groups)
if not groups then groups = {} end
local c = {}
c.width = input.width
c.type = input.type
c.items = input.items
if c.items == nil then return end
for i, item in pairs(c.items) do
if item:sub(0,6) == "group:" then
local groupname = item:sub(7)
if groups[groupname] ~= nil then
c.items[i] = groups[groupname]
else
for _, gi in ipairs(zcg.items_in_group(groupname)) do
local g2 = groups
g2[groupname] = gi
zcg.add_craft({
width = c.width,
type = c.type,
items = table_copy(c.items)
}, output, g2) -- it is needed to copy the table, else groups won't work right
end
return
end
end
end
if c.width == 0 then c.width = 3 end
table.insert(zcg.crafts[output],c)
end
zcg.load_crafts = function(name)
zcg.crafts[name] = {}
local _recipes = minetest.get_all_craft_recipes(name)
if _recipes then
for i, recipe in ipairs(_recipes) do
if (recipe and recipe.items and recipe.type) then
zcg.add_craft(recipe, name)
end
end
end
if zcg.crafts[name] == nil or #zcg.crafts[name] == 0 then
zcg.crafts[name] = nil
else
table.insert(zcg.itemlist,name)
end
end
zcg.need_load_all = true
zcg.load_all = function()
print("Loading all crafts, this may take some time...")
local i = 0
for name, item in pairs(minetest.registered_items) do
if (name and name ~= "") then
zcg.load_crafts(name)
end
i = i+1
end
table.sort(zcg.itemlist)
zcg.need_load_all = false
print("All crafts loaded !")
end
zcg.formspec = function(pn)
if zcg.need_load_all then zcg.load_all() end
page = zcg.users[pn].page
alt = zcg.users[pn].alt
current_item = zcg.users[pn].current_item
local formspec = "size[8,7.5]"
.. "button[0,0;2,.5;main;Back]"
-- Show craft recipe
if current_item ~= "" then
if zcg.crafts[current_item] then
if alt > #zcg.crafts[current_item] then
alt = #zcg.crafts[current_item]
end
if alt > 1 then
formspec = formspec .. "button[7,0;1,1;zcg_alt:"..(alt-1)..";^]"
end
if alt < #zcg.crafts[current_item] then
formspec = formspec .. "button[7,2;1,1;zcg_alt:"..(alt+1)..";v]"
end
local c = zcg.crafts[current_item][alt]
if c then
for i, item in pairs(c.items) do
formspec = formspec .. "item_image_button["..((i-1)%c.width+3)..","..(math.floor((i-1)/c.width))..";1,1;"..item..";zcg:"..item..";]"
end
formspec = formspec .. "label[0,2;Method: "..c.type.."]"
formspec = formspec .. "item_image_button[7,1;1,1;"..zcg.users[pn].current_item..";;]"
end
end
end
-- Node list
local npp = 8*3 -- nodes per page
local i = 0 -- for positionning buttons
local s = 0 -- for skipping pages
for _, name in ipairs(zcg.itemlist) do
if s < page*npp then s = s+1 else
if i >= npp then break end
formspec = formspec .. "item_image_button["..(i%8)..","..(math.floor(i/8)+3.5)..";1,1;"..name..";zcg:"..name..";]"
i = i+1
end
end
if page > 0 then
formspec = formspec .. "button[0,7;1,.5;zcg_page:"..(page-1)..";<<]"
end
if i >= npp then
formspec = formspec .. "button[1,7;1,.5;zcg_page:"..(page+1)..";>>]"
end
formspec = formspec .. "label[2,6.85;Page "..(page+1).."/"..(math.floor(#zcg.itemlist/npp+1)).."]" -- The Y is approximatively the good one to have it centered vertically...
return formspec
end
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player,"zcg","Craft guide")
end)
minetest.register_on_player_receive_fields(function(player,formname,fields)
pn = player:get_player_name();
if zcg.users[pn] == nil then zcg.users[pn] = {current_item = "", alt = 1, page = 0} end
if fields.zcg then
inventory_plus.set_inventory_formspec(player, zcg.formspec(pn))
return
end
for k, v in pairs(fields) do
if (k:sub(0,4)=="zcg:") then
zcg.users[pn].current_item = k:sub(5)
inventory_plus.set_inventory_formspec(player,zcg.formspec(pn))
elseif (k:sub(0,9)=="zcg_page:") then
zcg.users[pn].page = tonumber(k:sub(10))
inventory_plus.set_inventory_formspec(player,zcg.formspec(pn))
elseif (k:sub(0,8)=="zcg_alt:") then
zcg.users[pn].alt = tonumber(k:sub(9))
inventory_plus.set_inventory_formspec(player,zcg.formspec(pn))
end
end
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B