Fixed the tunneltest mod and added the sickles mod.
parent
6d0f0de047
commit
4aa55dbf72
|
@ -60,6 +60,11 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'epic:titanium_ingot 9',
|
||||
recipe = {{'epic:titanium_block'}},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'shields:shield_wood',
|
||||
recipe = {
|
||||
|
|
|
@ -87,6 +87,7 @@ minetest.register_node("epic:snow", {
|
|||
minetest.set_node(pos, {name = "default:dirt_with_snow"})
|
||||
end
|
||||
end,
|
||||
on_use = throw_snowball
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
|
|
|
@ -287,97 +287,3 @@ minetest.register_craftitem("farming:hoe_bomb", {
|
|||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Mithril Scythe (special item)
|
||||
|
||||
farming.scythe_not_drops = {"farming:trellis", "farming:beanpole"}
|
||||
|
||||
farming.add_to_scythe_not_drops = function(item)
|
||||
table.insert(farming.scythe_not_drops, item)
|
||||
end
|
||||
|
||||
minetest.register_tool("farming:scythe", {
|
||||
description = "Scythe (Use to harvest and replant crops)",
|
||||
inventory_image = "farming_scythe.png",
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
on_use = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
end
|
||||
local pos = pointed_thing.under
|
||||
local name = placer:get_player_name()
|
||||
if minetest.is_protected(pos, name) then
|
||||
return
|
||||
end
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
if not node then
|
||||
return
|
||||
end
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if not def then
|
||||
return
|
||||
end
|
||||
if not def.drop then
|
||||
return
|
||||
end
|
||||
if not def.groups
|
||||
or not def.groups.plant then
|
||||
return
|
||||
end
|
||||
local drops = minetest.get_node_drops(node.name, "")
|
||||
if not drops
|
||||
or #drops == 0
|
||||
or (#drops == 1 and drops[1] == "") then
|
||||
return
|
||||
end
|
||||
-- get crop name
|
||||
local mname = node.name:split(":")[1]
|
||||
local pname = node.name:split(":")[2]
|
||||
local sname = tonumber(pname:split("_")[2])
|
||||
pname = pname:split("_")[1]
|
||||
if not sname then
|
||||
return
|
||||
end
|
||||
-- add dropped items
|
||||
for _, dropped_item in pairs(drops) do
|
||||
-- dont drop items on this list
|
||||
for _, not_item in pairs(farming.scythe_not_drops) do
|
||||
if dropped_item == not_item then
|
||||
dropped_item = nil
|
||||
end
|
||||
end
|
||||
if dropped_item then
|
||||
local player_inv = placer:get_inventory()
|
||||
if player_inv:room_for_item('main', dropped_item) then
|
||||
player_inv:add_item('main', dropped_item)
|
||||
else
|
||||
local obj = minetest.add_item(pos, dropped_item)
|
||||
if obj then
|
||||
obj:set_velocity({
|
||||
x = math.random(-10, 10) / 9,
|
||||
y = 3,
|
||||
z = math.random(-10, 10) / 9,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Run script hook
|
||||
for _, callback in pairs(core.registered_on_dignodes) do
|
||||
callback(pos, node, placer)
|
||||
end
|
||||
-- play sound
|
||||
minetest.sound_play("default_grass_footstep", {pos = pos, gain = 1.0})
|
||||
local replace = mname .. ":" .. pname .. "_1"
|
||||
if minetest.registered_nodes[replace] then
|
||||
local p2 = minetest.registered_nodes[replace].place_param2 or 1
|
||||
minetest.set_node(pos, {name = replace, param2 = p2})
|
||||
else
|
||||
minetest.set_node(pos, {name = "air"})
|
||||
end
|
||||
if not farming.is_creative(name) then
|
||||
itemstack:add_wear(65535 / 450)
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -122,6 +122,23 @@ if ENABLE_FLOATERS then
|
|||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
||||
},
|
||||
custom_attack = function(self, p)
|
||||
local pos = self.object:get_pos()
|
||||
self.alligator_king = self.attack
|
||||
local new_pos = {x=pos.x, y=pos.y-.5, z=pos.z}
|
||||
local node = minetest.get_node(new_pos).name
|
||||
if minetest.get_item_group(node, 'water') > 0 then
|
||||
self.attack:setpos(new_pos)
|
||||
self.attack:set_physics_override({gravity=3, speed=.2})
|
||||
self.object:setpos(new_pos)
|
||||
end
|
||||
return true
|
||||
end,
|
||||
on_die = function(self, pos)
|
||||
if self.alligator_king then
|
||||
armor:set_player_armor(self.alligator_king)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
mobs:spawn({
|
||||
|
@ -151,19 +168,19 @@ if ENABLE_SWIMMERS then
|
|||
damage = 8,
|
||||
damage_max = 12,
|
||||
damage_chance = 80,
|
||||
reach = 1,
|
||||
reach = 2,
|
||||
hp_min = 20,
|
||||
hp_max = 25,
|
||||
armor = 50,
|
||||
collisionbox = {-0.425, -0.15, -0.425, 0.425, 0.5, 0.425},
|
||||
collisionbox = {-0.638, -0.23, -0.638, 0.638, .5, 0.638},
|
||||
drawtype = "front",
|
||||
visual = "mesh",
|
||||
mesh = l_model,
|
||||
textures = l_skins,
|
||||
visual_size = {x = 2, y = 2},
|
||||
visual_size = {x = 3, y = 3},
|
||||
sounds = l_sounds,
|
||||
fly = true,
|
||||
fly_in = "default:water_source",
|
||||
fly_in = "group:water",
|
||||
fall_speed = -1,
|
||||
floats = 0,
|
||||
view_range = 10,
|
||||
|
@ -175,6 +192,22 @@ if ENABLE_SWIMMERS then
|
|||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
||||
},
|
||||
custom_attack = function(self, p)
|
||||
local pos = self.object:get_pos()
|
||||
local new_pos = {x=pos.x, y=pos.y-.5, z=pos.z}
|
||||
local node = minetest.get_node(new_pos).name
|
||||
if minetest.get_item_group(node, 'water') > 0 then
|
||||
self.attack:setpos(new_pos)
|
||||
self.attack:set_physics_override({gravity=3, speed=.2})
|
||||
self.object:setpos(new_pos)
|
||||
end
|
||||
return true
|
||||
end,
|
||||
on_die = function(self, pos)
|
||||
if self.attack then
|
||||
armor:set_player_armor(self.attack)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
mobs:spawn({
|
||||
|
|
|
@ -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())
|
||||
|
||||
sickles = { }
|
||||
sickles.i18n = minetest.get_translator("sickles")
|
||||
|
||||
dofile(modpath .. "/lib/api.lua")
|
||||
dofile(modpath .. "/lib/tools.lua")
|
|
@ -0,0 +1,174 @@
|
|||
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
|
||||
|
||||
local function is_creative(playername)
|
||||
return minetest.settings:get_bool("creative_mode")
|
||||
or minetest.check_player_privs(playername, { creative = true })
|
||||
end
|
||||
|
||||
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)
|
||||
if not is_creative(pname) then
|
||||
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
|
||||
})
|
||||
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
|
||||
if not is_creative(playername) then
|
||||
invref:remove_item("main", seeds)
|
||||
end
|
||||
if is_farming_redo then
|
||||
-- plant first crop for farming redo
|
||||
local crop_name = node_id .. "_1"
|
||||
local crop_def = minetest.registered_nodes[crop_name]
|
||||
if crop_def == nil then return end
|
||||
minetest.set_node(pos, { name = crop_name, param2 = crop_def.place_param2 })
|
||||
else
|
||||
-- plant seeds for MTG farming
|
||||
minetest.set_node(pos, { name = seeds, param2 = 1 })
|
||||
-- timer values taken from farming mod (see tick function in api.lua)
|
||||
minetest.get_node_timer(pos):start(math.random(166, 286))
|
||||
end
|
||||
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,34 @@
|
|||
local is_farming_redo = minetest.get_modpath("farming") ~= nil
|
||||
and farming ~= nil and farming.mod == "redo"
|
||||
|
||||
local S = sickles.i18n
|
||||
|
||||
minetest.register_alias('farming:scythe', 'sickles:scythe_titanium')
|
||||
|
||||
minetest.register_tool("sickles:scythe_titanium", {
|
||||
description = "Titanium Scythe",
|
||||
inventory_image = "sickles_scythe_titanium.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 1.2,
|
||||
damage_groups = { fleshy = 5 },
|
||||
punch_attack_uses = 160
|
||||
},
|
||||
range = 8,
|
||||
on_use = sickles.use_scythe,
|
||||
groups = { scythe = 2, scythe_uses = 25 },
|
||||
sound = { breaks = "default_tool_breaks" }
|
||||
})
|
||||
|
||||
minetest.register_tool("sickles:scythe_rose", {
|
||||
description = "Rose Thennium Scythe",
|
||||
inventory_image = "sickles_scythe_rose.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 1.2,
|
||||
damage_groups = { fleshy = 5 },
|
||||
punch_attack_uses = 180
|
||||
},
|
||||
range = 10,
|
||||
on_use = sickles.use_scythe,
|
||||
groups = { scythe = 3, scythe_uses = 30 },
|
||||
sound = { breaks = "default_tool_breaks" }
|
||||
})
|
|
@ -0,0 +1,23 @@
|
|||
# textdomain:sickles
|
||||
Bronze Sickle=Bronzesichel
|
||||
Steel Sickle=Stahlsichel
|
||||
Golden Sickle=Goldene Sichel
|
||||
Bronze Scythe=Bronzesense
|
||||
Steel Scythe=Stahlsense
|
||||
Moss=Moss
|
||||
Purple Moss=Violettes Moss
|
||||
Blue Moss=Blaues Moss
|
||||
Yellow Moss=Gelbes Moss
|
||||
Moss Block=Moss-Block
|
||||
Purple Moss Block=Violetter Moss-Block
|
||||
Blue Moss Block=Blauer Moss-Block
|
||||
Yellow Moss Block=Gelber Moss-Block
|
||||
Moss Stair=Moss-Treppe
|
||||
Purple Moss Stair=Violette Moss-Treppe
|
||||
Blue Moss Stair=Blaue Moss-Treppe
|
||||
Yellow Moss Stair=Gelbe Moss-Treppe
|
||||
Moss Slab=Moss-Stufe
|
||||
Purple Moss Slab=Violette Moss-Stufe
|
||||
Blue Moss Slab=Blaue Moss-Stufe
|
||||
Yellow Moss Slab=Gelbe Moss-Stufe
|
||||
Flower Petals=Blüten
|
|
@ -0,0 +1,23 @@
|
|||
# textdomain:sickles
|
||||
Bronze Sickle=
|
||||
Steel Sickle=
|
||||
Golden Sickle=
|
||||
Bronze Scythe=
|
||||
Steel Scythe=
|
||||
Moss=
|
||||
Purple Moss=
|
||||
Blue Moss=
|
||||
Yellow Moss=
|
||||
Moss Block=
|
||||
Purple Moss Block=
|
||||
Blue Moss Block=
|
||||
Yellow Moss Block=
|
||||
Moss Stair=
|
||||
Purple Moss Stair=
|
||||
Blue Moss Stair=
|
||||
Yellow Moss Stair=
|
||||
Moss Slab=
|
||||
Purple Moss Slab=
|
||||
Blue Moss Slab=
|
||||
Yellow Moss Slab=
|
||||
Flower Petals=
|
|
@ -0,0 +1,14 @@
|
|||
name = sickles
|
||||
title = Scythes & Sickles
|
||||
author = TestificateMods
|
||||
release = 10301
|
||||
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, gloopblocks
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
|
@ -62,7 +62,7 @@ minetest.register_on_joinplayer(function(player)
|
|||
player:set_breath(40)
|
||||
if has_interact(player) then
|
||||
local player_name = player:get_player_name()
|
||||
minetest.chat_send_player(player_name, 'Read the rules for information on how to get interact. Para español visite https://www.nathansalapat.com/server/epic-server_es')
|
||||
minetest.chat_send_player(player_name, 'Read the rules for information on how to get interact.')
|
||||
minetest.show_formspec(player_name, 'rules', spawn_rules_formspec)
|
||||
sounds.random_player()
|
||||
else
|
||||
|
|
|
@ -1,4 +1,16 @@
|
|||
local news = {
|
||||
'12/11/20',
|
||||
'Added the sickles mod, which improves the performace of the titanium scythe, and added a Rose Thennium scythe.',
|
||||
'',
|
||||
'12/5/20',
|
||||
'Fixed the tunneltest tunnelers so they work on hard stone.',
|
||||
'',
|
||||
'11/29/20',
|
||||
'Tunneltest tunnelers can be repaired with an anvil.',
|
||||
'',
|
||||
'11/27/20',
|
||||
'Tweaked the crocodile attack.',
|
||||
'',
|
||||
'11/24/20',
|
||||
'Added the tunneltest mod.',
|
||||
'',
|
||||
|
|
|
@ -16,6 +16,7 @@ local tool_repair ={
|
|||
{'epic:pick_glowingdiamond', 'epic:glowingdiamond'},
|
||||
{'epic:shovel_glowingdiamond', 'epic:glowingdiamond'},
|
||||
{'epic:sword_glowingdiamond', 'epic:glowingdiamond'},
|
||||
{'sickles:scythe_rose', 'epic:thennium'},
|
||||
}
|
||||
|
||||
for i in ipairs (tool_repair) do
|
||||
|
|
|
@ -41,7 +41,7 @@ local tool_repair ={
|
|||
{'epic:leggings_titanium', 'epic:titanium_ingot'},
|
||||
{'epic:shield_titanium', 'epic:titanium_ingot'},
|
||||
{'epic:shovel_soft', 'default:tin_ingot'},
|
||||
{'farming:scythe', 'epic:titanium_ingot'},
|
||||
{'sickles:scythe_titanium', 'epic:titanium_ingot'},
|
||||
{'torch_bomb:torch_crossbow_steel', 'default:steel_ingot'},
|
||||
{'torch_bomb:torch_crossbow_bronze', 'default:bronze_ingot'}
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ stations.dual_register_recipe('anvil', {
|
|||
['epic:titanium_ingot'] = 2,
|
||||
['group:stick'] = 1,
|
||||
},
|
||||
output = 'farming:scythe',
|
||||
output = 'sickles:scythe_titanium',
|
||||
})
|
||||
|
||||
stations.dual_register_recipe('anvil', {
|
||||
|
|
|
@ -151,3 +151,12 @@ stations.dual_register_recipe('crystal_w', {
|
|||
},
|
||||
output = 'epic:glowingdiamond',
|
||||
})
|
||||
|
||||
stations.dual_register_recipe('crystal_w', {
|
||||
input = {
|
||||
['stations:chitin'] = 1,
|
||||
['epic:thennium'] = 2,
|
||||
['group:stick'] = 1,
|
||||
},
|
||||
output = 'sickles:scythe_rose'
|
||||
})
|
||||
|
|
|
@ -24,14 +24,15 @@ return( {
|
|||
crumbly = {times={[1]=3.00, [2]=1.60, [3]=0.60}, uses=20, maxlevel=2}
|
||||
}
|
||||
},
|
||||
_repair_material = "default:bronzeblock",
|
||||
--maximal area of effect
|
||||
_N = 3,
|
||||
_M = 3
|
||||
},
|
||||
--recipe for crafting
|
||||
recipe = {
|
||||
{ "default:bronze_ingot", "default:bronze_ingot", "default:bronze_ingot" },
|
||||
{ "default:bronze_ingot", "darkage:iron_stick", "" },
|
||||
{ "default:bronzeblock", "default:bronzeblock", "default:bronzeblock" },
|
||||
{ "default:bronzeblock", "darkage:iron_stick", "" },
|
||||
{ "", "darkage:iron_stick", "" }
|
||||
},
|
||||
},
|
||||
|
@ -48,6 +49,7 @@ return( {
|
|||
crumbly = {times={[1]=3.00, [2]=1.60, [3]=0.60}, uses=50, maxlevel=2}
|
||||
}
|
||||
},
|
||||
_repair_material = "default:diamondblock",
|
||||
_N = 5,
|
||||
_M = 5
|
||||
},
|
||||
|
@ -66,10 +68,11 @@ return( {
|
|||
max_drop_level=3,
|
||||
full_punch_interval = 10,
|
||||
groupcaps= {
|
||||
cracky = {times={[1]=4.00, [2]=2.0, [3]=1.0}, uses=100, maxlevel=3},
|
||||
crumbly = {times={[1]=4.00, [2]=2.0, [3]=1.0}, uses=100, maxlevel=3}
|
||||
cracky = {times={[1]=4.00, [2]=2.0, [3]=1.0}, uses=100, maxlevel=4},
|
||||
crumbly = {times={[1]=4.00, [2]=2.0, [3]=1.0}, uses=100, maxlevel=4}
|
||||
}
|
||||
},
|
||||
_repair_material = "default:titanium_block",
|
||||
_N = 7,
|
||||
_M = 9
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue