Add various MTG nodes and items - part 2

master
CasimirKaPazi 2022-01-25 18:34:13 +01:00
parent dafaef4d26
commit eae2ac97ed
27 changed files with 356 additions and 26 deletions

View File

@ -111,6 +111,8 @@ Casimir (CC BY-SA 4.0)
default_bone.png
default_papyrus_roots.png
default_seedling
default_dry_grass_* (based on work by Gambit)
default_acacia_sapling.png
Gambit (CC BY-SA 4.0)
default_book.png
@ -140,6 +142,9 @@ Gambit (CC BY-SA 4.0)
default_aspen_leaves.png
default_bonfire_animated.png
default_flint.png
default_acacia_tree*
default_acacia_leaves.png
default_pine_needles.png
BlockMen (CC BY 3.0)
default_water.png
@ -207,11 +212,27 @@ Mossmanikin (CC BY-SA 3.0):
sofar (CC BY-SA 3.0):
default_aspen_sapling
Splizard (CC BY-SA 3.0):
default_pine_sapling.png
default_pine_needles.png
paramat (CC BY-SA 3.0):
default_marram_grass_*.png -- Derived from textures by TumeniNodes (CC-BY-SA 3.0)
default_permafrost.png -- Derived from a texture by Neuromancer (CC BY-SA 3.0)
default_moss.png
default_moss_side.png
default_pinetree.png
default_pinetree_top.png
Good Morning Craft (CC BY-SA 4.0)
default_dry_grass.png
default_dry_grass_side.png
default_rainforest_litter.png
default_rainforest_litter_side.png
TumeniNodes (CC BY-SA 3.0):
default_coniferous_litter.png
default_coniferous_litter_side.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
@ -243,3 +264,24 @@ Metal sounds:
- https://freesound.org/people/mypantsfelldown/sounds/398937/
default_place_node_metal.*.ogg - Ogrebane - CC0
- http://opengameart.org/content/wood-and-metal-sound-effects-volume-2
Schematics
----------
paramat (CC BY-SA 3.0):
acacia_tree.mts
aspen_tree.mts
emergent_jungle_tree.mts
pine_tree.mts
TumeniNodes (CC BY-SA 3.0):
pine_bush.mts
random-geek (CC BY-SA 3.0):
blueberry_bush.mts
Casimir (CC BY-SA 3.0):
conifertree*
apple_tree*
jungletree*
tree*
papyrus_with_roots.mts

View File

@ -139,17 +139,42 @@ minetest.register_abm({
})
minetest.register_abm({
label = "Grass new",
nodenames = {"group:flora"},
neighbors = {"default:dirt"},
interval = 2,
chance = 20,
label = "Grass spread",
nodenames = {"default:dirt"},
neighbors = {
"group:spreading_dirt_type",
"group:grass",
"group:dry_grass",
"default:snow",
},
interval = 7,
chance = 50,
catch_up = false,
action = function(pos, node)
local under = {x=pos.x, y=pos.y-1, z=pos.z}
local name = minetest.get_node(under).name
if name == "default:dirt" then
minetest.set_node(under, {name = "default:dirt_with_grass"})
-- Check for darkness: night, shadow or under a light-blocking node
-- Returns if ignore above
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
if (minetest.get_node_light(above) or 0) < 10 then
return
end
-- Look for spreading dirt-type neighbours
local p2 = minetest.find_node_near(pos, 1, "group:spreading_dirt_type")
if p2 then
local n3 = minetest.get_node(p2)
minetest.set_node(pos, {name = n3.name})
return
end
-- Else, any seeding nodes on top?
local name = minetest.get_node(above).name
-- Snow check is cheapest, so comes first
if name == "default:snow" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
elseif minetest.get_item_group(name, "dry_grass") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_dry_grass"})
elseif minetest.get_item_group(name, "flora") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_grass"})
end
end
})

View File

