Compare commits

...

3 Commits

Author SHA1 Message Date
ebe3b70ae2 Delete depends.txt, add mod.conf 2022-07-08 19:02:38 +02:00
72dd1e83c0 Fix farming_redo support with ethanol 2021-06-27 14:14:51 +02:00
f815b53101 Replace deprecated methods 2021-04-04 16:54:49 +02:00
4 changed files with 25 additions and 40 deletions

View File

@ -1,6 +0,0 @@
moreflowers
farming
farming_plus?
maidroid_core?
bonemeal?
diet?

View File

@ -236,6 +236,7 @@ if not redo then
recipe = {
{ "vessels:glass_bottle", "vessels:glass_bottle", "morefarming:corn"},
{ "morefarming:corn", "morefarming:corn", "morefarming:corn"},
{ "morefarming:corn", "morefarming:corn", "morefarming:corn"},
}
})
@ -245,6 +246,7 @@ if not redo then
recipe = {
{ "vessels:glass_bottle", "morefarming:teosinte", "morefarming:teosinte"},
{ "morefarming:teosinte", "morefarming:teosinte", "morefarming:teosinte"},
{ "morefarming:teosinte", "morefarming:teosinte", "morefarming:teosinte"},
}
})
@ -274,29 +276,13 @@ if redo then
if minetest.get_modpath("vessels") then
-- Bottle of Ethanol
minetest.clear_craft(
{
recipe = {
{"vessels:glass_bottle", "farming:corn", "farming:corn"},
{"farming:corn", "farming:corn", "farming:corn"},
}
})
minetest.register_craft(
{
output = "farming:bottle_ethanol 2",
recipe = {
{ "vessels:glass_bottle", "vessels:glass_bottle", "farming:corn"},
{ "farming:corn", "farming:corn", "farming:corn"},
}
})
minetest.register_craft(
{
output = "farming:bottle_ethanol",
recipe = {
{ "vessels:glass_bottle", "morefarming:teosinte", "morefarming:teosinte"},
{ "morefarming:teosinte", "morefarming:teosinte", "morefarming:teosinte"},
{ "morefarming:teosinte", "morefarming:teosinte", "morefarming:teosinte"},
}
})
end

View File

