1
0
mirror of https://github.com/Sokomine/cottages.git synced 2026-01-11 03:26:23 +01:00

added handmill receipes to unified_inventory

This commit is contained in:
Sokomine
2025-09-06 20:37:25 +02:00
parent 29a32afc46
commit 63c2926519
4 changed files with 51 additions and 11 deletions

View File

@@ -125,14 +125,14 @@ Mill, powered by punching = Muehle, durch Schlagen antreiben
Mill, powered by punching (owned by %s) = Muehle, durch Schlagen antreiben (gehoert %s)
Public mill, powered by punching (owned by %s) = Öffentliche Muehle, durch Schlagen antreiben (gehoert %s)
Private mill, powered by punching (owned by %s) = Private Muehle, durch Schlagen antreiben (gehoert %s)
Wheat seeds: = Weizenkoerner
Seeds: = Getreidekoerner
Flour: = Mehl
Mill = Muehle
Owner: %s = Besitzer: %s
Punch this hand-driven mill = Schlage auf diese handbetriebene Muehle
to convert wheat seeds into flour. = um Weizenkoerner in Mehl umzuwandeln.
You have grinded %s wheat seeds (%s are left). = Du hast %s Weizenkoerner gemahlen (%s bleiben uebrig).
You have grinded the last %s wheat seeds. = Du hast die letzten %s Weizenkoerner gemahlen.
to convert seeds into flour. = um Getreidekoerner in Mehl umzuwandeln.
You have grinded %s seeds (%s are left). = Du hast %s Getreidekoerner gemahlen (%s bleiben uebrig).
You have grinded the last %s seeds. = Du hast die letzten %s Getreidekoerner gemahlen.
Your threshing floor can now be used by other players as well. = Dein Dreschboden kann jetzt auch von anderen Spielern benutzt werden.
Your mill, powered by punching can now be used by other players as well. = Deine Mühle kann jetzt auch von anderen Spielern benutzt werden.

View File

@@ -124,14 +124,14 @@ Mill, powered by punching =
Mill, powered by punching (owned by %s) =
Public mill, powered by punching (owned by %s) =
Private mill, powered by punching (owned by %s) =
Wheat seeds: =
Seeds: =
Flour: =
Mill =
Owner: %s =
Punch this hand-driven mill =
to convert wheat seeds into flour. =
You have grinded %s wheat seeds (%s are left). =
You have grinded the last %s wheat seeds. =
to convert seeds into flour. =
You have grinded %s seeds (%s are left). =
You have grinded the last %s seeds. =
Your threshing floor can now be used by other players as well. =
Your mill, powered by punching can now be used by other players as well. =

View File

@@ -26,6 +26,29 @@ cottages.can_thresh_stack = function(stack)
end
--cottages.handmill_product = {}
cottages.handmill_product[cottages.craftitem_seed_wheat] = 'farming:flour'
-- these are from farming_plus:
cottages.handmill_product['farming:seed_rye'] = 'farming:flour'
cottages.handmill_product['farming:seed_oat'] = 'farming:flour'
cottages.handmill_product['farming:seed_barley'] = 'farming:flour'
cottages.handmill_product['farming:seed_rice'] = 'farming:rice_flour'
-- specific to some mods:
cottages.handmill_product['farming:corn'] = 'yl_seasons:corn_flour'
cottages.handmill_product['farming:seeds_sunflower'] = 'cucina_vegana:sunflower_seeds_flour'
-- farming:flour_multigrain is probably best still done by alternate ways of crafting
cottages.can_mill_stack = function(stack)
return (stack
and not(stack:is_empty())
and stack:get_name()
and cottages.handmill_product[stack:get_name()]
-- the product has to be known
and minetest.registered_items[cottages.handmill_product[stack:get_name()]])
end
-- an even simpler from of bed - usually for animals
-- it is a nodebox and not wallmounted because that makes it easier to replace beds with straw mats
minetest.register_node("cottages:straw_mat", {
@@ -402,11 +425,11 @@ local cottages_handmill_formspec = "size[8,8]"..
"button_exit[6.0,0.0;1.5,0.5;public;"..S("Public?").."]"..
"list[current_name;seeds;1,1;1,1;]"..
"list[current_name;flour;5,1;2,2;]"..
"label[0,0.5;"..S("Wheat seeds:").."]"..
"label[0,0.5;"..S("Seeds:").."]"..
"label[4,0.5;"..S("Flour:").."]"..
"label[0,-0.3;"..S("Mill").."]"..
"label[0,2.5;"..S("Punch this hand-driven mill").."]"..
"label[0,3.0;"..S("to convert wheat seeds into flour.").."]"..
"label[0,3.0;"..S("to convert seeds into flour.").."]"..
"list[current_player;main;0,4;8,4;]";
minetest.register_node("cottages:handmill", {
@@ -482,7 +505,7 @@ minetest.register_node("cottages:handmill", {
local meta = minetest.get_meta(pos)
-- only accept input the threshing floor can use/process
if( listname=='flour'
or (listname=='seeds' and stack and not( cottages.handmill_product[ stack:get_name()] ))) then
or (listname=='seeds' and not(cottages.can_mill_stack(stack)) )) then
return 0;
end

View File

@@ -26,3 +26,20 @@ for crop_name, seed_name in pairs(cottages.threshing_floor_receipes) do
items = {crop_name}
})
end
unified_inventory.register_craft_type("cottages_handmill", {
description = "Milling",
icon = "default_stone.png", -- TODO we need a usable image of the handmill here
width = 1,
height = 1,
uses_crafting_grid = false
})
for input_name, product in pairs(cottages.handmill_product) do
unified_inventory.register_craft({
output = product,
type = "cottages_handmill",
items = {input_name}
})
end