Update maidroid core morefarming

Remove the maidroid jump ability
Add last crops from farming_redo
This commit is contained in:
sys4-fr 2018-07-23 19:29:17 +02:00
parent e50862606e
commit 1eac844554
2 changed files with 40 additions and 16 deletions

View File

@ -317,6 +317,11 @@ if minetest.get_modpath("maidroid_core") then
end end
if redo then if redo then
if minetest.registered_items["farming:hemp_leaf"] then
-- Bugfix farming redo
minetest.override_item("farming:hemp_leaf", { groups = {seed = 0 } })
end
local redo_plants = { local redo_plants = {
"farming:seed_barley", "farming:seed_barley",
"farming:blueberries", "farming:blueberries",
@ -330,6 +335,14 @@ if minetest.get_modpath("maidroid_core") then
"farming:raspberries", "farming:raspberries",
"farming:rhubarb", "farming:rhubarb",
"farming:tomato", "farming:tomato",
"farming:beetroot",
"farming:chili_pepper",
"farming:garlic_clove",
"farming:seed_hemp",
"farming:onion",
"farming:pea_pod",
"farming:peppercorn",
"farming:pineapple_top",
} }
for _, item in pairs(redo_plants) do for _, item in pairs(redo_plants) do

View File

@ -29,6 +29,7 @@ local seed_plants = {}
if redo then if redo then
local redo_plants = { local redo_plants = {
--{"farming:barley_7", "farming:seed_barley", "farming:barley"},
{"farming:barley_7", nil}, {"farming:barley_7", nil},
{"farming:blueberry_4", "farming:blueberries", "farming:blueberry"}, {"farming:blueberry_4", "farming:blueberries", "farming:blueberry"},
{"farming:carrot_8", nil}, {"farming:carrot_8", nil},
@ -40,7 +41,15 @@ if redo then
{"farming:pumpkin_8", "farming:pumpkin_slice", "farming:pumpkin"}, {"farming:pumpkin_8", "farming:pumpkin_slice", "farming:pumpkin"},
{"farming:raspberry_4", "farming:raspberries", "farming:raspberry"}, {"farming:raspberry_4", "farming:raspberries", "farming:raspberry"},
{"farming:rhubarb_3", nil}, {"farming:rhubarb_3", nil},
{"farming:tomato_8", nil} {"farming:tomato_8", nil},
{"farming:beetroot_5", nil},
{"farming:chili_8", "farming:chili_pepper", "farming:chili"},
{"farming:garlic_5","farming:garlic_clove", "farming:garlic"},
{"farming:hemp_8", nil}, --"farming:seed_hemp", "farming:hemp"},
{"farming:onion_5", nil},
{"farming:pea_5", "farming:pea_pod", "farming:pea"},
{"farming:pepper_5", "farming:peppercorn", "farming:pepper"},
{"farming:pineapple_8", "farming:pineapple_top", "farming:pineapple"},
} }
for _, item in pairs(redo_plants) do for _, item in pairs(redo_plants) do
table.insert(target_plants, item[1]) table.insert(target_plants, item[1])
@ -177,11 +186,13 @@ walk_randomly = function(self, dtime)
if velocity.y == 0 then if velocity.y == 0 then
local front_node = self:get_front_node() local front_node = self:get_front_node()
if minetest.get_item_group(front_node.name, "fence") > 0 then if minetest.get_item_group(front_node.name, "fence") > 0
or (front_node.name ~= "air" and minetest.registered_nodes[front_node.name] ~= nil and minetest.registered_nodes[front_node.name].walkable) then
self:change_direction_randomly() self:change_direction_randomly()
elseif front_node.name ~= "air" and minetest.registered_nodes[front_node.name] ~= nil
and minetest.registered_nodes[front_node.name].walkable then -- elseif front_node.name ~= "air" and minetest.registered_nodes[front_node.name] ~= nil
self.object:setvelocity{x = velocity.x, y = 6, z = velocity.z} -- and minetest.registered_nodes[front_node.name].walkable then
-- self.object:setvelocity{x = velocity.x, y = 6, z = velocity.z}
end end
end end
return return
@ -285,17 +296,17 @@ walk_to_plant_and_mow_common = function(self, dtime)
self:change_direction(self.path[1]) self:change_direction(self.path[1])
end end
else -- else
-- if maidroid is stopped by obstacles, the maidroid must jump. -- -- if maidroid is stopped by obstacles, the maidroid must jump.
local velocity = self.object:getvelocity() -- local velocity = self.object:getvelocity()
if velocity.y == 0 then -- if velocity.y == 0 then
local front_node = self:get_front_node() -- local front_node = self:get_front_node()
if front_node.name ~= "air" and minetest.registered_nodes[front_node.name] ~= nil -- if front_node.name ~= "air" and minetest.registered_nodes[front_node.name] ~= nil
and minetest.registered_nodes[front_node.name].walkable -- and minetest.registered_nodes[front_node.name].walkable
and not (minetest.get_item_group(front_node.name, "fence") > 0) then -- 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:setvelocity{x = velocity.x, y = 6, z = velocity.z}
end -- end
end -- end
end end
end end