@ -99,7 +99,7 @@ minetest.register_node("default:meselamp", {
minetest.register_node("default:dirt_with_grass", {
description = S("Dirt with Grass"),
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
groups = {crumbly=3, falling_node=1, soil=1},
groups = {crumbly=3, falling_node=1, soil=1, spreading_dirt_type = 1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.1},
@ -126,6 +126,48 @@ minetest.register_node("default:dirt_with_snow", {
}),
})
minetest.register_node("default:dirt_with_rainforest_litter", {
description = S("Dirt with Rainforest Litter"),
tiles = {
"default_rainforest_litter.png",
"default_dirt.png",
{name = "default_dirt.png^default_rainforest_litter_side.png",
tileable_vertical = false}
},
groups = {crumbly = 3, falling_node=1, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dirt_with_coniferous_litter", {
description = S("Dirt with Coniferous Litter"),
tiles = {
"default_coniferous_litter.png",
"default_dirt.png",
{name = "default_dirt.png^default_coniferous_litter_side.png",
tileable_vertical = false}
},
groups = {crumbly = 3, falling_node=1, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dry_dirt_with_dry_grass", {
description = S("Savanna Dirt with Savanna Grass"),
tiles = {"default_dry_grass.png", "default_dirt.png",
{name = "default_dirt.png^default_dry_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, falling_node=1, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dirt", {
description = S("Dirt"),
tiles = {"default_dirt.png"},
@ -348,6 +390,130 @@ minetest.register_node("default:emergent_jungle_sapling", {
end,
})
minetest.register_node("default:pine_tree", {
description = S("Pine Tree"),
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
"default_pine_tree.png"},
is_ground_content = false,
groups = {tree = 1, choppy = 3, flammable = 3},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:pine_needles",{
description = S("Pine Needles"),
drawtype = "allfaces_optional",
tiles = {"default_pine_needles.png"},
waving = 1,
paramtype = "light",
is_ground_content = false,
trunk = "default:pine_tree",
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:pine_sapling"}, rarity = 20},
{items = {"default:pine_needles"}}
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:pine_sapling", {
description = S("Pine Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_pine_sapling.png"},
inventory_image = "default_pine_sapling.png",
wield_image = "default_pine_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = function(pos)
default.grow_pine_tree_sapling(pos)
end,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 3,
falling_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(300, 1500))
end,
})
minetest.register_node("default:acacia_tree", {
description = S("Acacia Tree"),
tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
"default_acacia_tree.png"},
is_ground_content = false,
groups = {tree = 1, choppy = 2, flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:acacia_tree_horizontal", {
description = S("Acacia Tree"),
tiles = {
"default_acacia_tree.png",
"default_acacia_tree.png",
"default_acacia_tree.png^[transformR90",
"default_acacia_tree.png^[transformR90",
"default_acacia_tree_top.png",
"default_acacia_tree_top.png"
},
paramtype2 = "facedir",
groups = {tree_horizontal=1, choppy=2, flammable=1},
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
default.rotate_horizontal(pos)
end,
})
minetest.register_node("default:acacia_leaves", {
description = S("Acacia Tree Leaves"),
drawtype = "allfaces_optional",
tiles = {"default_acacia_leaves.png"},
waving = 1,
paramtype = "light",
is_ground_content = false,
trunk = "default:acacia_tree",
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:acacia_sapling"}, rarity = 20},
{items = {"default:acacia_leaves"}}
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:acacia_sapling", {
description = S("Acacia Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_acacia_sapling.png"},
inventory_image = "default_acacia_sapling.png",
wield_image = "default_acacia_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = function(pos)
default.grow_acacia_tree_sapling(pos)
end,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
falling_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(300, 1500))
end
})
minetest.register_node("default:aspen_tree", {
description = S("Aspen Tree"),
tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
@ -1174,6 +1340,7 @@ minetest.register_node("default:marram_grass_1", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
floodable = true,
groups = {snappy = 3, flammable = 3, flora = 1, grass = 1, marram_grass = 1,
falling_node = 1},
sounds = default.node_sound_leaves_defaults(),
@ -1203,7 +1370,8 @@ for i = 2, 3 do
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
floodable = true,
groups = {snappy = 3, flammable = 3, flora = 1, falling_node = 1,
grass = 1, marram_grass = 1, not_in_creative_inventory = 1},
drop = "default:marram_grass_1",
sounds = default.node_sound_leaves_defaults(),
@ -1214,6 +1382,57 @@ for i = 2, 3 do
})
end
minetest.register_node("default:dry_grass_1", {
description = S("Savanna Grass"),
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_1.png"},
inventory_image = "default_dry_grass_3.png",
wield_image = "default_dry_grass_3.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, flora = 1,
falling_node = 1, grass = 1, dry_grass = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random dry grass node
local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("default:dry_grass_1 " ..
itemstack:get_count() - (1 - ret:get_count()))
end,
})
for i = 2, 5 do
minetest.register_node("default:dry_grass_" .. i, {
description = S("Savanna Grass"),
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_" .. i .. ".png"},
inventory_image = "default_dry_grass_" .. i .. ".png",
wield_image = "default_dry_grass_" .. i .. ".png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, flora = 1, falling_node = 1,
not_in_creative_inventory = 1, grass = 1, dry_grass = 1},
drop = "default:dry_grass_1",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
},
})
end
minetest.register_node("default:ice", {
description = S("Ice"),
tiles = {"default_ice.png"},

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -215,6 +215,40 @@ function default.grow_aspen_tree_sapling(pos)
path, "0", nil, false)
end
function default.grow_acacia_tree_sapling(pos)
if not default.can_grow(pos) then return true end
if minetest.find_node_near(pos, 1, {"group:tree", "group:sapling"}) then
minetest.set_node(pos, {name="default:grass_"..math.random(1, 5)})
return
end
-- Restart the timer with a shorter timeout, as we just wait for enough light
if not default.enough_light(pos) then
minetest.get_node_timer(pos):start(math.random(30, 480))
return
end
local path = minetest.get_modpath("default") ..
"/schematics/acacia_tree.mts"
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
path, "0", nil, false)
end
function default.grow_pine_tree_sapling(pos)
if not default.can_grow(pos) then return true end
if minetest.find_node_near(pos, 2, {"group:tree", "group:sapling"}) then
minetest.set_node(pos, {name="default:pine_needles"})
return
end
-- Restart the timer with a shorter timeout, as we just wait for enough light
if not default.enough_light(pos) then
minetest.get_node_timer(pos):start(math.random(30, 480))
return
end
local path = minetest.get_modpath("default") ..
"/schematics/pine_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, "0", nil, false)
end
minetest.register_lbm({
name = "default:convert_saplings_to_node_timer",
nodenames = {"default:sapling", "default:junglesapling"},

View File

@ -24,8 +24,7 @@ end
dofile(minetest.get_modpath("fire").."/flintandsteel.lua")
minetest.register_node("fire:basic_flame", {
description = S("Fire"),
local fire_node = {
drawtype = "firelike",
tiles = {{
name="fire_basic_flame_animated.png",
@ -42,13 +41,27 @@ minetest.register_node("fire:basic_flame", {
floodable = true,
sunlight_propagates = true,
damage_per_second = 4,
on_timer = function(pos)
minetest.remove_node(pos)
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(1, 10))
end,
})
}
-- Basic flame node
local flame_fire_node = table.copy(fire_node)
flame_fire_node.description = S("Fire")
flame_fire_node.groups.not_in_creative_inventory = 1
flame_fire_node.on_timer = function(pos)
minetest.remove_node(pos)
end
flame_fire_node.on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(1, 10))
end
minetest.register_node("fire:basic_flame", flame_fire_node)
-- Permanent flame node
local permanent_fire_node = table.copy(fire_node)
permanent_fire_node.description = S("Permanent Fire")
minetest.register_node("fire:permanent_flame", permanent_fire_node)
if not minetest.settings:get_bool("disable_fire") then

View File

@ -73,16 +73,13 @@ end)
minetest.register_on_respawnplayer(function(player)
local name = player:get_player_name()
local meta = player:get_meta()
full = 20
hunger.update_bar(player, full)
meta:set_int("hunger", full)
hunger.update_bar(player, 20)
meta:set_int("hunger", 20)
end)
minetest.register_on_newplayer(function(player)
local meta = player:get_meta()
local full = meta:get_int("hunger")
full = 20
meta:set_int("hunger", full)
meta:set_int("hunger", 20)
end)
minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, player, pointed_thing)