Merge pull request 'ITEMS/mcl_core: Add debarking and stripped trunk / wood' (#135) from stripped-wood-3 into master

Reviewed-on: https://git.minetest.land/Mineclonia/Mineclonia/pulls/135
Reviewed-by: cora <cora@noreply.git.minetest.land>
master
cora 2021-09-07 01:41:01 +00:00
commit 42a076cc0b
17 changed files with 168 additions and 54 deletions

View File

@ -4,47 +4,30 @@
-- Crafting definition
--
minetest.register_craft({
output = 'mcl_core:wood 4',
recipe = {
{'mcl_core:tree'},
}
})
local function craft_planks(output, input)
minetest.register_craft({
output = "mcl_core:"..output.."wood 4",
recipe = {
{"mcl_core:"..input},
}
})
end
minetest.register_craft({
output = 'mcl_core:darkwood 4',
recipe = {
{'mcl_core:darktree'},
}
})
local planks = {
{"", "oak"},
{"dark", "dark_oak"},
{"jungle", "jungle"},
{"acacia", "acacia"},
{"spruce", "spruce"},
{"birch", "birch"}
}
minetest.register_craft({
output = 'mcl_core:junglewood 4',
recipe = {
{'mcl_core:jungletree'},
}
})
minetest.register_craft({
output = 'mcl_core:acaciawood 4',
recipe = {
{'mcl_core:acaciatree'},
}
})
minetest.register_craft({
output = 'mcl_core:sprucewood 4',
recipe = {
{'mcl_core:sprucetree'},
}
})
minetest.register_craft({
output = 'mcl_core:birchwood 4',
recipe = {
{'mcl_core:birchtree'},
}
})
for _, p in pairs(planks) do
craft_planks(p[1], p[1].."tree")
craft_planks(p[1], p[1].."tree_bark")
craft_planks(p[1], "stripped_"..p[2])
craft_planks(p[1], "stripped_"..p[2].."_bark")
end
minetest.register_craft({
type = 'shapeless',

View File

@ -202,18 +202,42 @@ Stained glass is a decorative and mostly transparent block which comes in variou
Stick=Stock
Sticks are a very versatile crafting material; used in countless crafting recipes.=Stöcke sind ein vielseitiges Material, sie werden in zahllosen Fertigungsrezepten gebraucht.
Stone=Stein
Stripped Acacia Log=Entrindeter Akazienstamm
Stripped Acacia Wood=Entrindetes Akazienholz
Stripped Birch Log=Entrindeter Birkenstamm
Stripped Birch Wood=Entrindetes Birkenholz
Stripped Dark Oak Log=Entrindeter Schwarzeichenstamm
Stripped Dark Oak Wood=Entrindetes Schwarzeichenholz
Stripped Jungle Log=Entrindeter Dschungelbaumstamm
Stripped Jungle Wood=Entrindetes Dschungelholz
Stripped Oak Log=Entrindeter Eichenstamm
Stripped Oak Wood=Entrindetes Eichenholz
Stripped Spruce Log=Entrindeter Fichtenstamm
Stripped Spruce Wood=Entrindetes Fichtenholz
Stone Bricks=Steinziegel
Sugar=Zucker
Sugar Canes=Zuckerrohr
Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly grow up to 3 blocks when they are next to water and are placed on a grass block, dirt, sand, red sand, podzol or coarse dirt. When a sugar cane is broken, all sugar canes connected above will break as well.=Zuckerrohr ist eine Pflanze, die in der Herstellung gebraucht wird. Zuckerrohr wird in der Nähe von Wasser bis zu 3 zusätzliche Blöcke wachsen lassen, wenn sie sich neben Wasser befinden und auf einem Grasblock, auf Erde, Sand, roten Sand, Podsol oder grobe Erde platziert wurden. Wird ein Zuckerrohr abgebrochen, werden alle verbundenen Zuckerrohrblöcke ebenfalls abbrechen.
Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow.=Zuckerrohr kann nur auf Zuckerrohr platziert werden und auf Blöcken, auf denen Zuckerrohr wachsen würde.
Sugar comes from sugar canes and is used to make sweet foods.=Zucker kommt von Zuckerrohr und wird benutzt, um süße Lebensmittel zu machen.
The stripped trunk of an acacia tree.=Der entrindete Stamm einer Akazie.
The stripped trunk of a birch tree.=Der entrindete Stamm einer Birke.
The stripped trunk of a dark oak tree.=Der entrindete Stamm einer Schwarzeiche.
The stripped trunk of a jungle tree.=Der entrindete Stamm eines Dschungelbaums.
The stripped trunk of an oak tree.=Der entrindete Stamm einer Eiche.
The stripped trunk of a spruce tree.=Der entrindete Stamm einer Fichte.
The trunk of a birch tree.=Der Baumstamm einer Birke.
The trunk of a dark oak tree.=Der Baumstamm einer Schwarzeiche.
The trunk of a jungle tree.=Der Baumstamm eines Dschungelbaums.
The trunk of a spruce tree.=Der Baumstamm einer Fichte.
The trunk of an acacia.=Der Baumstamm einer Akazie.
The trunk of an oak tree.=Der Baumstamm einer Eiche.
The stripped wood of an acacia tree.=Das entrindete Holz einer Akazie.
The stripped wood of a birch tree.=Das entrindete Holz einer Birke.
The stripped wood of a dark oak tree.=Das entrindete Holz einer Schwarzeiche.
The stripped wood of a jungle tree.=Das entrindete Holz eines Dschungelbaums.
The stripped wood of an oak tree.=Das entrindete Holz einer Eiche.
The stripped wood of a spruce tree.=Das entrindete Holz einer Fichte.
This block consists of a couple of loose stones and can't support itself.=Diser Block besteht aus ein paar losen Steinchen und kann sich nicht selbst tragen.
This is a decorative block surrounded by the bark of a tree trunk.=Dies ist ein dekorativer Block, der von der Rinde eines Baumstamms umgeben ist.
This is a full block of snow. Snow of this thickness is usually found in areas of extreme cold.=Ein ganzer Block aus Schnee. Schnee von dieser Dicke wird üblicherweise in Gebieten extremer Kälte gefunden.

View File

@ -202,18 +202,42 @@ Stained glass is a decorative and mostly transparent block which comes in variou
Stick=
Sticks are a very versatile crafting material; used in countless crafting recipes.=
Stone=
Stripped Acacia Log=
Stripped Acacia Wood=
Stripped Birch Log=
Stripped Birch Wood=
Stripped Dark Oak Log=
Stripped Dark Oak Wood=
Stripped Jungle Log=
Stripped Jungle Wood=
Stripped Oak Log=
Stripped Oak Wood=
Stripped Spruce Log=
Stripped Spruce Wood=
Stone Bricks=
Sugar=
Sugar Canes=
Sugar canes are a plant which has some uses in crafting. Sugar canes will slowly grow up to 3 blocks when they are next to water and are placed on a grass block, dirt, sand, red sand, podzol or coarse dirt. When a sugar cane is broken, all sugar canes connected above will break as well.=
Sugar canes can only be placed top of other sugar canes and on top of blocks on which they would grow.=
Sugar comes from sugar canes and is used to make sweet foods.=
The stripped trunk of an acacia tree.=
The stripped trunk of a birch tree.=
The stripped trunk of a dark oak tree.=
The stripped trunk of a jungle tree.=
The stripped trunk of an oak tree.=
The stripped trunk of a spruce tree.=
The trunk of a birch tree.=
The trunk of a dark oak tree.=
The trunk of a jungle tree.=
The trunk of a spruce tree.=
The trunk of an acacia.=
The trunk of an oak tree.=
The stripped wood of an acacia tree.=
The stripped wood of a birch tree.=
The stripped wood of a dark oak tree.=
The stripped wood of a jungle tree.=
The stripped wood of an oak tree.=
The stripped wood of a spruce tree.=
This block consists of a couple of loose stones and can't support itself.=
This is a decorative block surrounded by the bark of a tree trunk.=
This is a full block of snow. Snow of this thickness is usually found in areas of extreme cold.=

View File

@ -8,7 +8,7 @@ if mod_screwdriver then
end
-- Register tree trunk (wood) and bark
local register_tree_trunk = function(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark)
local function register_tree_trunk(subname, description_trunk, description_bark, longdesc, tile_inner, tile_bark, stripped_variant)
minetest.register_node("mcl_core:"..subname, {
description = description_trunk,
_doc_items_longdesc = longdesc,
@ -17,11 +17,12 @@ local register_tree_trunk = function(subname, description_trunk, description_bar
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
stack_max = 64,
groups = {handy=1,axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
groups = {handy=1, axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = stripped_variant,
})
minetest.register_node("mcl_core:"..subname.."_bark", {
@ -31,7 +32,49 @@ local register_tree_trunk = function(subname, description_trunk, description_bar
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
stack_max = 64,
groups = {handy=1,axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
groups = {handy=1, axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
is_ground_content = false,
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
_mcl_stripped_variant = stripped_variant.."_bark",
})
minetest.register_craft({
output = "mcl_core:"..subname.."_bark 3",
recipe = {
{ "mcl_core:"..subname, "mcl_core:"..subname },
{ "mcl_core:"..subname, "mcl_core:"..subname },
}
})
end
-- Register stripped trunk and stripped wood
local function register_stripped_trunk(subname, description_stripped_trunk, description_stripped_bark, longdesc, longdesc_wood, tile_stripped_inner, tile_stripped_bark)
minetest.register_node("mcl_core:"..subname, {
description = description_stripped_trunk,
_doc_items_longdesc = longdesc,
_doc_items_hidden = false,
tiles = {tile_stripped_inner, tile_stripped_inner, tile_stripped_bark},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
stack_max = 64,
groups = {handy=1, axey=1, tree=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
on_rotate = on_rotate,
_mcl_blast_resistance = 2,
_mcl_hardness = 2,
})
minetest.register_node("mcl_core:"..subname.."_bark", {
description = description_stripped_bark,
_doc_items_longdesc = longdesc_wood,
tiles = {tile_stripped_bark},
paramtype2 = "facedir",
on_place = mcl_util.rotate_axis,
stack_max = 64,
groups = {handy=1, axey=1, bark=1, flammable=2, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
sounds = mcl_sounds.node_sound_wood_defaults(),
is_ground_content = false,
on_rotate = on_rotate,
@ -48,7 +91,7 @@ local register_tree_trunk = function(subname, description_trunk, description_bar
})
end
local register_wooden_planks = function(subname, description, tiles)
local function register_wooden_planks(subname, description, tiles)
minetest.register_node("mcl_core:"..subname, {
description = description,
_doc_items_longdesc = doc.sub.items.temp.build,
@ -56,7 +99,7 @@ local register_wooden_planks = function(subname, description, tiles)
tiles = tiles,
stack_max = 64,
is_ground_content = false,
groups = {handy=1,axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
groups = {handy=1, axey=1, flammable=3,wood=1,building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
sounds = mcl_sounds.node_sound_wood_defaults(),
_mcl_blast_resistance = 3,
_mcl_hardness = 2,
@ -70,7 +113,7 @@ local register_leaves = function(subname, description, longdesc, tiles, sapling,
end
local apple_chances = {200, 180, 160, 120, 40}
local stick_chances = {50, 45, 30, 35, 10}
local function get_drops(fortune_level)
local drop = {
max_items = 1,
@ -108,7 +151,7 @@ local register_leaves = function(subname, description, longdesc, tiles, sapling,
tiles = tiles,
paramtype = "light",
stack_max = 64,
groups = {handy=1,shearsy=1,swordy=1, leafdecay=leafdecay_distance, flammable=2, leaves=1, deco_block=1, dig_by_piston=1, fire_encouragement=30, fire_flammability=60},
groups = {handy=1, shearsy=1, swordy=1, leafdecay=leafdecay_distance, flammable=2, leaves=1, deco_block=1, dig_by_piston=1, fire_encouragement=30, fire_flammability=60},
drop = get_drops(0),
_mcl_shears_drop = true,
sounds = mcl_sounds.node_sound_leaves_defaults(),
@ -119,7 +162,7 @@ local register_leaves = function(subname, description, longdesc, tiles, sapling,
})
end
local register_sapling = function(subname, description, longdesc, tt_help, texture, selbox)
local function register_sapling(subname, description, longdesc, tt_help, texture, selbox)
minetest.register_node("mcl_core:"..subname, {
description = description,
_tt_help = tt_help,
@ -139,7 +182,7 @@ local register_sapling = function(subname, description, longdesc, tt_help, textu
fixed = selbox
},
stack_max = 64,
groups = {dig_immediate=3, plant=1,sapling=1,non_mycelium_plant=1,attached_node=1,dig_by_water=1,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1},
groups = {dig_immediate=3, plant=1, sapling=1, non_mycelium_plant=1, attached_node=1, dig_by_water=1, dig_by_piston=1, destroy_by_lava_flow=1, deco_block=1},
sounds = mcl_sounds.node_sound_leaves_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
@ -161,12 +204,19 @@ end
---------------------
register_tree_trunk("tree", S("Oak Wood"), S("Oak Bark"), S("The trunk of an oak tree."), "default_tree_top.png", "default_tree.png")
register_tree_trunk("darktree", S("Dark Oak Wood"), S("Dark Oak Bark"), S("The trunk of a dark oak tree."), "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png")
register_tree_trunk("acaciatree", S("Acacia Wood"), S("Acacia Bark"), S("The trunk of an acacia."), "default_acacia_tree_top.png", "default_acacia_tree.png")
register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The trunk of a spruce tree."), "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png")
register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png")
register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png")
register_tree_trunk("tree", S("Oak Wood"), S("Oak Bark"), S("The trunk of an oak tree."), "default_tree_top.png", "default_tree.png", "mcl_core:stripped_oak")
register_tree_trunk("darktree", S("Dark Oak Wood"), S("Dark Oak Bark"), S("The trunk of a dark oak tree."), "mcl_core_log_big_oak_top.png", "mcl_core_log_big_oak.png", "mcl_core:stripped_dark_oak")
register_tree_trunk("acaciatree", S("Acacia Wood"), S("Acacia Bark"), S("The trunk of an acacia."), "default_acacia_tree_top.png", "default_acacia_tree.png", "mcl_core:stripped_acacia")
register_tree_trunk("sprucetree", S("Spruce Wood"), S("Spruce Bark"), S("The trunk of a spruce tree."), "mcl_core_log_spruce_top.png", "mcl_core_log_spruce.png", "mcl_core:stripped_spruce")
register_tree_trunk("birchtree", S("Birch Wood"), S("Birch Bark"), S("The trunk of a birch tree."), "mcl_core_log_birch_top.png", "mcl_core_log_birch.png", "mcl_core:stripped_birch")
register_tree_trunk("jungletree", S("Jungle Wood"), S("Jungle Bark"), S("The trunk of a jungle tree."), "default_jungletree_top.png", "default_jungletree.png", "mcl_core:stripped_jungle")
register_stripped_trunk("stripped_oak", S("Stripped Oak Log"), S("Stripped Oak Wood"), S("The stripped trunk of an oak tree."), S("The stripped wood of an oak tree."), "mcl_core_stripped_oak_top.png", "mcl_core_stripped_oak_side.png")
register_stripped_trunk("stripped_acacia", S("Stripped Acacia Log"), S("Stripped Acacia Wood"), S("The stripped trunk of an acacia tree."), S("The stripped wood of an acacia tree."), "mcl_core_stripped_acacia_top.png", "mcl_core_stripped_acacia_side.png")
register_stripped_trunk("stripped_dark_oak", S("Stripped Dark Oak Log"), S("Stripped Dark Oak Wood"), S("The stripped trunk of a dark oak tree."), S("The stripped wood of a dark oak tree."), "mcl_core_stripped_dark_oak_top.png", "mcl_core_stripped_dark_oak_side.png")
register_stripped_trunk("stripped_birch", S("Stripped Birch Log"), S("Stripped Birch Wood"), S("The stripped trunk of a birch tree."), S("The stripped wood of a birch tree."), "mcl_core_stripped_birch_top.png", "mcl_core_stripped_birch_side.png")
register_stripped_trunk("stripped_spruce", S("Stripped Spruce Log"), S("Stripped Spruce Wood"), S("The stripped trunk of a spruce tree."), S("The stripped wood of a spruce tree."), "mcl_core_stripped_spruce_top.png", "mcl_core_stripped_spruce_side.png")
register_stripped_trunk("stripped_jungle", S("Stripped Jungle Log"), S("Stripped Jungle Wood"), S("The stripped trunk of a jungle tree."), S("The stripped wood of a jungle tree."),"mcl_core_stripped_jungle_top.png", "mcl_core_stripped_jungle_side.png")
register_wooden_planks("wood", S("Oak Wood Planks"), {"default_wood.png"})
register_wooden_planks("darkwood", S("Dark Oak Wood Planks"), {"mcl_core_planks_big_oak.png"})

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

View File

@ -351,6 +351,34 @@ minetest.register_tool("mcl_tools:shovel_diamond", {
})
-- Axes
local function make_stripped_trunk(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then return end
local node = minetest.get_node(pointed_thing.under)
local nodedef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
if not placer:get_player_control().sneak and nodedef.on_rightclick then
return minetest.item_place(itemstack, placer, pointed_thing)
end
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
minetest.record_protection_violation(pointed_thing.under, placer:get_player_name())
return itemstack
end
if nodedef._mcl_stripped_variant == nil then
return itemstack
else
minetest.swap_node(pointed_thing.under, {name=nodedef._mcl_stripped_variant, param2=node.param2})
if not minetest.is_creative_enabled(placer:get_player_name()) then
-- Add wear (as if digging a axey node)
local toolname = itemstack:get_name()
local wear = mcl_autogroup.get_wear(toolname, "axey")
itemstack:add_wear(wear)
end
end
return itemstack
end
minetest.register_tool("mcl_tools:axe_wood", {
description = S("Wooden Axe"),
_doc_items_longdesc = axe_longdesc,
@ -364,6 +392,7 @@ minetest.register_tool("mcl_tools:axe_wood", {
damage_groups = {fleshy=7},
punch_attack_uses = 30,
},
on_place = make_stripped_trunk,
sound = { breaks = "default_tool_breaks" },
_repair_material = "group:wood",
_mcl_toollike_wield = true,
@ -383,6 +412,7 @@ minetest.register_tool("mcl_tools:axe_stone", {
damage_groups = {fleshy=9},
punch_attack_uses = 66,
},
on_place = make_stripped_trunk,
sound = { breaks = "default_tool_breaks" },
_repair_material = "mcl_core:cobble",
_mcl_toollike_wield = true,
@ -403,6 +433,7 @@ minetest.register_tool("mcl_tools:axe_iron", {
damage_groups = {fleshy=9},
punch_attack_uses = 126,
},
on_place = make_stripped_trunk,
sound = { breaks = "default_tool_breaks" },
_repair_material = "mcl_core:iron_ingot",
_mcl_toollike_wield = true,
@ -422,6 +453,7 @@ minetest.register_tool("mcl_tools:axe_gold", {
damage_groups = {fleshy=7},
punch_attack_uses = 17,
},
on_place = make_stripped_trunk,
sound = { breaks = "default_tool_breaks" },
_repair_material = "mcl_core:gold_ingot",
_mcl_toollike_wield = true,
@ -441,6 +473,7 @@ minetest.register_tool("mcl_tools:axe_diamond", {
damage_groups = {fleshy=9},
punch_attack_uses = 781,
},
on_place = make_stripped_trunk,
sound = { breaks = "default_tool_breaks" },
_repair_material = "mcl_core:diamond",
_mcl_toollike_wield = true,