Migração para farming redo (TenPlus)

master
BrunoMine 2017-08-14 12:29:18 -03:00
parent 48735bc600
commit ea12813f61
18 changed files with 127 additions and 166 deletions

View File

@ -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

32
compatibilidade.lua Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
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")

View File

@ -1 +1 @@
Plantas diversas
Plantas diversas estilizadas

View File

@ -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 <http://www.gnu.org/licenses/>.
Diretrizes
]]

83
farming.lua Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
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)

View File

@ -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")

View File

@ -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 <http://www.gnu.org/licenses/>.
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
})

View File

Before

Width:  |  Height:  |  Size: 883 B

After

Width:  |  Height:  |  Size: 883 B

View File

Before

Width:  |  Height:  |  Size: 603 B

After

Width:  |  Height:  |  Size: 603 B

View File

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

View File

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

View File

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 405 B

View File

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

View File

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 591 B

View File

Before

Width:  |  Height:  |  Size: 439 B

After

Width:  |  Height:  |  Size: 439 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 523 B

58
uva.lua
View File

@ -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 <http://www.gnu.org/licenses/>.
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",
})