Add mods: technic, moreores, paintings, Nyancat (Pbj_pup). Small fix: sandwiches

This commit is contained in:
N-Nachtigal 2025-06-05 16:15:56 +02:00
parent 15e8e696a2
commit fb09deddc1
1404 changed files with 156555 additions and 211 deletions

View file

@ -4,32 +4,39 @@
local S = airutils.S
local module_name = "airutils"
--[[
if core.get_modpath("technic") then
if technic then
technic.register_extractor_recipe({input = {"farming:wheat 33"}, output = "biofuel:biofuel 1"})
technic.register_extractor_recipe({input = {"farming:corn 33"}, output = "biofuel:biofuel 1"})
technic.register_extractor_recipe({input = {"farming:potato 33"}, output = "biofuel:biofuel 1"})
technic.register_extractor_recipe({input = {"default:papyrus 99"}, output = "biofuel:biofuel 1"})
end
end
if technic then
local extractor_recipes = {
{ "farming:wheat 33", "biofuel:biofuel" },
{ "farming:corn 33", "biofuel:biofuel" },
{ "farming:potato 33", "biofuel:biofuel" },
{ "default:papyrus 99", "biofuel:biofuel" },
}
for _, data in ipairs(extractor_recipes) do
technic.register_extractor_recipe({ input = { data[1] }, output = data[2] })
end
end
end
]]--
if core.get_modpath("basic_machines") then
if basic_machines then
basic_machines.grinder_recipes["farming:wheat"] = {50,"biofuel:biofuel",1}
basic_machines.grinder_recipes["farming:corn"] = {50,"biofuel:biofuel",1}
basic_machines.grinder_recipes["farming:potato"] = {50,"biofuel:biofuel",1}
basic_machines.grinder_recipes["default:papyrus"] = {70,"biofuel:biofuel",1}
end
if basic_machines then
basic_machines.grinder_recipes["farming:wheat"] = { 50, "biofuel:biofuel", 1 }
basic_machines.grinder_recipes["farming:corn"] = { 50, "biofuel:biofuel", 1 }
basic_machines.grinder_recipes["farming:potato"] = { 50, "biofuel:biofuel", 1 }
basic_machines.grinder_recipes["default:papyrus"] = { 70, "biofuel:biofuel", 1 }
end
end
if core.get_modpath("default") then
core.register_craft({
output = module_name .. ":biofuel_distiller",
recipe = {
{"default:copper_ingot", "default:copper_ingot", "default:copper_ingot"},
{"default:steel_ingot" , "", "default:steel_ingot"},
{"default:steel_ingot" , "default:steel_ingot", "default:steel_ingot"},
{ "default:copper_ingot", "default:copper_ingot", "default:copper_ingot" },
{ "default:steel_ingot", "", "default:steel_ingot" },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
},
})
end
@ -37,17 +44,16 @@ if core.get_modpath("mcl_core") then
core.register_craft({
output = module_name .. ":biofuel_distiller",
recipe = {
{"mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot"},
{"mcl_core:iron_ingot" , "", "mcl_core:iron_ingot"},
{"mcl_core:iron_ingot" , "mcl_core:iron_ingot", "mcl_core:iron_ingot"},
{ "mcl_copper:copper_ingot", "mcl_copper:copper_ingot", "mcl_copper:copper_ingot" },
{ "mcl_core:iron_ingot", "", "mcl_core:iron_ingot" },
{ "mcl_core:iron_ingot", "mcl_core:iron_ingot", "mcl_core:iron_ingot" },
},
})
end
-- biofuel
local new_gallon_id = "airutils:biofuel"
core.register_craftitem(new_gallon_id,{
core.register_craftitem(new_gallon_id, {
description = S("Bio Fuel"),
inventory_image = "airutils_biofuel_inv.png",
})
@ -61,43 +67,60 @@ core.register_craft({
core.register_alias("biofuel:biofuel", new_gallon_id) --for the old biofuel
local ferment = {
{"default:papyrus", new_gallon_id},
{"farming:wheat", new_gallon_id},
{"farming:corn", new_gallon_id},
{"farming:baked_potato", new_gallon_id},
{"farming:potato", new_gallon_id}
{ "default:papyrus", new_gallon_id },
{ "farming:wheat", new_gallon_id },
{ "farming:corn", new_gallon_id },
{ "farming:baked_potato", new_gallon_id },
{ "farming:potato", new_gallon_id },
}
local ferment_groups = {'flora', 'leaves', 'flower', 'sapling', 'tree', 'wood', 'stick', 'plant', 'seed',
'leafdecay', 'leafdecay_drop', 'mushroom', 'vines' }
local ferment_groups = {
"flora",
"leaves",
"flower",
"sapling",
"tree",
"wood",
"stick",
"plant",
"seed",
"leafdecay",
"leafdecay_drop",
"mushroom",
"vines",
}
-- distiller
local biofueldistiller_formspec = "size[8,9]"
.. "list[current_name;src;2,1;1,1;]" .. airutils.get_itemslot_bg(2, 1, 1, 1)
.. "list[current_name;dst;5,1;1,1;]" .. airutils.get_itemslot_bg(5, 1, 1, 1)
.. "list[current_player;main;0,5;8,4;]" .. airutils.get_itemslot_bg(0, 5, 8, 4)
.. "list[current_name;src;2,1;1,1;]"
.. airutils.get_itemslot_bg(2, 1, 1, 1)
.. "list[current_name;dst;5,1;1,1;]"
.. airutils.get_itemslot_bg(5, 1, 1, 1)
.. "list[current_player;main;0,5;8,4;]"
.. airutils.get_itemslot_bg(0, 5, 8, 4)
.. "listring[current_name;dst]"
.. "listring[current_player;main]"
.. "listring[current_name;src]"
.. "listring[current_player;main]"
.. "image[3.5,1;1,1;gui_furnace_arrow_bg.png^[transformR270]"
core.register_node( module_name .. ":biofuel_distiller", {
core.register_node(module_name .. ":biofuel_distiller", {
description = S("Biofuel Distiller"),
tiles = {"airutils_black.png", "airutils_aluminum.png", "airutils_copper.png" },
tiles = { "airutils_black.png", "airutils_aluminum.png", "airutils_copper.png" },
drawtype = "mesh",
mesh = "airutils_biofuel_distiller.b3d",
paramtype = "light",
paramtype2 = "facedir",
groups = {
choppy = 2, oddly_breakable_by_hand = 1, flammable = 2
choppy = 2,
oddly_breakable_by_hand = 1,
flammable = 2,
},
legacy_facedir_simple = true,
on_place = core.rotate_node,
on_construct = function(pos)
local meta = core.get_meta(pos)
meta:set_string("formspec", biofueldistiller_formspec)
@ -110,13 +133,11 @@ core.register_node( module_name .. ":biofuel_distiller", {
inv:set_size("dst", 1)
end,
can_dig = function(pos,player)
can_dig = function(pos, player)
local meta = core.get_meta(pos)
local inv = meta:get_inventory()
if not inv:is_empty("dst")
or not inv:is_empty("src") then
if not inv:is_empty("dst") or not inv:is_empty("src") then
return false
end
@ -124,7 +145,6 @@ core.register_node( module_name .. ":biofuel_distiller", {
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if core.is_protected(pos, player:get_player_name()) then
return 0
end
@ -133,7 +153,6 @@ core.register_node( module_name .. ":biofuel_distiller", {
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if core.is_protected(pos, player:get_player_name()) then
return 0
end
@ -146,7 +165,6 @@ core.register_node( module_name .. ":biofuel_distiller", {
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
if core.is_protected(pos, player:get_player_name()) then
return 0
end
@ -159,20 +177,20 @@ core.register_node( module_name .. ":biofuel_distiller", {
end,
on_metadata_inventory_put = function(pos)
local timer = core.get_node_timer(pos)
timer:start(5)
end,
on_timer = function(pos)
local meta = core.get_meta(pos) ; if not meta then return end
local meta = core.get_meta(pos)
if not meta then
return
end
local inv = meta:get_inventory()
-- is barrel empty?
if not inv or inv:is_empty("src") then
meta:set_float("status", 0.0)
meta:set_string("infotext", S("Fuel Distiller"))
@ -182,7 +200,7 @@ core.register_node( module_name .. ":biofuel_distiller", {
-- does it contain any of the source items on the list?
local has_item
--normal items
--normal items
for n = 1, #ferment do
if inv:contains_item("src", ItemStack(ferment[n][1])) then
has_item = n
@ -190,22 +208,22 @@ core.register_node( module_name .. ":biofuel_distiller", {
end
end
--groups
local has_group
if not has_item then
local inv_content = inv:get_list("src")
if inv_content then
for k, v in pairs(inv_content) do
local item_name = v:get_name()
for n = 1, #ferment_groups do
if core.get_item_group(item_name, ferment_groups[n]) == 1 then
has_group = n
break
end
end
end
end
end
--groups
local has_group
if not has_item then
local inv_content = inv:get_list("src")
if inv_content then
for k, v in pairs(inv_content) do
local item_name = v:get_name()
for n = 1, #ferment_groups do
if core.get_item_group(item_name, ferment_groups[n]) == 1 then
has_group = n
break
end
end
end
end
end
if not has_item and not has_group then
return false
@ -229,17 +247,17 @@ core.register_node( module_name .. ":biofuel_distiller", {
meta:set_string("infotext", S("Fuel Distiller @1% done", status))
meta:set_float("status", status + 5)
else
if not has_group then
inv:remove_item("src", ferment[has_item][1])
inv:add_item("dst", ferment[has_item][2])
else
for i,itemstack in pairs(inv:get_list("src")) do
inv:remove_item("src", ItemStack(itemstack:get_name().." 1"))
end
inv:add_item("dst", new_gallon_id)
end
if not has_group then
inv:remove_item("src", ferment[has_item][1])
inv:add_item("dst", ferment[has_item][2])
else
for i, itemstack in pairs(inv:get_list("src")) do
inv:remove_item("src", ItemStack(itemstack:get_name() .. " 1"))
end
inv:add_item("dst", new_gallon_id)
end
meta:set_float("status", 0,0)
meta:set_float("status", 0, 0)
end
if inv:is_empty("src") then
@ -252,16 +270,16 @@ core.register_node( module_name .. ":biofuel_distiller", {
})
--lets remove the old one
core.register_node(":".."biofuel:biofuel_distiller", {
groups = {old_biofuel=1},
core.register_node(":" .. "biofuel:biofuel_distiller", {
groups = { old_biofuel = 1 },
})
core.register_abm({
nodenames = {"group:old_biofuel"},
interval = 1,
chance = 1,
action = function(pos, node)
--core.remove_node(pos)
core.swap_node(pos,{name = module_name..":biofuel_distiller"})
end,
nodenames = { "group:old_biofuel" },
interval = 1,
chance = 1,
action = function(pos, node)
--core.remove_node(pos)
core.swap_node(pos, { name = module_name .. ":biofuel_distiller" })
end,
})