Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
paramat committed May 14, 2020
1 parent b3d91a4 commit e5a7af1
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 3 deletions.
3 changes: 3 additions & 0 deletions mods/farming/README.txt
Expand Up @@ -38,3 +38,6 @@ Created by Gambit (CC BY 3.0):

Created by Napiophelios (CC BY-SA 3.0):
farming_cotton.png

Created by Extex101 (CC BY-SA 3.0):
farming_cotton_wild.png
23 changes: 22 additions & 1 deletion mods/farming/init.lua
Expand Up @@ -16,7 +16,7 @@ dofile(farming.path .. "/nodes.lua")
dofile(farming.path .. "/hoes.lua")


-- WHEAT
-- Wheat

farming.register_plant("farming:wheat", {
description = S("Wheat Seed"),
Expand Down Expand Up @@ -71,6 +71,25 @@ farming.register_plant("farming:cotton", {
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", {
description = S("String"),
inventory_image = "farming_string.png",
Expand Down Expand Up @@ -139,7 +158,9 @@ minetest.register_craft({
burntime = 5,
})


-- Register farming items as dungeon loot

if minetest.global_exists("dungeon_loot") then
dungeon_loot.register({
{name = "farming:string", chance = 0.5, count = {1, 8}},
Expand Down
34 changes: 34 additions & 0 deletions mods/farming/license.txt
Expand Up @@ -59,3 +59,37 @@ rights may limit how you use the material.

For more details:
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/
37 changes: 35 additions & 2 deletions mods/farming/nodes.lua
Expand Up @@ -230,20 +230,53 @@ minetest.register_abm({
})


-- Make default:grass_* occasionally drop wheat seed

for i = 1, 5 do
minetest.override_item("default:grass_"..i, {drop = {
max_items = 1,
items = {
{items = {"farming:seed_wheat"},rarity = 5},
{items = {"farming:seed_wheat"}, rarity = 5},
{items = {"default:grass_1"}},
}
}})
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 = {
max_items = 1,
items = {
{items = {"farming:seed_cotton"},rarity = 8},
{items = {"farming:seed_cotton"}, rarity = 8},
{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 added mods/farming/textures/farming_cotton_wild.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5a7af1

Please sign in to comment.