Initialize repo
|
@ -0,0 +1,157 @@
|
|||
### GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates the
|
||||
terms and conditions of version 3 of the GNU General Public License,
|
||||
supplemented by the additional permissions listed below.
|
||||
|
||||
#### 0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the
|
||||
GNU General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License, other
|
||||
than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
#### 1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
#### 2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
- a) under this License, provided that you make a good faith effort
|
||||
to ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
- b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
#### 3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from a
|
||||
header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
- a) Give prominent notice with each copy of the object code that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
- b) Accompany the object code with a copy of the GNU GPL and this
|
||||
license document.
|
||||
|
||||
#### 4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that, taken
|
||||
together, effectively do not restrict modification of the portions of
|
||||
the Library contained in the Combined Work and reverse engineering for
|
||||
debugging such modifications, if you also do each of the following:
|
||||
|
||||
- a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
- b) Accompany the Combined Work with a copy of the GNU GPL and this
|
||||
license document.
|
||||
- c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
- d) Do one of the following:
|
||||
- 0) Convey the Minimal Corresponding Source under the terms of
|
||||
this License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
- 1) Use a suitable shared library mechanism for linking with
|
||||
the Library. A suitable mechanism is one that (a) uses at run
|
||||
time a copy of the Library already present on the user's
|
||||
computer system, and (b) will operate properly with a modified
|
||||
version of the Library that is interface-compatible with the
|
||||
Linked Version.
|
||||
- e) Provide Installation Information, but only if you would
|
||||
otherwise be required to provide such information under section 6
|
||||
of the GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the Application
|
||||
with a modified version of the Linked Version. (If you use option
|
||||
4d0, the Installation Information must accompany the Minimal
|
||||
Corresponding Source and Corresponding Application Code. If you
|
||||
use option 4d1, you must provide the Installation Information in
|
||||
the manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.)
|
||||
|
||||
#### 5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the Library
|
||||
side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
- a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities, conveyed under the terms of this License.
|
||||
- b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
#### 6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
as you received it specifies that a certain numbered version of the
|
||||
GNU Lesser General Public License "or any later version" applies to
|
||||
it, you have the option of following the terms and conditions either
|
||||
of that published version or of any later version published by the
|
||||
Free Software Foundation. If the Library as you received it does not
|
||||
specify a version number of the GNU Lesser General Public License, you
|
||||
may choose any version of the GNU Lesser General Public License ever
|
||||
published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
|
@ -0,0 +1,43 @@
|
|||
# Scythes & Sickles
|
||||
Adds scythes and sickles with unique applications for farming
|
||||
|
||||
![](https://raw.githubusercontent.com/t-affeldt/sickles/master/screenshot.png)
|
||||
|
||||
Scythes allow you to quickly sweep through your fields. They can only break fully grown crops and harvest multiple plants at once.
|
||||
They also replant harvested crops automatically. Alternatively, they can be used as an effective weapon with higher range.
|
||||
Sickles allow you to scrape grass and moss from overgrown nodes. The resulting moss can then be used as dye of fertilizer.
|
||||
They also let you to cut wheat and other grains more precisely, allowing you to harvest some crops without completely resetting them.
|
||||
|
||||
## Scythes
|
||||
- only break fully grown crops
|
||||
- harvest all grown neighboring crops as well
|
||||
- automatically replant harvested crops
|
||||
- can be used as a weapon with slightly more range
|
||||
|
||||
## Sickles
|
||||
- are an effective cutting tool
|
||||
- can harvest grass and moss from overgrown nodes
|
||||
- reset wheat and other grains by a few stages upon harvest instead of destroying them
|
||||
- have a slightly shorter range
|
||||
|
||||
## Moss
|
||||
- can be found in four different colors
|
||||
- can be used as fuel in a furnace
|
||||
- can be crafted into dye
|
||||
- can be cooked into fertiliser (requires bonemeal mod)
|
||||
- can be turned into blocks
|
||||
- can be placed on the side of any node
|
||||
- can be eaten for a minimal health gain
|
||||
|
||||
## Moss Blocks
|
||||
- are an effective fuel in a furnace
|
||||
- can be used as a building block
|
||||
- can be crafted into slabs and stairs
|
||||
- can be dyed in any of it's four natural colors
|
||||
|
||||
## License Information
|
||||
The entire source code is written by me and licensed under *GNU LGPL v3*. You can find the complete license information
|
||||
in the supplied license file.
|
||||
Textures for tools and moss items are made by Cap for this mod and licensed under *CC BY-SA 3.0*.
|
||||
Textures for placed moss node and flower petals are by Vanessa Ezekowitz under *CC BY-SA 4.0* for her [plantlife modpack](https://forum.minetest.net/viewtopic.php?t=3898).
|
||||
The sound effect for placing or breaking moss blocks is made by DrMinky under *CC BY 3.0* and can be found on [FreeSound](https://freesound.org/people/DrMinky/sounds/167073/).
|
|
@ -0,0 +1,7 @@
|
|||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
dofile(modpath .. "/lib/api.lua")
|
||||
dofile(modpath .. "/lib/tools.lua")
|
||||
dofile(modpath .. "/lib/items.lua")
|
||||
dofile(modpath .. "/lib/cuttables.lua")
|
||||
dofile(modpath .. "/lib/compatibility.lua")
|
|
@ -0,0 +1,156 @@
|
|||
local is_farming_redo = minetest.get_modpath("farming") ~= nil
|
||||
and farming ~= nil and farming.mod == "redo"
|
||||
|
||||
local MAX_ITEM_WEAR = 65535
|
||||
local DEFAULT_SICKLE_USES = 120
|
||||
local DEFAULT_SCYTHE_USES = 30
|
||||
|
||||
sickles = {}
|
||||
|
||||
local function get_wielded_item(player)
|
||||
if not minetest.is_player(player) then return end
|
||||
local itemstack = player:get_wielded_item()
|
||||
if itemstack == nil then return end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local function get_item_group(def, group)
|
||||
if def == nil
|
||||
or def.groups == nil
|
||||
or def.groups[group] == nil then
|
||||
return 0
|
||||
end
|
||||
return def.groups[group]
|
||||
end
|
||||
|
||||
function sickles.register_cuttable(nodename, base, item)
|
||||
local def = minetest.registered_nodes[nodename]
|
||||
if def == nil then return end
|
||||
local default_handler = def.on_punch or minetest.node_punch
|
||||
minetest.override_item(nodename, {
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
local itemstack = get_wielded_item(puncher)
|
||||
local itemdef = itemstack:get_definition()
|
||||
local level = get_item_group(itemdef, "sickle")
|
||||
if level == 0 then
|
||||
return default_handler(pos, node, puncher, pointed_thing)
|
||||
end
|
||||
local pname = puncher:get_player_name()
|
||||
if minetest.is_protected(pos, pname) then
|
||||
minetest.record_protection_violation(pos, pname)
|
||||
return
|
||||
end
|
||||
minetest.handle_node_drops(pos, { item }, puncher)
|
||||
minetest.after(0, function()
|
||||
minetest.swap_node(pos, { name = base, param2 = node.param2 })
|
||||
end)
|
||||
local max_uses = get_item_group(itemdef, "sickle_uses") or DEFAULT_SICKLE_USES
|
||||
itemstack:add_wear(math.ceil(MAX_ITEM_WEAR / (max_uses - 1)))
|
||||
if itemstack:get_count() == 0 and itemdef.sound and itemdef.sound.breaks then
|
||||
minetest.sound_play(itemdef.sound.breaks, { pos = pos, gain = 0.5 })
|
||||
end
|
||||
puncher:set_wielded_item(itemstack)
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
function sickles.register_trimmable(node, base)
|
||||
local def = minetest.registered_nodes[node]
|
||||
if def == nil then return end
|
||||
local handler = def.after_dig_node
|
||||
minetest.override_item(node, {
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
local itemstack = get_wielded_item(digger)
|
||||
local itemdef = itemstack:get_definition()
|
||||
local level = get_item_group(itemdef, "sickle")
|
||||
if level == 0 then
|
||||
if handler ~= nil then
|
||||
return handler(pos, oldnode, oldmetadata, digger)
|
||||
else return end
|
||||
end
|
||||
local param2 = minetest.registered_nodes[base].place_param2
|
||||
minetest.set_node(pos, { name = base, param2 = param2 })
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
local function get_plant_definition(plant)
|
||||
if is_farming_redo then
|
||||
return farming.registered_plants[plant]
|
||||
else
|
||||
local mod = plant:split(":")[1] or ""
|
||||
local name = plant:split(":")[2] or ""
|
||||
local pname = name:gsub("(.*)_.*$", "%1")
|
||||
return farming.registered_plants[pname]
|
||||
end
|
||||
end
|
||||
|
||||
local function get_seed_name(plant)
|
||||
if is_farming_redo then
|
||||
return farming.registered_plants[plant].seed
|
||||
else
|
||||
local mod = plant:split(":")[1]
|
||||
local name = plant:split(":")[2]
|
||||
local pname = name:gsub("(.*)_.*$", "%1")
|
||||
return mod .. ":seed_" .. pname
|
||||
end
|
||||
end
|
||||
|
||||
local function harvest_and_replant(pos, player)
|
||||
local playername = player:get_player_name()
|
||||
local node = minetest.get_node(pos)
|
||||
local node_id = node.name:gsub("(.*)_.*$", "%1")
|
||||
local stage = tonumber(node.name:gsub(".*_(.*)$", "%1") or 0)
|
||||
local plantdef = get_plant_definition(node_id)
|
||||
if plantdef == nil or plantdef.steps == nil or stage < plantdef.steps then
|
||||
return false
|
||||
end
|
||||
if minetest.is_protected(pos, playername) then
|
||||
minetest.record_protection_violation(pos, playername)
|
||||
return false
|
||||
end
|
||||
minetest.node_dig(pos, node, player)
|
||||
minetest.sound_play("default_dig_snappy", { pos = pos, gain = 0.5, max_hear_distance = 8 }, true)
|
||||
minetest.after(0, function()
|
||||
local invref = player:get_inventory()
|
||||
local seeds = get_seed_name(node_id)
|
||||
if minetest.get_node(pos).name ~= "air" or
|
||||
not invref:contains_item("main", seeds) then
|
||||
return true
|
||||
end
|
||||
invref:remove_item("main", seeds)
|
||||
minetest.set_node(pos, { name = seeds, param2 = 1 })
|
||||
end)
|
||||
return true
|
||||
end
|
||||
|
||||
function sickles.use_scythe(itemstack, user, pointed_thing)
|
||||
if pointed_thing == nil then return end
|
||||
local itemdef = itemstack:get_definition()
|
||||
if pointed_thing.type == "object" then
|
||||
local tool_capabilities = itemstack:get_tool_capabilities()
|
||||
local meta = itemstack:get_meta()
|
||||
local last_punch = meta:get_float("last_punch") or 0
|
||||
local now = minetest.get_gametime()
|
||||
meta:set_float("last_punch", now)
|
||||
pointed_thing.ref:punch(user, now - last_punch, tool_capabilities)
|
||||
end
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
local max_uses = get_item_group(itemdef, "scythe_uses") or DEFAULT_SCYTHE_USES
|
||||
local range = (get_item_group(itemdef, "scythe") or 1) - 1
|
||||
local pos = pointed_thing.under
|
||||
local harvested = harvest_and_replant(pos, user)
|
||||
if not harvested then return end
|
||||
if range > 0 then
|
||||
local pos1 = vector.add(pos, { x = -range, y = 0, z = -range })
|
||||
local pos2 = vector.add(pos, { x = range, y = 0, z = range })
|
||||
local positions = minetest.find_nodes_in_area(pos1, pos2, "group:plant")
|
||||
for _, check_pos in ipairs(positions) do
|
||||
if pos ~= check_pos then
|
||||
harvest_and_replant(check_pos, user)
|
||||
end
|
||||
end
|
||||
end
|
||||
itemstack:add_wear(math.ceil(MAX_ITEM_WEAR / (max_uses - 1)))
|
||||
return itemstack
|
||||
end
|
|
@ -0,0 +1,51 @@
|
|||
local mod_flowers = minetest.get_modpath("flowers") ~= nil
|
||||
local mod_bonemeal = minetest.get_modpath("bonemeal") ~= nil
|
||||
local mod_trunks = minetest.get_modpath("trunks") ~= nil
|
||||
local mod_cottages = minetest.get_modpath("cottages") ~= nil
|
||||
|
||||
if mod_bonemeal then
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 9,
|
||||
output = "bonemeal:fertiliser",
|
||||
recipe = "group:moss"
|
||||
})
|
||||
end
|
||||
|
||||
if mod_trunks then
|
||||
minetest.register_alias_force("trunks:moss", "sickles:moss")
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = " trunks:moss_fungus",
|
||||
recipe = { "group:moss", "group:mushroom" }
|
||||
})
|
||||
end
|
||||
|
||||
if mod_flowers then
|
||||
minetest.register_craft({
|
||||
output = "sickles:petals",
|
||||
recipe = {
|
||||
{ "flowers:dandelion_white", "flowers:dandelion_white" },
|
||||
{ "flowers:dandelion_white", "flowers:dandelion_white" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if mod_cottages then
|
||||
minetest.override_item("default:dirt_with_grass", {
|
||||
after_dig_node = function() end
|
||||
})
|
||||
|
||||
local groups = minetest.registered_tools["cottages:pitchfork"].groups
|
||||
groups.sickle = 1
|
||||
groups.sickle_uses = 12
|
||||
minetest.override_item("cottages:pitchfork", {
|
||||
groups = groups
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "cottages:hay_mat",
|
||||
recipe = {{ "group:grass", "group:grass", "group:grass" }}
|
||||
})
|
||||
end
|
|
@ -0,0 +1,109 @@
|
|||
local mod_stairs = minetest.get_modpath("stairs")
|
||||
local mod_walls = minetest.get_modpath("walls")
|
||||
local mod_flowers = minetest.get_modpath("flowers") ~= nil
|
||||
local mod_farming = minetest.get_modpath("farming") ~= nil
|
||||
local mod_footprints = minetest.get_modpath("footprints") ~= nil
|
||||
local mod_nature = minetest.get_modpath("nature_classic") ~= nil
|
||||
local mod_moretrees = minetest.get_modpath("moretrees") ~= nil
|
||||
local mod_woodsoils = minetest.get_modpath("woodsoils") ~= nil
|
||||
local mod_grains = minetest.get_modpath("grains") ~= nil
|
||||
local mod_cucina_vegana = minetest.get_modpath("cucina_vegana") ~= nil
|
||||
local mod_caverealms = minetest.get_modpath("caverealms") ~= nil
|
||||
local mod_df_mapitems = minetest.get_modpath("df_mapitems") ~= nil
|
||||
local mod_df_primordial_items = minetest.get_modpath("df_primordial_items") ~= nil
|
||||
local mod_ethereal = minetest.get_modpath("ethereal") ~= nil
|
||||
|
||||
sickles.register_cuttable("default:dirt_with_grass", "default:dirt", "default:grass_1")
|
||||
sickles.register_cuttable("default:dirt_with_dry_grass", "default:dirt", "default:dry_grass_1")
|
||||
sickles.register_cuttable("default:dry_dirt_with_dry_grass", "default:dry_dirt", "default:dry_grass_1")
|
||||
sickles.register_cuttable("default:dirt_with_rainforest_litter", "default:dirt", "default:junglegrass")
|
||||
sickles.register_cuttable("default:dirt_with_coniferous_litter", "default:dirt", "default:dry_grass_1")
|
||||
sickles.register_cuttable("default:permafrost_with_moss", "default:permafrost", "sickles:moss")
|
||||
sickles.register_cuttable("default:mossycobble", "default:cobble", "sickles:moss")
|
||||
|
||||
if mod_walls then
|
||||
sickles.register_cuttable("walls:mossycobble", "walls:cobble", "sickles:moss")
|
||||
end
|
||||
|
||||
if mod_stairs then
|
||||
sickles.register_cuttable("stairs:slab_mossycobble", "stairs:slab_cobble", "sickles:moss")
|
||||
sickles.register_cuttable("stairs:stair_mossycobble", "stairs:stair_cobble", "sickles:moss")
|
||||
sickles.register_cuttable("stairs:stair_inner_mossycobble", "stairs:stair_inner_cobble", "sickles:moss")
|
||||
sickles.register_cuttable("stairs:stair_outer_mossycobble", "stairs:stair_outer_cobble", "sickles:moss")
|
||||
end
|
||||
|
||||
if mod_farming then
|
||||
sickles.register_trimmable("farming:wheat_8", "farming:wheat_2")
|
||||
end
|
||||
|
||||
if mod_footprints then
|
||||
sickles.register_cuttable("footprints:dirt_with_dry_grass", "default:dirt", "default:dry_grass_1")
|
||||
sickles.register_cuttable("footprints:dry_dirt_with_dry_grass", "default:dry_dirt", "default:dry_grass_1")
|
||||
sickles.register_cuttable("footprints:dirt_with_rainforest_litter", "default:dirt", "default:junglegrass")
|
||||
sickles.register_cuttable("footprints:dirt_with_coniferous_litter", "default:dirt", "default:dry_grass_1")
|
||||
end
|
||||
|
||||
if mod_nature and not mod_moretrees then
|
||||
sickles.register_cuttable("nature:blossom", "default:leaves", "sickles:petals")
|
||||
end
|
||||
|
||||
if mod_moretrees then
|
||||
sickles.register_cuttable("moretrees:apple_blossoms", "moretrees:apple_tree_leaves", "sickles:petals")
|
||||
end
|
||||
|
||||
if mod_woodsoils then
|
||||
sickles.register_cuttable("woodsoils:grass_with_leaves_1", "default:dirt", "default:dry_grass_1")
|
||||
sickles.register_cuttable("woodsoils:grass_with_leaves_2", "default:dirt", "default:dry_grass_1")
|
||||
sickles.register_cuttable("woodsoils:grass_with_leaves_1", "default:dirt", "default:grass_1")
|
||||
sickles.register_cuttable("woodsoils:grass_with_leaves_2", "default:dirt", "default:grass_1")
|
||||
end
|
||||
|
||||
if mod_farming and farming ~= nil and farming.mod == "redo" then
|
||||
sickles.register_trimmable("farming:rye_8", "farming:rye_2")
|
||||
sickles.register_trimmable("farming:oat_8", "farming:oat_2")
|
||||
sickles.register_trimmable("farming:barley_7", "farming:barley_2")
|
||||
sickles.register_trimmable("farming:rice_8", "farming:rice_2")
|
||||
end
|
||||
|
||||
if mod_grains then
|
||||
sickles.register_trimmable("grains:rye_8", "grains:rye_2")
|
||||
sickles.register_trimmable("grains:oat_8", "grains:oat_2")
|
||||
sickles.register_trimmable("grains:barley_8", "grains:barley_2")
|
||||
sickles.register_trimmable("grains:rice_8", "grains:rice_2")
|
||||
end
|
||||
|
||||
if mod_cucina_vegana then
|
||||
sickles.register_trimmable("cucina_vegana:rice_6", "grains:rice_2")
|
||||
end
|
||||
|
||||
if mod_caverealms then
|
||||
sickles.register_cuttable("caverealms:stone_with_moss", "default:cobble", "sickles:moss")
|
||||
sickles.register_cuttable("caverealms:stone_with_lichen", "default:cobble", "sickles:moss_purple")
|
||||
sickles.register_cuttable("caverealms:stone_with_algae", "default:cobble", "sickles:moss_yellow")
|
||||
end
|
||||
|
||||
if mod_df_mapitems then
|
||||
sickles.register_cuttable("df_mapitems:dirt_with_cave_moss", "default:cobble", "sickles:moss_blue")
|
||||
sickles.register_cuttable("df_mapitems:cobble_with_floor_fungus", "default:cobble", "sickles:moss_yellow")
|
||||
sickles.register_cuttable("df_mapitems:cobble_with_floor_fungus_fine", "default:cobble", "sickles:moss_yellow")
|
||||
sickles.register_cuttable("df_mapitems:ice_with_hoar_moss", "default:ice", "sickles:moss_blue")
|
||||
end
|
||||
|
||||
if mod_df_primordial_items then
|
||||
sickles.register_cuttable("df_primordial_items:dirt_with_mycelium", "default:dirt", "df_primordial_items:fungal_grass_1")
|
||||
sickles.register_cuttable("df_primordial_items:jungle_tree_mossy", "df_primordial_items:jungle_tree", "sickles:moss")
|
||||
sickles.register_cuttable("df_primordial_items:jungle_tree_glowing", "df_primordial_items:jungle_tree", "df_primordial_items:mushroom_gills_glowing")
|
||||
sickles.register_cuttable("df_primordial_items:dirt_with_jungle_grass", "default:dirt", "df_primordial_items:jungle_grass_1")
|
||||
end
|
||||
|
||||
if mod_ethereal then
|
||||
sickles.register_cuttable("ethereal:bamboo_dirt", "default:dirt", "default:grass_1")
|
||||
sickles.register_cuttable("ethereal:cold_dirt", "default:dirt", "default:grass_1")
|
||||
sickles.register_cuttable("ethereal:crystal_dirt", "default:dirt", "ethereal:crytalgrass")
|
||||
sickles.register_cuttable("ethereal:fiery_dirt", "default:dirt", "ethereal:dry_shrub")
|
||||
sickles.register_cuttable("ethereal:gray_dirt", "default:dirt", "ethereal:snowygrass")
|
||||
sickles.register_cuttable("ethereal:grovel_dirt", "default:dirt", "sickles:moss")
|
||||
sickles.register_cuttable("ethereal:jungle_dirt", "default:dirt", "default:junglegrass")
|
||||
sickles.register_cuttable("ethereal:mushroom_dirt", "default:dirt", "flowers:mushroom_red")
|
||||
sickles.register_cuttable("ethereal:prairie_dirt", "default:dirt", "sickles:petals")
|
||||
end
|
|
@ -0,0 +1,137 @@
|
|||
local mod_stairs = minetest.get_modpath("stairs") ~= nil
|
||||
local mod_dye = minetest.get_modpath("dye") ~= nil
|
||||
|
||||
local colors = {
|
||||
{ dye = "dark_green" },
|
||||
{ hex = "#894adb70", name = "purple", dye = "violet" },
|
||||
{ hex = "#6c7eb070", name = "blue", dye = "cyan" },
|
||||
{ hex = "#bcc56770", name = "yellow", dye = "yellow" }
|
||||
}
|
||||
|
||||
local sounds = default.node_sound_leaves_defaults({
|
||||
footstep = "default_grass_footstep",
|
||||
dug = "sickles_moss_dug",
|
||||
place = "sickles_moss_dug"
|
||||
})
|
||||
|
||||
local node_box = {
|
||||
type = "wallmounted",
|
||||
wall_side = { -0.5, -0.5, -0.5, -0.45, 0.5, 0.5 },
|
||||
wall_top = { -0.5, 0.45, -0.5, 0.5, 0.5, 0.5 },
|
||||
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.45, 0.5 }
|
||||
}
|
||||
|
||||
for _, color in ipairs(colors) do
|
||||
local name_suffix = ""
|
||||
local display_name_prefix = ""
|
||||
local texture_overlay = ""
|
||||
if color.name ~= nil then
|
||||
name_suffix = "_" .. color.name
|
||||
display_name_prefix = color.name:gsub("^%l", string.upper) .. " "
|
||||
end
|
||||
if color.hex ~= nil then
|
||||
texture_overlay = "^[colorize:" .. color.hex
|
||||
end
|
||||
|
||||
minetest.register_node("sickles:moss" .. name_suffix, {
|
||||
description = display_name_prefix .. "Moss",
|
||||
inventory_image = "sickles_moss_item.png" .. texture_overlay,
|
||||
wield_image = "sickles_moss_item.png" .. texture_overlay,
|
||||
tiles = { "trunks_moss.png" .. texture_overlay },
|
||||
groups = { snappy = 3, attached_node = 1, flora = 1, food = 1, moss = 1, food_moss = 1, flammable = 2 },
|
||||
on_use = minetest.item_eat(1),
|
||||
is_ground_content = false,
|
||||
sounds = sounds,
|
||||
use_texture_alpha = true,
|
||||
drawtype = "signlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = node_box,
|
||||
selection_box = node_box,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
floodable = true
|
||||
})
|
||||
|
||||
minetest.register_node("sickles:moss_block" .. name_suffix, {
|
||||
description = display_name_prefix .. "Moss Block",
|
||||
tiles = { "default_moss.png" .. texture_overlay },
|
||||
is_ground_content = false,
|
||||
groups = { snappy = 3, moss_block = 1, flammable = 2, fall_damage_add_percent = -80 },
|
||||
sounds = sounds
|
||||
})
|
||||
|
||||
if mod_stairs then
|
||||
local register_stairs = stairs.register_stair_and_slab
|
||||
if stairs.mod == "redo" then register_stairs = stairs.register_all end
|
||||
register_stairs(
|
||||
"moss_block" .. name_suffix,
|
||||
"sickles:moss_block" .. name_suffix,
|
||||
{ snappy = 3, flammable = 2, fall_damage_add_percent = -80 },
|
||||
{ "default_moss.png" .. texture_overlay },
|
||||
display_name_prefix .. "Moss Stair",
|
||||
display_name_prefix .. "Moss Slab",
|
||||
sounds
|
||||
)
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "sickles:moss_block" .. name_suffix .. " 3",
|
||||
recipe = {
|
||||
{ "sickles:moss" .. name_suffix, "sickles:moss" .. name_suffix, "sickles:moss" .. name_suffix },
|
||||
{ "sickles:moss" .. name_suffix, "sickles:moss" .. name_suffix, "sickles:moss" .. name_suffix },
|
||||
{ "sickles:moss" .. name_suffix, "sickles:moss" .. name_suffix, "sickles:moss" .. name_suffix }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "sickles:moss" .. name_suffix .. " 3",
|
||||
recipe = {{ "sickles:moss_block" .. name_suffix }}
|
||||
})
|
||||
|
||||
if mod_dye then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "sickles:moss_block" .. name_suffix,
|
||||
recipe = { "group:moss_block", "dye:" .. color.dye }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "dye:" .. color.dye,
|
||||
recipe = {{ "sickles:moss" .. name_suffix }}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:moss",
|
||||
burntime = 2
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "group:moss_block",
|
||||
burntime = 18
|
||||
})
|
||||
|
||||
minetest.register_node("sickles:petals", {
|
||||
description = "Flower Petals",
|
||||
tiles = { "nature_blossom.png" },
|
||||
inventory_image = "nature_blossom.png",
|
||||
wield_image = "nature_blossom.png",
|
||||
is_ground_content = false,
|
||||
groups = { snappy = 3, attached_node = 1 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
use_texture_alpha = true,
|
||||
drawtype = "signlike",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = node_box,
|
||||
selection_box = node_box,
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
floodable = true
|
||||
})
|
|
@ -0,0 +1,123 @@
|
|||
minetest.register_tool("sickles:sickle_bronze", {
|
||||
description = "Bronze Sickle",
|
||||
inventory_image = "sickles_sickle_bronze.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.8,
|
||||
max_drop_level = 1,
|
||||
groupcaps = {
|
||||
snappy = { times = { [1] = 2.75, [2] = 1.30, [3] = 0.375 }, uses = 60, maxlevel = 2 }
|
||||
},
|
||||
damage_groups = { fleshy = 3 },
|
||||
punch_attack_uses = 110
|
||||
},
|
||||
range = 6,
|
||||
groups = { sickle = 1, sickle_uses = 110 },
|
||||
sound = { breaks = "default_tool_breaks" }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "sickles:sickle_bronze",
|
||||
recipe = {
|
||||
{ "default:bronze_ingot", "" },
|
||||
{ "", "default:bronze_ingot" },
|
||||
{ "group:stick", "" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("sickles:sickle_steel", {
|
||||
description = "Steel Sickle",
|
||||
inventory_image = "sickles_sickle_steel.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.8,
|
||||
max_drop_level = 1,
|
||||
groupcaps = {
|
||||
snappy = { times = { [1] = 2.5, [2] = 1.20, [3] = 0.35 }, uses = 60, maxlevel = 2 }
|
||||
},
|
||||
damage_groups = { fleshy = 3 },
|
||||
punch_attack_uses = 120
|
||||
},
|
||||
range = 6,
|
||||
groups = { sickle = 1, sickle_uses = 120 },
|
||||
sound = { breaks = "default_tool_breaks" }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "sickles:sickle_steel",
|
||||
recipe = {
|
||||
{ "default:steel_ingot", "" },
|
||||
{ "", "default:steel_ingot" },
|
||||
{ "group:stick", "" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("sickles:sickle_gold", {
|
||||
description = "Golden Sickle",
|
||||
inventory_image = "sickles_sickle_gold.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.8,
|
||||
max_drop_level = 1,
|
||||
groupcaps = {
|
||||
snappy = { times = { [1] = 2.0, [2] = 1.00, [3] = 0.35 }, uses = 45, maxlevel = 3 }
|
||||
},
|
||||
damage_groups = { fleshy = 2 },
|
||||
punch_attack_uses = 90
|
||||
},
|
||||
range = 6,
|
||||
groups = { sickle = 1, sickle_uses = 90 },
|
||||
sound = { breaks = "default_tool_breaks" }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "sickles:sickle_gold",
|
||||
recipe = {
|
||||
{ "default:gold_ingot", "" },
|
||||
{ "", "default:gold_ingot" },
|
||||
{ "group:stick", "" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("sickles:scythe_bronze", {
|
||||
description = "Bronze Scythe",
|
||||
inventory_image = "sickles_scythe_bronze.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 1.2,
|
||||
damage_groups = { fleshy = 5 },
|
||||
punch_attack_uses = 160
|
||||
},
|
||||
range = 12,
|
||||
on_use = sickles.use_scythe,
|
||||
groups = { scythe = 2, scythe_uses = 25 },
|
||||
sound = { breaks = "default_tool_breaks" }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "sickles:scythe_bronze",
|
||||
recipe = {
|
||||
{ "", "default:bronze_ingot", "default:bronze_ingot" },
|
||||
{ "default:bronze_ingot", "", "group:stick" },
|
||||
{ "", "", "group:stick" }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("sickles:scythe_steel", {
|
||||
description = "Bronze Scythe",
|
||||
inventory_image = "sickles_scythe_steel.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 1.2,
|
||||
damage_groups = { fleshy = 5 },
|
||||
punch_attack_uses = 180
|
||||
},
|
||||
range = 12,
|
||||
on_use = sickles.use_scythe,
|
||||
groups = { scythe = 2, scythe_uses = 30 },
|
||||
sound = { breaks = "default_tool_breaks" }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "sickles:scythe_steel",
|
||||
recipe = {
|
||||
{ "", "default:steel_ingot", "default:steel_ingot" },
|
||||
{ "default:steel_ingot", "", "group:stick" },
|
||||
{ "", "", "group:stick" }
|
||||
}
|
||||
})
|
|
@ -0,0 +1,14 @@
|
|||
name = sickles
|
||||
title = Scythes & Sickles
|
||||
author = TestificateMods
|
||||
release = 1
|
||||
description = """
|
||||
Adds scythes and sickles with unique applications for farming.
|
||||
|
||||
Scythes allow you to quickly sweep through your fields. They can only break fully grown crops and harvest multiple plants at once.
|
||||
They also replant harvested crops automatically. Alternatively, they can be used as an effective weapon with higher range.
|
||||
Sickles allow you to scrape grass and moss from overgrown nodes. The resulting moss can then be used as dye of fertilizer.
|
||||
They also let you to cut wheat and other grains more precisely, allowing you to harvest some crops without completely resetting them.
|
||||
"""
|
||||
depends = default, farming
|
||||
optional_depends = stairs, walls, cottages, dye, flowers, footprints, bonemeal, nature_classic, moretrees, trunks, grains, cucina_vegana, df_mapitems, df_primordial_items, caverealms, ethereal
|
After Width: | Height: | Size: 2.5 MiB |
After Width: | Height: | Size: 115 B |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 392 B |
After Width: | Height: | Size: 413 B |
After Width: | Height: | Size: 452 B |
After Width: | Height: | Size: 451 B |
After Width: | Height: | Size: 456 B |
After Width: | Height: | Size: 199 B |