diff --git a/README.md b/README.md
index 95a8b47..ca8b7ec 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Plantas diversas para Minetest
## Requisitos
* Minetest 0.4.15 ou superior
-* Mod farming
+* Mod Farming Redo (TenPlus)
## Licença
Veja LICENSE.txt para informações detalhadas da licença LGPL 3.0
diff --git a/compatibilidade.lua b/compatibilidade.lua
new file mode 100644
index 0000000..3f0d716
--- /dev/null
+++ b/compatibilidade.lua
@@ -0,0 +1,32 @@
+--[[
+ Mod MacroPlantas para Minetest
+ Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine)
+
+ Recebeste uma cópia da GNU Lesser General
+ Public License junto com esse software,
+ se não, veja em .
+
+ Compatibilização com versões anteriores
+ ]]
+
+-- LBM para remover nodes obsoletos
+minetest.register_lbm({
+ name = "macroplantas:update",
+ nodenames = {
+ "macroplantas:node_melancia",
+ "macroplantas:melancia_1",
+ "macroplantas:melancia_2",
+ "macroplantas:melancia_3",
+ "macroplantas:melancia_4",
+ "macroplantas:arbusto_uva",
+ },
+ action = function(pos, node)
+ minetest.remove_node(pos)
+ end,
+})
+
+-- Aliases para itens do farming do tenplus
+minetest.register_alias("macroplantas:uva", "farming:grapes")
+minetest.register_alias("macroplantas:pedaco_melancia", "farming:melon_slice")
+minetest.register_alias("macroplantas:melancia", "farming:melon_slice")
+minetest.register_alias("macroplantas:seed_melancia", "farming:melon_slice")
diff --git a/description.txt b/description.txt
index 3081e25..aa84b0b 100644
--- a/description.txt
+++ b/description.txt
@@ -1 +1 @@
-Plantas diversas
+Plantas diversas estilizadas
diff --git a/diretrizes.lua b/diretrizes.lua
deleted file mode 100644
index 2e97ca8..0000000
--- a/diretrizes.lua
+++ /dev/null
@@ -1,12 +0,0 @@
---[[
- Mod MacroPlantas para Minetest
- Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine)
-
- Recebeste uma cópia da GNU Lesser General
- Public License junto com esse software,
- se não, veja em .
-
- Diretrizes
- ]]
-
-
diff --git a/farming.lua b/farming.lua
new file mode 100644
index 0000000..dd09d42
--- /dev/null
+++ b/farming.lua
@@ -0,0 +1,83 @@
+--[[
+ Mod MacroPlantas para Minetest
+ Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine)
+
+ Recebeste uma cópia da GNU Lesser General
+ Public License junto com esse software,
+ se não, veja em .
+
+ Mudanças nas plantas de farming
+ ]]
+
+
+-- Mudança no potencial alimenticio
+local tb_alimenticios = {
+ ["farming:bread"] = {3},
+ ["farming:carrot"] = {2},
+ ["farming:carrot_gold"] = {6},
+ ["farming:potato"] = {2},
+ ["farming:baked_potato"] = {2},
+ ["farming:pumpkin_slice"] = {1},
+ ["farming:pumpkin_bread"] = {3},
+ ["farming:raspberries"] = {1},
+ ["farming:smoothie_raspberry"] = {2, "vessels:drinking_glass"},
+ ["farming:beans"] = {1},
+ ["farming:blueberries"] = {1},
+ ["farming:muffin_blueberry"] = {3},
+ ["farming:corn"] = {1},
+ ["farming:corn_cob"] = {2},
+ ["farming:cookie"] = {1},
+ ["farming:chocolate_dark"] = {3},
+ ["farming:coffee_cup"] = {1, "farming:drinking_cup"},
+ ["farming:coffee_cup_hot"] = {2, "farming:drinking_cup"},
+ ["farming:cucumber"] = {2},
+ ["farming:donut"] = {3},
+ ["farming:donut_chocolate"] = {6},
+ ["farming:donut_apple"] = {4},
+ ["farming:grapes"] = {2},
+ ["farming:melon_slice"] = {1},
+ ["farming:rhubarb"] = {1},
+ ["farming:rhubarb_pie"] = {6},
+ ["farming:sugar"] = {1},
+}
+
+for nome,valor in pairs(tb_alimenticios) do
+ minetest.override_item(nome, {on_use = minetest.item_eat(valor[1], valor[2])})
+end
+
+-- Remoção de algumas receitas para desativar
+minetest.clear_craft({output = 'farming:carrot_gold'}) -- Cenoura Dourada
+
+-- Alteração de algumas receitas
+
+-- Cookie (Biscoito)
+minetest.clear_craft({output = 'farming:cookie'})
+minetest.register_craft( {
+ output = "farming:cookie 3",
+ recipe = {
+ { "farming:wheat", "farming:cocoa_beans", "farming:wheat" },
+ }
+})
+
+-- Muffin de Mirtilo
+minetest.clear_craft({output = 'farming:muffin_blueberry'})
+minetest.register_craft({
+ output = "farming:muffin_blueberry 2",
+ recipe = {
+ {"", "farming:blueberries", ""},
+ {"farming:blueberries", "farming:bread", "farming:blueberries"},
+ }
+})
+
+-- Açucar
+minetest.clear_craft({output = 'farming:sugar'})
+minetest.register_craft({
+ type = "cooking",
+ cooktime = 3,
+ output = "farming:sugar",
+ recipe = "default:papyrus",
+})
+
+minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing)
+ minetest.chat_send_all(hp_change)
+end)
diff --git a/init.lua b/init.lua
index f6b4a31..eee6737 100644
--- a/init.lua
+++ b/init.lua
@@ -9,9 +9,6 @@
Inicializador de scripts
]]
--- Habilitar Plantas (true = habilitado | false = desabilitado)
-local MELANCIA = true
-local UVA = true
-- Notificador de Inicializador
local notificar = function(msg)
@@ -20,18 +17,18 @@ local notificar = function(msg)
end
end
-local modpath = minetest.get_modpath("macroplantas")
+-- Verifica se mod Farming Redo (TenPlus) está ativo
+if not minetest.registered_craftitems["farming:melon_slice"]
+ or not minetest.registered_craftitems["farming:grapes"]
+then
+ minetest.log("error", "[MacroPlantas] Exigido melon e grapes do mod farming Redo (TenPlus)")
+ return
+end
--- Variavel global das funcionalidades
-macroplantas = {}
+local modpath = minetest.get_modpath("macroplantas")
-- Carregar scripts
notificar("Carregando...")
-dofile(modpath.."/diretrizes.lua")
-if MELANCIA == true then
- dofile(modpath.."/melancia.lua")
-end
-if UVA == true then
- dofile(modpath.."/uva.lua")
-end
+dofile(modpath.."/farming.lua")
+dofile(modpath.."/compatibilidade.lua")
notificar("OK")
diff --git a/melancia.lua b/melancia.lua
deleted file mode 100644
index 553fc34..0000000
--- a/melancia.lua
+++ /dev/null
@@ -1,81 +0,0 @@
---[[
- Mod MacroPlantas para Minetest
- Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine)
-
- Recebeste uma cópia da GNU Lesser General
- Public License junto com esse software,
- se não, veja em .
-
- Melancia
- ]]
-
--- MELANCIA
-farming.register_plant("macroplantas:melancia", {
- description = "Semente de Melancia",
- inventory_image = "macroplantas_melancia_seed.png",
- drop = '',
- steps = 4,
- minlight = 13,
- maxlight = default.LIGHT_MAX,
- fertility = {"grassland"}
-})
-
-minetest.register_craftitem("macroplantas:pedaco_melancia", {
- description = "Melancia",
- inventory_image = "macroplantas_melancia.png",
- stack_max = 10,
- on_use = minetest.item_eat(1),
-})
-
--- Colocar sementes nas gramas junto com as outras sementes
-do
- local drop = minetest.deserialize(minetest.serialize(minetest.registered_nodes["default:grass_1"].drop))
- table.insert(drop.items, {items={'macroplantas:seed_melancia'}, rarity = 8})
- for i = 1, 5 do
- minetest.override_item("default:grass_"..i, {drop = drop})
- end
-end
-
--- Bloco de Melancia para colheita
-minetest.register_node("macroplantas:node_melancia", {
- description = "Node Melancia",
- drawtype = "nodebox",
- paramtype = "light",
- tiles = {
- "macroplantas_melancia_listrado.png", -- Cima
- "macroplantas_melancia_listrado.png", -- Baixo
- "macroplantas_melancia_tampa.png", -- Lado direito
- "macroplantas_melancia_tampa.png", -- Lado esquerda
- "macroplantas_melancia_listrado.png", -- Fundo
- "macroplantas_melancia_listrado.png", -- Frente
- },
- node_box = {
- type = "fixed",
- fixed = {
- {-0.440625, -0.5, -0.440625, 0.440625, 0.437500, 0.440625}, -- Melancia
- }
- },
- groups = {crumbly=3,attached_node=1},
- drop = '',
-})
-
-minetest.override_item("macroplantas:node_melancia", {drop = {
- max_items = 3,
- items = {
- {items = {'macroplantas:seed_melancia'}},
- {items = {'macroplantas:pedaco_melancia'}},
- {items = {'macroplantas:pedaco_melancia'}},
- {items = {'macroplantas:pedaco_melancia'}},
- {items = {'macroplantas:pedaco_melancia'}},
- {items = {'macroplantas:pedaco_melancia'},rarity = 5},
- }
-}})
-
-minetest.register_abm({
- nodenames = {"macroplantas:melancia_4"},
- interval = 10,
- chance = 50,
- action = function(pos)
- minetest.set_node(pos, {name = "macroplantas:node_melancia"})
- end
-})
diff --git a/textures/macroplantas_arbusto_uva.png b/texturas extras/macroplantas_arbusto_uva.png
similarity index 100%
rename from textures/macroplantas_arbusto_uva.png
rename to texturas extras/macroplantas_arbusto_uva.png
diff --git a/textures/macroplantas_melancia.png b/texturas extras/macroplantas_melancia.png
similarity index 100%
rename from textures/macroplantas_melancia.png
rename to texturas extras/macroplantas_melancia.png
diff --git a/textures/macroplantas_melancia_1.png b/texturas extras/macroplantas_melancia_1.png
similarity index 100%
rename from textures/macroplantas_melancia_1.png
rename to texturas extras/macroplantas_melancia_1.png
diff --git a/textures/macroplantas_melancia_2.png b/texturas extras/macroplantas_melancia_2.png
similarity index 100%
rename from textures/macroplantas_melancia_2.png
rename to texturas extras/macroplantas_melancia_2.png
diff --git a/textures/macroplantas_melancia_3.png b/texturas extras/macroplantas_melancia_3.png
similarity index 100%
rename from textures/macroplantas_melancia_3.png
rename to texturas extras/macroplantas_melancia_3.png
diff --git a/textures/macroplantas_melancia_4.png b/texturas extras/macroplantas_melancia_4.png
similarity index 100%
rename from textures/macroplantas_melancia_4.png
rename to texturas extras/macroplantas_melancia_4.png
diff --git a/textures/macroplantas_melancia_listrado.png b/texturas extras/macroplantas_melancia_listrado.png
similarity index 100%
rename from textures/macroplantas_melancia_listrado.png
rename to texturas extras/macroplantas_melancia_listrado.png
diff --git a/textures/macroplantas_melancia_seed.png b/texturas extras/macroplantas_melancia_seed.png
similarity index 100%
rename from textures/macroplantas_melancia_seed.png
rename to texturas extras/macroplantas_melancia_seed.png
diff --git a/textures/macroplantas_melancia_tampa.png b/texturas extras/macroplantas_melancia_tampa.png
similarity index 100%
rename from textures/macroplantas_melancia_tampa.png
rename to texturas extras/macroplantas_melancia_tampa.png
diff --git a/textures/macroplantas_uva.png b/texturas extras/macroplantas_uva.png
similarity index 100%
rename from textures/macroplantas_uva.png
rename to texturas extras/macroplantas_uva.png
diff --git a/uva.lua b/uva.lua
deleted file mode 100644
index 457a5a4..0000000
--- a/uva.lua
+++ /dev/null
@@ -1,58 +0,0 @@
---[[
- Mod MacroPlantas para Minetest
- Copyright (C) 2017 BrunoMine (https://github.com/BrunoMine)
-
- Recebeste uma cópia da GNU Lesser General
- Public License junto com esse software,
- se não, veja em .
-
- Uva
- ]]
-
--- Cacho de Uva
-minetest.register_craftitem("macroplantas:uva", {
- description = "Cacho de Uvas",
- inventory_image = "macroplantas_uva.png",
- stack_max = 25,
- on_use = minetest.item_eat(1),
-})
-
--- Arbusto da Uva
-minetest.register_node("macroplantas:arbusto_uva", {
- description = "Arbusto com Uvas",
- drawtype = "plantlike",
- waving = 1,
- visual_scale = 1.3,
- tiles = {"macroplantas_arbusto_uva.png"},
- paramtype = "light",
- sunlight_propagates = true,
- walkable = false,
- buildable_to = true,
- groups = {snappy=3,flammable=2,flora=1,attached_node=1},
- sounds = default.node_sound_leaves_defaults(),
- drop = "macroplantas:uva",
- selection_box = {
- type = "fixed",
- fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
- },
-})
-
--- Registrando arbusto na Mapgen v6
-minetest.register_decoration({
- deco_type = "simple",
- place_on = {"default:dirt_with_grass"},
- sidelen = 5,
- noise_params = {
- offset = -1,
- scale = 1.1,
- spread = {x = 10, y = 10, z = 10},
- seed = 231513,
- octaves = 1,
- persist = 2
- },
- y_min = 10,
- y_max = 31000,
- decoration = "macroplantas:arbusto_uva",
-})
-
-