mirror of
https://github.com/Sokomine/cottages.git
synced 2026-01-11 11:35:46 +01:00
added threshing floor receipes to unified_inventory
This commit is contained in:
3
init.lua
3
init.lua
@@ -101,6 +101,9 @@ dofile(minetest.get_modpath("cottages").."/nodes_mining.lua");
|
||||
dofile(minetest.get_modpath("cottages").."/nodes_water.lua");
|
||||
--dofile(minetest.get_modpath("cottages").."/nodes_chests.lua");
|
||||
|
||||
-- add receipes for threshing floor and handmill to unified_inventory
|
||||
dofile(minetest.get_modpath("cottages").."/unified_inventory_receipes.lua");
|
||||
|
||||
-- this is only required and useful if you run versions of the random_buildings mod where the nodes where defined inside that mod
|
||||
dofile(minetest.get_modpath("cottages").."/alias.lua");
|
||||
|
||||
|
||||
2
mod.conf
2
mod.conf
@@ -1,5 +1,5 @@
|
||||
name = cottages
|
||||
description = Contains a lot of blocks that fit to medieval settlements and small cottages. Comes with hammer & anvil to repair tools. Threshing floor and handmill help process grains etc.
|
||||
optional_depends = default, farming, stairs, homedecor, intllib, trees, wool, moreblocks
|
||||
optional_depends = default, farming, stairs, homedecor, intllib, trees, wool, moreblocks, unified_inventory
|
||||
author = Sokomine
|
||||
title = Blocks for building cottages.
|
||||
|
||||
28
unified_inventory_receipes.lua
Normal file
28
unified_inventory_receipes.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
-- unified_inventory integration
|
||||
if (minetest.get_modpath("unified_inventory") == nil) then
|
||||
return
|
||||
end
|
||||
|
||||
-- for threshing floor and handmill
|
||||
|
||||
assert((type(unified_inventory.register_craft_type) == "function"),
|
||||
"register_craft_type does not exist in unified_inventory")
|
||||
assert((type(unified_inventory.register_craft) == "function"),
|
||||
"register_craft does not exist in unified_inventory")
|
||||
|
||||
|
||||
unified_inventory.register_craft_type("cottages_threshing_floor", {
|
||||
description = "Threshing",
|
||||
icon = "cottages_junglewood.png^farming_wheat.png",
|
||||
width = 1,
|
||||
height = 1,
|
||||
uses_crafting_grid = false
|
||||
})
|
||||
|
||||
for crop_name, seed_name in pairs(cottages.threshing_floor_receipes) do
|
||||
unified_inventory.register_craft({
|
||||
output = seed_name,
|
||||
type = "cottages_threshing_floor",
|
||||
items = {crop_name}
|
||||
})
|
||||
end
|
||||
Reference in New Issue
Block a user