Move grass, junglegrass to new mod hades_grass

master
Wuzzy 2021-07-19 23:44:34 +02:00
parent ec6fb02566
commit f3aa8cea0f
26 changed files with 175 additions and 158 deletions

View File

@ -1008,12 +1008,6 @@ minetest.register_craft({
minetest.register_craft({
type = "fuel",
recipe = "hades_core:junglegrass",
burntime = 2,
})
minetest.register_craft({
@ -1071,12 +1065,6 @@ minetest.register_craft({
})
minetest.register_craft({
type = "fuel",
recipe = "hades_core:grass_1",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "hades_core:axe_wood",
@ -1199,36 +1187,10 @@ minetest.register_craft({
recipe = {'hades_core:cobble', 'hades_core:ash'},
})
minetest.register_craft({
output = 'hades_core:grass_1',
recipe = {
{'hades_core:mossycobble', '', ''},
{'hades_core:mossycobble', '', ''},
{'hades_core:dirt', '', ''},
}
})
minetest.register_craft({
output = 'hades_core:grass_1',
recipe = {
{'hades_core:mossytuff', '', ''},
{'hades_core:mossytuff', '', ''},
{'hades_core:dirt', '', ''},
}
})
minetest.register_craft({
output = 'hades_core:junglegrass',
recipe = {
{'hades_core:grass_1', '', ''},
{'hades_core:dirt', '', ''},
}
})
minetest.register_craft({
output = 'hades_core:papyrus',
recipe = {
{'hades_core:junglegrass', '', ''},
{'hades_grass:junglegrass', '', ''},
{'hades_core:dirt', '', ''},
}
})

View File

@ -246,7 +246,7 @@ function hades_core.get_seasonal_grass_color_param2(old_param2)
-- There are 6 grass colors:
-- 3 for the 3 seasons
-- and 3 for brief transition periods on season change
local new_param2 = param2
local new_param2 = old_param2
local season = hades_seasons.get_season()
if season == hades_seasons.SEASON_SPRING then
if old_param2 == 4 then

View File

@ -22,76 +22,6 @@ minetest.register_node("hades_core:dry_shrub", {
})
minetest.register_node("hades_core:grass_1", {
description = S("Grass"),
drawtype = "plantlike",
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,
is_ground_content = true,
buildable_to = true,
floodable = true,
groups = {snappy=3,flammable=3,flora=1,grass=1,attached_node=1},
sounds = hades_sounds.node_sound_grass_defaults(),
selection_box = {
type = "fixed",
fixed = {-6/16, -0.5, -6/16, 6/16, -5/16, 6/16},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random grass node
local stack = ItemStack("hades_core:grass_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("hades_core:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
for i=2,5 do
minetest.register_node("hades_core:grass_"..i, {
description = S("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,
floodable = true,
is_ground_content = true,
drop = "hades_core:grass_1",
groups = {snappy=3,flammable=3,flora=1,grass=1,attached_node=1,not_in_creative_inventory=1},
sounds = hades_sounds.node_sound_grass_defaults(),
selection_box = {
type = "fixed",
fixed = {-6/16, -0.5, -6/16, 6/16, -3/16, 6/16},
},
})
end
minetest.register_node("hades_core:junglegrass", {
description = S("Tropical Grass"),
drawtype = "plantlike",
tiles = {"default_junglegrass.png"},
inventory_image = "default_junglegrass.png",
wield_image = "default_junglegrass.png",
waving = 1,
paramtype = "light",
walkable = false,
buildable_to = true,
floodable = true,
is_ground_content = true,
groups = {snappy=3,flammable=2,flora=1,grass=1,attached_node=1},
sounds = hades_sounds.node_sound_grass_defaults(),
selection_box = {
type = "fixed",
fixed = {-6/16, -0.5, -6/16, 6/16, 0.5, 6/16},
},
})
minetest.register_node("hades_core:cactus", {
description = S("Cactus"),
_tt_help = S("Grows on ash and sand"),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

View File

@ -1,2 +1,2 @@
name = hades_farming
depends = hades_sounds, hades_core, wool
depends = hades_sounds, hades_core, hades_grass, wool

View File

@ -116,7 +116,7 @@ minetest.register_abm({
for i = 1, 5 do
minetest.override_item("hades_core:grass_"..i, {
minetest.override_item("hades_grass:grass_"..i, {
_tt_help = S("Chance to drop random seed when dug"),
drop = {
max_items = 1,
@ -124,13 +124,13 @@ for i = 1, 5 do
{items = {'hades_farming:seed_wheat'},rarity = 10},
{items = {'hades_farming:seed_spice'},rarity = 10},
{items = {'hades_farming:seed_strawberry'},rarity = 10},
{items = {'hades_core:grass_1'}},
{items = {'hades_grass:grass_1'}},
}
},
})
end
minetest.override_item("hades_core:junglegrass", {
minetest.override_item("hades_grass:junglegrass", {
_tt_help = S("Chance to drop random seed when dug"),
drop = {
max_items = 1,
@ -138,7 +138,7 @@ minetest.override_item("hades_core:junglegrass", {
{items = {'hades_farming:seed_cotton'},rarity = 10},
{items = {'hades_farming:seed_tomato'},rarity = 10},
{items = {'hades_farming:seed_potato'},rarity = 10},
{items = {'hades_core:junglegrass'}},
{items = {'hades_grass:junglegrass'}},
}
}})

View File

@ -36,7 +36,7 @@ do
t = { false }
for i=1,5 do
table.insert(t, "hades_core:grass_"..i)
table.insert(t, "hades_grass:grass_"..i)
end
table.insert(plants_rotate, t)
end
@ -189,7 +189,7 @@ local get_apply_fertilizer = function(super)
end
end
end
elseif nname == "hades_core:grass" or nname == "hades_core:dirt_with_grass" or nname == "hades_core:fertile_sand" or nname == "hades_core:ash" or nname == "hades_core:volcanic_sand" or nname == "hades_core:gravel" or nname == "hades_core:gravel_volcanic" or nname == "hades_farming:soil" or nname == "hades_farming:soil_wet" then
elseif nname == "hades_grass:grass" or nname == "hades_core:dirt_with_grass" or nname == "hades_core:fertile_sand" or nname == "hades_core:ash" or nname == "hades_core:volcanic_sand" or nname == "hades_core:gravel" or nname == "hades_core:gravel_volcanic" or nname == "hades_farming:soil" or nname == "hades_farming:soil_wet" then
-- Grow grass, flowers and other random plants
for x = pos.x - 2, pos.x + 2 do
for y = pos.y, pos.y do
@ -201,33 +201,33 @@ local get_apply_fertilizer = function(super)
local above_node = minetest.get_node(pos_above)
if above_node.name == "air" and math.random() < 0.2 and node.name == nname then
local plants
if (node.name == "hades_core:grass" or node.name == "hades_core:dirt_with_grass") then
if (node.name == "hades_grass:grass" or node.name == "hades_core:dirt_with_grass") then
if super then
plants = {
{"hades_core:grass_1"},
{"hades_core:grass_2"},
{"hades_core:grass_3"},
{"hades_core:grass_4"},
{"hades_core:grass_5"},
{"hades_core:grass_1"},
{"hades_core:grass_2"},
{"hades_core:grass_3"},
{"hades_core:grass_4"},
{"hades_core:grass_5"},
{"hades_core:grass_1"},
{"hades_core:grass_2"},
{"hades_core:grass_3"},
{"hades_core:grass_4"},
{"hades_core:grass_5"},
{"hades_core:grass_1"},
{"hades_core:grass_2"},
{"hades_core:grass_3"},
{"hades_core:grass_4"},
{"hades_core:grass_5"},
{"hades_core:junglegrass"},
{"hades_core:junglegrass"},
{"hades_core:junglegrass"},
{"hades_core:junglegrass"},
{"hades_grass:grass_1"},
{"hades_grass:grass_2"},
{"hades_grass:grass_3"},
{"hades_grass:grass_4"},
{"hades_grass:grass_5"},
{"hades_grass:grass_1"},
{"hades_grass:grass_2"},
{"hades_grass:grass_3"},
{"hades_grass:grass_4"},
{"hades_grass:grass_5"},
{"hades_grass:grass_1"},
{"hades_grass:grass_2"},
{"hades_grass:grass_3"},
{"hades_grass:grass_4"},
{"hades_grass:grass_5"},
{"hades_grass:grass_1"},
{"hades_grass:grass_2"},
{"hades_grass:grass_3"},
{"hades_grass:grass_4"},
{"hades_grass:grass_5"},
{"hades_grass:junglegrass"},
{"hades_grass:junglegrass"},
{"hades_grass:junglegrass"},
{"hades_grass:junglegrass"},
{"hades_flowers:flowergrass"},
{"hades_flowers:red"},
{"hades_flowers:white"},
@ -238,11 +238,11 @@ local get_apply_fertilizer = function(super)
}
else
plants = {
{"hades_core:grass_1"},
{"hades_core:grass_2"},
{"hades_core:grass_3"},
{"hades_core:grass_4"},
{"hades_core:grass_5"},
{"hades_grass:grass_1"},
{"hades_grass:grass_2"},
{"hades_grass:grass_3"},
{"hades_grass:grass_4"},
{"hades_grass:grass_5"},
}
end
elseif (node.name == "hades_core:ash" or node.name == "hades_core:volcanic_sand" or node.name == "hades_core:gravel" or node.name == "hades_core:gravel_volcanic") then

View File

@ -9,8 +9,8 @@ local flowers = {
{"white", "hades_flowers:white", S("White Flower")},
-- TODO: Maybe add these later?
-- {"grass", "hades_core:grass_1", S("Grass")},
-- {"junglegrass", "hades_core:junglegrass", S("Tropical Grass")},
-- {"grass", "hades_grass:grass_1", S("Grass Clump")},
-- {"junglegrass", "hades_grass:junglegrass", S("Tropical Grass")},
-- {"dry_shrub", "hades_core:dry_shrub", S("Dry Shrub")},
{"sapling", "hades_trees:sapling", S("Temperate Tree Sapling")},

View File

@ -210,7 +210,7 @@ minetest.register_craft({
recipe = {
{'hades_flowers:white', 'hades_flowers:yellow', 'hades_flowers:blue'},
{'hades_flowers:red', 'hades_flowers:orange', 'hades_flowers:violet'},
{'hades_core:grass_1', 'hades_core:dirt', 'hades_core:grass_1'},
{'hades_grass:grass_1', 'hades_core:dirt', 'hades_grass:grass_1'},
}
})
@ -218,7 +218,7 @@ minetest.register_craft({
output = 'hades_flowers:white',
recipe = {
{'hades_farming:seed_cotton', 'hades_farming:seed_cotton', 'hades_farming:seed_cotton'},
{'hades_core:grass_1', 'hades_core:grass_1', 'hades_core:grass_1'},
{'hades_grass:grass_1', 'hades_grass:grass_1', 'hades_grass:grass_1'},
{'hades_core:dirt', 'hades_core:dirt', 'hades_core:dirt'},
}
})
@ -226,7 +226,7 @@ minetest.register_craft({
output = 'hades_flowers:yellow',
recipe = {
{'hades_flowers:white', 'hades_flowers:white', 'hades_flowers:white'},
{'hades_core:grass_1', 'hades_core:gold_lump', 'hades_core:grass_1'},
{'hades_grass:grass_1', 'hades_core:gold_lump', 'hades_grass:grass_1'},
{'hades_core:dirt', 'hades_core:dirt', 'hades_core:dirt'},
}
})
@ -234,7 +234,7 @@ minetest.register_craft({
output = 'hades_flowers:red',
recipe = {
{'hades_flowers:white', 'hades_flowers:white', 'hades_flowers:white'},
{'hades_core:grass_1', 'hades_core:ruby', 'hades_core:grass_1'},
{'hades_grass:grass_1', 'hades_core:ruby', 'hades_grass:grass_1'},
{'hades_core:dirt', 'hades_core:dirt', 'hades_core:dirt'},
}
})
@ -250,7 +250,7 @@ minetest.register_craft({
output = 'hades_flowers:blue',
recipe = {
{'hades_flowers:white', 'hades_flowers:white', 'hades_flowers:white'},
{'hades_core:grass_1', 'hades_core:sapphire', 'hades_core:grass_1'},
{'hades_grass:grass_1', 'hades_core:sapphire', 'hades_grass:grass_1'},
{'hades_core:dirt', 'hades_core:dirt', 'hades_core:dirt'},
}
})

122
mods/hades_grass/init.lua Normal file
View File

@ -0,0 +1,122 @@
local S = minetest.get_translator("hades_grass")
minetest.register_node("hades_grass:grass_1", {
description = S("Grass Clump"),
drawtype = "plantlike",
tiles = {"hades_grass_plant_colorable_1.png"},
-- use a bigger inventory image
inventory_image = "hades_grass_plant_colorable_3.png",
wield_image = "hades_grass_plant_colorable_3.png",
paramtype = "light",
paramtype2 = "color",
palette = "hades_core_palette_grass.png",
color = "#AEFF5F",
waving = 1,
walkable = false,
is_ground_content = true,
buildable_to = true,
floodable = true,
groups = {snappy=3,flammable=3,flora=1,grass=1,attached_node=1},
sounds = hades_sounds.node_sound_grass_defaults(),
selection_box = {
type = "fixed",
fixed = {-6/16, -0.5, -6/16, 6/16, -5/16, 6/16},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random grass node
local stack = ItemStack("hades_grass:grass_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("hades_grass:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
local drop_counts = { 1, 1, 2, 2, 3 }
for i=2,5 do
minetest.register_node("hades_grass:grass_"..i, {
description = S("Grass Clump (Stage @1)", i),
drawtype = "plantlike",
tiles = {"hades_grass_plant_colorable_"..i..".png"},
inventory_image = "hades_grass_plant_colorable_"..i..".png",
wield_image = "hades_grass_plant_colorable_"..i..".png",
paramtype = "light",
paramtype2 = "color",
palette = "hades_core_palette_grass.png",
color = "#AEFF5F",
waving = 1,
walkable = false,
buildable_to = true,
floodable = true,
is_ground_content = true,
drop = "hades_grass:grass_1 " .. drop_counts[i],
groups = {snappy=3,flammable=3,flora=1,grass=1,attached_node=1,not_in_creative_inventory=1},
sounds = hades_sounds.node_sound_grass_defaults(),
selection_box = {
type = "fixed",
fixed = {-6/16, -0.5, -6/16, 6/16, -3/16, 6/16},
},
})
end
minetest.register_node("hades_grass:junglegrass", {
description = S("Tropical Grass"),
drawtype = "plantlike",
tiles = {"default_junglegrass.png"},
inventory_image = "default_junglegrass.png",
wield_image = "default_junglegrass.png",
waving = 1,
paramtype = "light",
walkable = false,
buildable_to = true,
floodable = true,
is_ground_content = true,
groups = {snappy=3,flammable=2,flora=1,grass=1,attached_node=1},
sounds = hades_sounds.node_sound_grass_defaults(),
selection_box = {
type = "fixed",
fixed = {-6/16, -0.5, -6/16, 6/16, 0.5, 6/16},
},
})
minetest.register_craft({
output = 'hades_grass:grass_1',
recipe = {
{'hades_grass:mossycobble', '', ''},
{'hades_grass:mossycobble', '', ''},
{'hades_grass:dirt', '', ''},
}
})
minetest.register_craft({
output = 'hades_grass:grass_1',
recipe = {
{'hades_grass:mossytuff', '', ''},
{'hades_grass:mossytuff', '', ''},
{'hades_grass:dirt', '', ''},
}
})
minetest.register_craft({
output = 'hades_grass:junglegrass',
recipe = {
{'hades_grass:grass_1', '', ''},
{'hades_grass:dirt', '', ''},
}
})
minetest.register_craft({
type = "fuel",
recipe = "hades_grass:grass_1",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "hades_grass:junglegrass",
burntime = 2,
})
minetest.register_alias("hades_core:grass_1", "hades_grass:grass_1")
minetest.register_alias("hades_core:grass_2", "hades_grass:grass_2")
minetest.register_alias("hades_core:grass_3", "hades_grass:grass_3")
minetest.register_alias("hades_core:grass_4", "hades_grass:grass_4")
minetest.register_alias("hades_core:grass_5", "hades_grass:grass_5")
minetest.register_alias("hades_core:junglegrass", "hades_grass:junglegrass")

View File

@ -0,0 +1,3 @@
name = hades_grass
description = Adds several grasses (but not the grass cover for dirt)
depends = hades_core, hades_seasons

View File

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

View File

@ -3,7 +3,7 @@ local S = minetest.get_translator("hades_magic_wand")
local cycles = {
{ "hades_core:dirt", "hades_core:dirt_with_grass_l1", "hades_core:dirt_with_grass_l2", "hades_core:dirt_with_grass_l3", "hades_core:dirt_with_grass" },
{ "hades_farming:soil", "hades_farming:soil_wet" },
{ "hades_core:grass_1", "hades_core:grass_2", "hades_core:grass_3", "hades_core:grass_4", "hades_core:grass_5" },
{ "hades_grass:grass_1", "hades_grass:grass_2", "hades_grass:grass_3", "hades_grass:grass_4", "hades_grass:grass_5" },
{ "hades_waterplants:seaweed_4", "hades_waterplants:seaweed_2", "hades_waterplants:seaweed_3", "hades_waterplants:seaweed" },
{ "hades_waterplants:waterlily", "hades_waterplants:waterlily_225", "hades_waterplants:waterlily_45", "hades_waterplants:waterlily_675", "hades_waterplants:waterlily_s3", "hades_waterplants:waterlily_s1", "hades_waterplants:waterlily_s2", "hades_waterplants:waterlily_s4" },
{ "hades_vines:willow", "hades_vines:willow_rotten" },

View File

@ -223,7 +223,7 @@ minetest.register_craft({
output = 'hades_trees:jungle_sapling',
recipe = {
{'hades_trees:sapling'},
{'hades_core:junglegrass'},
{'hades_grass:junglegrass'},
{'hades_core:dirt'},
}
})
@ -232,7 +232,7 @@ minetest.register_craft({
output = 'hades_trees:olive_sapling',
recipe = {
{'hades_trees:sapling'},
{'hades_core:grass_1'},
{'hades_grass:grass_1'},
{'hades_core:dirt'},
}
})
@ -259,7 +259,7 @@ minetest.register_craft({
output = 'hades_trees:banana_sapling',
recipe = {
{'hades_trees:jungle_sapling'},
{'hades_core:junglegrass'},
{'hades_grass:junglegrass'},
{'hades_core:dirt'},
}
})