1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00

Add wild cotton plant in savanna as a source of cotton seeds (#2617)

Junglegrass is unchanged as a source of cotton seeds for now, but
probably should be removed as a source in future, as players get
used to the new source.
This commit is contained in:
Paramat 2020-05-14 23:49:17 +01:00 committed by GitHub
parent b3d91a487d
commit e5a7af1c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 94 additions and 3 deletions

View File

@ -38,3 +38,6 @@ Created by Gambit (CC BY 3.0):
Created by Napiophelios (CC BY-SA 3.0): Created by Napiophelios (CC BY-SA 3.0):
farming_cotton.png farming_cotton.png
Created by Extex101 (CC BY-SA 3.0):
farming_cotton_wild.png

View File

@ -16,7 +16,7 @@ dofile(farming.path .. "/nodes.lua")
dofile(farming.path .. "/hoes.lua") dofile(farming.path .. "/hoes.lua")
-- WHEAT -- Wheat
farming.register_plant("farming:wheat", { farming.register_plant("farming:wheat", {
description = S("Wheat Seed"), description = S("Wheat Seed"),
@ -71,6 +71,25 @@ farming.register_plant("farming:cotton", {
groups = {flammable = 4}, groups = {flammable = 4},
}) })
minetest.register_decoration({
name = "farming:cotton_wild",
deco_type = "simple",
place_on = {"default:dry_dirt_with_dry_grass"},
sidelen = 16,
noise_params = {
offset = -0.1,
scale = 0.1,
spread = {x = 50, y = 50, z = 50},
seed = 4242,
octaves = 3,
persist = 0.7
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
decoration = "farming:cotton_wild",
})
minetest.register_craftitem("farming:string", { minetest.register_craftitem("farming:string", {
description = S("String"), description = S("String"),
inventory_image = "farming_string.png", inventory_image = "farming_string.png",
@ -139,7 +158,9 @@ minetest.register_craft({
burntime = 5, burntime = 5,
}) })
-- Register farming items as dungeon loot -- Register farming items as dungeon loot
if minetest.global_exists("dungeon_loot") then if minetest.global_exists("dungeon_loot") then
dungeon_loot.register({ dungeon_loot.register({
{name = "farming:string", chance = 0.5, count = {1, 8}}, {name = "farming:string", chance = 0.5, count = {1, 8}},

View File

@ -59,3 +59,37 @@ rights may limit how you use the material.
For more details: For more details:
http://creativecommons.org/licenses/by/3.0/ http://creativecommons.org/licenses/by/3.0/
-----------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2017 Napiophelios
Copyright (C) 2020 Extex101
You are free to:
Share — copy and redistribute the material in any medium or format.
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures that
legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public
domain or where your use is permitted by an applicable exception or limitation.
No warranties are given. The license may not give you all of the permissions necessary
for your intended use. For example, other rights such as publicity, privacy, or moral
rights may limit how you use the material.
For more details:
http://creativecommons.org/licenses/by-sa/3.0/

View File

@ -230,20 +230,53 @@ minetest.register_abm({
}) })
-- Make default:grass_* occasionally drop wheat seed
for i = 1, 5 do for i = 1, 5 do
minetest.override_item("default:grass_"..i, {drop = { minetest.override_item("default:grass_"..i, {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"}},
} }
}}) }})
end end
-- Make default:junglegrass occasionally drop cotton seed.
-- This is the old source of cotton seeds that makes no sense. It is a leftover
-- from Mapgen V6 where junglegrass was the only plant available to be a source.
-- This source is kept for now to avoid disruption but should probably be
-- removed in future as players get used to the new source.
minetest.override_item("default:junglegrass", {drop = { minetest.override_item("default:junglegrass", {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"}},
} }
}}) }})
-- Wild cotton as a source of cotton seed
minetest.register_node("farming:cotton_wild", {
description = S("Wild Cotton"),
drawtype = "plantlike",
waving = 1,
tiles = {"farming_cotton_wild.png"},
inventory_image = "farming_cotton_wild.png",
wield_image = "farming_cotton_wild.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, attached_node = 1, flammable = 4},
drop = "farming:seed_cotton",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-6 / 16, -8 / 16, -6 / 16, 6 / 16, 5 / 16, 6 / 16},
},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B