Modify default grasses rather than entirely re-defining them

Also, move "waving = 1" property for grasses/shrubs over to default/nodes.lua
and put all instances of this property right under the drawtype, since they
are directly related and depend on the above.
This commit is contained in:
Vanessa Ezekowitz 2013-12-03 18:47:35 -05:00 committed by BlockMen
parent 9559f695ec
commit b3f4f406c4
2 changed files with 20 additions and 79 deletions

View File

@ -255,10 +255,10 @@ minetest.register_node("default:junglewood", {
minetest.register_node("default:jungleleaves", { minetest.register_node("default:jungleleaves", {
description = "Jungle Leaves", description = "Jungle Leaves",
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
waving = 1,
visual_scale = 1.3, visual_scale = 1.3,
tiles = {"default_jungleleaves.png"}, tiles = {"default_jungleleaves.png"},
paramtype = "light", paramtype = "light",
waving = 1,
is_ground_content = false, is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = { drop = {
@ -299,6 +299,7 @@ minetest.register_node("default:junglesapling", {
minetest.register_node("default:junglegrass", { minetest.register_node("default:junglegrass", {
description = "Jungle Grass", description = "Jungle Grass",
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
visual_scale = 1.3, visual_scale = 1.3,
tiles = {"default_junglegrass.png"}, tiles = {"default_junglegrass.png"},
inventory_image = "default_junglegrass.png", inventory_image = "default_junglegrass.png",
@ -318,10 +319,10 @@ minetest.register_node("default:junglegrass", {
minetest.register_node("default:leaves", { minetest.register_node("default:leaves", {
description = "Leaves", description = "Leaves",
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
waving = 1,
visual_scale = 1.3, visual_scale = 1.3,
tiles = {"default_leaves.png"}, tiles = {"default_leaves.png"},
paramtype = "light", paramtype = "light",
waving = 1,
is_ground_content = false, is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = { drop = {
@ -1252,12 +1253,12 @@ minetest.register_node("default:apple", {
minetest.register_node("default:dry_shrub", { minetest.register_node("default:dry_shrub", {
description = "Dry Shrub", description = "Dry Shrub",
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
visual_scale = 1.0, visual_scale = 1.0,
tiles = {"default_dry_shrub.png"}, tiles = {"default_dry_shrub.png"},
inventory_image = "default_dry_shrub.png", inventory_image = "default_dry_shrub.png",
wield_image = "default_dry_shrub.png", wield_image = "default_dry_shrub.png",
paramtype = "light", paramtype = "light",
waving = 1,
walkable = false, walkable = false,
is_ground_content = true, is_ground_content = true,
buildable_to = true, buildable_to = true,
@ -1272,6 +1273,7 @@ minetest.register_node("default:dry_shrub", {
minetest.register_node("default:grass_1", { minetest.register_node("default:grass_1", {
description = "Grass", description = "Grass",
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"default_grass_1.png"}, tiles = {"default_grass_1.png"},
-- use a bigger inventory image -- use a bigger inventory image
inventory_image = "default_grass_3.png", inventory_image = "default_grass_3.png",
@ -1297,6 +1299,7 @@ minetest.register_node("default:grass_1", {
minetest.register_node("default:grass_2", { minetest.register_node("default:grass_2", {
description = "Grass", description = "Grass",
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"default_grass_2.png"}, tiles = {"default_grass_2.png"},
inventory_image = "default_grass_2.png", inventory_image = "default_grass_2.png",
wield_image = "default_grass_2.png", wield_image = "default_grass_2.png",
@ -1315,6 +1318,7 @@ minetest.register_node("default:grass_2", {
minetest.register_node("default:grass_3", { minetest.register_node("default:grass_3", {
description = "Grass", description = "Grass",
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"default_grass_3.png"}, tiles = {"default_grass_3.png"},
inventory_image = "default_grass_3.png", inventory_image = "default_grass_3.png",
wield_image = "default_grass_3.png", wield_image = "default_grass_3.png",
@ -1334,6 +1338,7 @@ minetest.register_node("default:grass_3", {
minetest.register_node("default:grass_4", { minetest.register_node("default:grass_4", {
description = "Grass", description = "Grass",
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"default_grass_4.png"}, tiles = {"default_grass_4.png"},
inventory_image = "default_grass_4.png", inventory_image = "default_grass_4.png",
wield_image = "default_grass_4.png", wield_image = "default_grass_4.png",
@ -1353,6 +1358,7 @@ minetest.register_node("default:grass_4", {
minetest.register_node("default:grass_5", { minetest.register_node("default:grass_5", {
description = "Grass", description = "Grass",
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"default_grass_5.png"}, tiles = {"default_grass_5.png"},
inventory_image = "default_grass_5.png", inventory_image = "default_grass_5.png",
wield_image = "default_grass_5.png", wield_image = "default_grass_5.png",

View File

@ -181,92 +181,27 @@ minetest.register_craft({
-- --
-- Override grass for drops -- Override grass for drops
-- --
minetest.register_node(":default:grass_1", { for i = 1, 5 do
description = "Grass", newgrass = minetest.clone_node("default:grass_"..i)
drawtype = "plantlike", newgrass.drop = {
tiles = {"default_grass_1.png"},
-- use a bigger inventory image
inventory_image = "default_grass_3.png",
wield_image = "default_grass_3.png",
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
drop = {
max_items = 1, max_items = 1,
items = { items = {
{items = {'farming:seed_wheat'},rarity = 5}, {items = {'farming:seed_wheat'},rarity = 5},
{items = {'default:grass_1'}}, {items = {'default:grass_1'}},
} }
},
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random grass node
local stack = ItemStack("default:grass_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
for i=2,5 do
minetest.register_node(":default:grass_"..i, {
description = "Grass",
drawtype = "plantlike",
tiles = {"default_grass_"..i..".png"},
inventory_image = "default_grass_"..i..".png",
wield_image = "default_grass_"..i..".png",
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
max_items = 1,
items = {
{items = {'farming:seed_wheat'},rarity = 5},
{items = {'default:grass_1'}},
} }
}, minetest.register_node(":default:grass_"..i, newgrass)
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
end end
minetest.register_node(":default:junglegrass", { newjunglegrass = minetest.clone_node("default:junglegrass")
description = "Jungle Grass", newjunglegrass.drop = {
drawtype = "plantlike",
visual_scale = 1.3,
tiles = {"default_junglegrass.png"},
inventory_image = "default_junglegrass.png",
wield_image = "default_junglegrass.png",
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
max_items = 1, max_items = 1,
items = { items = {
{items = {'farming:seed_cotton'},rarity = 8}, {items = {'farming:seed_cotton'},rarity = 8},
{items = {'default:junglegrass'}}, {items = {'default:junglegrass'}},
} }
}, }
groups = {snappy=3,flammable=2,flora=1,attached_node=1}, minetest.register_node(":default:junglegrass", newjunglegrass)
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
-- --
-- Place seeds -- Place seeds
@ -366,9 +301,9 @@ for i=1,8 do
} }
minetest.register_node("farming:wheat_"..i, { minetest.register_node("farming:wheat_"..i, {
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"farming_wheat_"..i..".png"}, tiles = {"farming_wheat_"..i..".png"},
paramtype = "light", paramtype = "light",
waving = 1,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
is_ground_content = true, is_ground_content = true,
@ -452,9 +387,9 @@ for i=1,8 do
} }
minetest.register_node("farming:cotton_"..i, { minetest.register_node("farming:cotton_"..i, {
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"farming_cotton_"..i..".png"}, tiles = {"farming_cotton_"..i..".png"},
paramtype = "light", paramtype = "light",
waving = 1,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
is_ground_content = true, is_ground_content = true,