added unified inventory support for barrel recipes

master
tenplus1 2020-03-29 10:04:09 +01:00
parent 8e4b3e0b5f
commit 68041822d3
3 changed files with 34 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Change log:
- 0.9 - Added Glass of Rum and Bottle of Rum thanks to acm :) Added {alcohol=1} groups
- 1.0 - Added glass and bottle or Bourbon made by fermenting corn
- 1.1 - Added glass and bottle of Vodka made by fermenting baked potato, Added MineClone2 support and spanish translation
- 1.2 - Added Unified Inventory support for barrel recipes (thanks to realmicu)
Lucky Blocks: 13

View File

@ -7,3 +7,4 @@ mcl_core?
mcl_sounds?
mcl_loot?
doc?
unified_inventory?

View File

@ -18,6 +18,8 @@ if mcl then
wine.sand = "mcl_core:sand"
end
-- check for Unified Inventory
local is_uninv = minetest.global_exists("unified_inventory") or false
-- Intllib
local S
@ -41,6 +43,17 @@ else
end
-- Unified Inventory hints
if is_uninv then
unified_inventory.register_craft_type("barrel", {
description = "Barrel",
icon = 'wine_barrel.png',
width = 1,
height = 1,
})
end
local ferment = {
{"farming:grapes", "wine:glass_wine"},
{"farming:barley", "wine:glass_beer"},
@ -59,10 +72,29 @@ if mcl then
ferment[5] = {"mcl_core:paper", "wine:glass_rum"}
end
if is_uninv then
for _, f in pairs(ferment) do
unified_inventory.register_craft({
type = "barrel",
items = { f[1] },
output = f[2],
})
end
end
function wine:add_item(list)
for n = 1, #list do
table.insert(ferment, list[n])
if is_uninv then
unified_inventory.register_craft({
type = "barrel",
items = { list[n][1] },
output = list[n][2],
})
end
end
end