@ -134,8 +134,8 @@ local walk_randomly, walk_to_plant_and_mow_common, plant, mow
local to_walk_randomly, to_walk_to_plant, to_walk_to_mow, to_plant, to_mow
local function on_start(self)
self.object:setacceleration{x = 0, y = -10, z = 0}
self.object:setvelocity{x = 0, y = 0, z = 0}
self.object:set_acceleration{x = 0, y = -10, z = 0}
self.object:set_velocity{x = 0, y = 0, z = 0}
self.state = state.WALK_RANDOMLY
self.time_counters = {}
self.path = nil
@ -143,7 +143,7 @@ local function on_start(self)
end
local function on_stop(self)
self.object:setvelocity{x = 0, y = 0, z = 0}
self.object:set_velocity{x = 0, y = 0, z = 0}
self.state = nil
self.time_counters = nil
self.path = nil
@ -151,7 +151,7 @@ local function on_stop(self)
end
local function is_near(self, pos, distance)
local p = self.object:getpos()
local p = self.object:get_pos()
-- p.y = p.y + 0.5
return vector.distance(p, pos) < distance
end
@ -166,9 +166,9 @@ walk_randomly = function(self, dtime)
local wield_stack = self:get_wield_item_stack()
if minetest.get_item_group(wield_stack:get_name(), "seed") > 0
or self:has_item_in_main(function(itemname) return (minetest.get_item_group(itemname, "seed") > 0) end) then
local destination = _aux.search_surrounding(self.object:getpos(), is_plantable_place, searching_range)
local destination = _aux.search_surrounding(self.object:get_pos(), is_plantable_place, searching_range)
if destination ~= nil then
local path = minetest.find_path(self.object:getpos(), destination, 10, 1, 1, "A*")
local path = minetest.find_path(self.object:get_pos(), destination, 10, 1, 1, "A*")
if path ~= nil then -- to walk to plant state.
to_walk_to_plant(self, path, destination)
@ -177,9 +177,9 @@ walk_randomly = function(self, dtime)
end
end
-- if couldn't find path to plant, try to mow.
local destination = _aux.search_surrounding(self.object:getpos(), is_mowable_place, searching_range)
local destination = _aux.search_surrounding(self.object:get_pos(), is_mowable_place, searching_range)
if destination ~= nil then
local path = minetest.find_path(self.object:getpos(), destination, 10, 1, 1, "A*")
local path = minetest.find_path(self.object:get_pos(), destination, 10, 1, 1, "A*")
if path ~= nil then -- to walk to mow state.
to_walk_to_mow(self, path, destination)
return
@ -197,7 +197,7 @@ walk_randomly = function(self, dtime)
self.time_counters[1] = self.time_counters[1] + 1
self.time_counters[2] = self.time_counters[2] + 1
local velocity = self.object:getvelocity()
local velocity = self.object:get_velocity()
if velocity.y == 0 then
local front_node = self:get_front_node()
@ -207,7 +207,7 @@ walk_randomly = function(self, dtime)
-- elseif front_node.name ~= "air" and minetest.registered_nodes[front_node.name] ~= nil
-- and minetest.registered_nodes[front_node.name].walkable then
-- self.object:setvelocity{x = velocity.x, y = 6, z = velocity.z}
-- self.object:set_velocity{x = velocity.x, y = 6, z = velocity.z}
end
end
return
@ -248,9 +248,9 @@ to_plant = function(self)
or self:move_main_to_wield(function(itemname) return (minetest.get_item_group(itemname, "seed") > 0) end) then
self.state = state.PLANT
self.time_counters[1] = 0
self.object:setvelocity{x = 0, y = 0, z = 0}
self.object:set_velocity{x = 0, y = 0, z = 0}
self:set_animation(maidroid.animation_frames.MINE)
self:set_yaw_by_direction(vector.subtract(self.destination, self.object:getpos()))
self:set_yaw_by_direction(vector.subtract(self.destination, self.object:get_pos()))
return
else
to_walk_randomly(self)
@ -261,9 +261,9 @@ end
to_mow = function(self)
self.state = state.MOW
self.time_counters[1] = 0
self.object:setvelocity{x = 0, y = 0, z = 0}
self.object:set_velocity{x = 0, y = 0, z = 0}
self:set_animation(maidroid.animation_frames.MINE)
self:set_yaw_by_direction(vector.subtract(self.destination, self.object:getpos()))
self:set_yaw_by_direction(vector.subtract(self.destination, self.object:get_pos()))
end
walk_to_plant_and_mow_common = function(self, dtime)
@ -287,7 +287,7 @@ walk_to_plant_and_mow_common = function(self, dtime)
if self.time_counters[1] >= FIND_PATH_TIME_INTERVAL then
self.time_counters[1] = 0
local path = minetest.find_path(self.object:getpos(), self.destination, 10, 1, 1, "A*")
local path = minetest.find_path(self.object:get_pos(), self.destination, 10, 1, 1, "A*")
if path == nil then
to_walk_randomly(self)
return
@ -313,13 +313,13 @@ walk_to_plant_and_mow_common = function(self, dtime)
-- else
-- -- if maidroid is stopped by obstacles, the maidroid must jump.
-- local velocity = self.object:getvelocity()
-- local velocity = self.object:get_velocity()
-- if velocity.y == 0 then
-- local front_node = self:get_front_node()
-- if front_node.name ~= "air" and minetest.registered_nodes[front_node.name] ~= nil
-- and minetest.registered_nodes[front_node.name].walkable
-- and not (minetest.get_item_group(front_node.name, "fence") > 0) then
-- self.object:setvelocity{x = velocity.x, y = 6, z = velocity.z}
-- self.object:set_velocity{x = velocity.x, y = 6, z = velocity.z}
-- end
-- end
end

5
mod.conf Normal file
View File

@ -0,0 +1,5 @@
name = morefarming
title = More Farming
description = This mod add more things to do farming, make it more realistic, more harder and make it compatible with maidroid core farming.
depends = moreflowers,farming
optional_depends = farming_plus,maidroid_core,bonemeal,diet