Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add xcompat #387

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ read_globals = {
"craftguide", "i3", "mtt",
"vizlib", "mcl_sounds", "mcl_vars",
"mcl_worlds", "mcl_buckets", "mcl_formspec",
"mcl_craftguide",
"mcl_craftguide", "xcompat",

-- Only used in technic/machines/MV/lighting.lua (disabled)
"isprotect", "homedecor_expect_infinite_stacks",
Expand Down
6 changes: 3 additions & 3 deletions technic/crafts.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- check if we have the necessary dependencies to allow actually using these materials in the crafts

local mat = technic.materials
local mat = xcompat.materials
local has_mcl = minetest.get_modpath("mcl_core")

-- Remove some recipes
Expand Down Expand Up @@ -180,11 +180,11 @@ minetest.register_craft({
minetest.register_craft({
output = mat.dirt.." 2",
type = "shapeless",
replacements = {{mat.bucket_water,mat.bucket_empty}},
replacements = {{mat.water_bucket,mat.empty_bucket}},
recipe = {
"technic:stone_dust",
"group:leaves",
mat.bucket_water,
mat.water_bucket,
"group:sand",
},
})
3 changes: 0 additions & 3 deletions technic/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ technic.modpath = modpath
local S = minetest.get_translator("technic")
technic.getter = S

-- Read materials file
dofile(modpath.."/materials.lua")

-- Read configuration file
dofile(modpath.."/config.lua")

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/HV/forcefield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local S = technic.getter

local cable_entry = "^technic_cable_connection_overlay.png"

local mat = technic.materials
local mat = xcompat.materials

minetest.register_craft({
output = "technic:forcefield_emitter_off",
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/HV/nuclear_reactor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local fuel_type = "technic:uranium_fuel" -- The reactor burns this
local digiline_meltdown = technic.config:get_bool("enable_nuclear_reactor_digiline_selfdestruct")
local has_digilines = minetest.get_modpath("digilines")
local has_mcl = minetest.get_modpath("mcl_core")
local mat = technic.materials
local mat = xcompat.materials

local S = technic.getter

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/alloy_furnace.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- LV Alloy furnace
local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

-- FIXME: kpoppel: I'd like to introduce an induction heating element here...
minetest.register_craft({
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/cables.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

minetest.register_alias("lv_cable", "technic:lv_cable")

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/compressor.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

minetest.register_alias("compressor", "technic:lv_compressor")

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/electric_furnace.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- LV Electric Furnace
-- This is a faster version of the stone furnace which runs on EUs
local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

-- FIXME: kpoppel I'd like to introduce an induction heating element here also
minetest.register_craft({
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- Inefficient and expensive in fuel (200EU per tick)
-- Also only allows for LV machinery to run.

local mat = technic.materials
local mat = xcompat.materials

minetest.register_alias("lv_generator", "technic:lv_generator")

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/geothermal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
minetest.register_alias("geothermal", "technic:geothermal")

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

minetest.register_craft({
output = 'technic:geothermal',
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/grinder.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

minetest.register_alias("grinder", "technic:lv_grinder")
minetest.register_craft({
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/lamp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- Illuminates a 7x7x3(H) volume below itself with light bright as the sun.

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

local demand = 50
local desc = S("@1 Lamp", S("LV"))
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/music_player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- The player can play music. But it is high ampage!

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

minetest.register_alias("music_player", "technic:music_player")
minetest.register_craft({
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/LV/water_mill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- It is a little over half as good as the thermal generator.

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

local cable_entry = "^technic_cable_connection_overlay.png"

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/MV/tool_workshop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
minetest.register_alias("tool_workshop", "technic:tool_workshop")

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

local tube_entry = "^pipeworks_tube_connection_wooden.png"

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/other/coal_alloy_furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Fuel driven alloy furnace. This uses no EUs:

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

minetest.register_craft({
output = 'technic:coal_alloy_furnace',
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/other/injector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local fs_helpers = pipeworks.fs_helpers

local tube_entry = "^pipeworks_tube_connection_metallic.png"

local mat = technic.materials
local mat = xcompat.materials

local param2_to_under = {
[0] = {x= 0,y=-1,z= 0}, [1] = {x= 0,y= 0,z=-1},
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/power_monitor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- similarly to the old "slave" switching stations.

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

local cable_entry = "^technic_cable_connection_overlay.png"

Expand Down
6 changes: 3 additions & 3 deletions technic/machines/register/alloy_recipes.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

technic.register_recipe_type("alloy", {
description = S("Alloying"),
Expand Down Expand Up @@ -30,8 +30,8 @@ local recipes = {
-- improves its tensile strength and wear resistance …"
{"technic:raw_latex 4", "technic:coal_dust 2", "technic:rubber 6", 2},
{"technic:raw_latex 2", mat.coal_lump, "technic:rubber 2", 2},
{mat.ice, mat.bucket_empty, mat.bucket_water, 1 },
{mat.obsidian, mat.bucket_empty, mat.bucket_lava, 1 },
{mat.ice, mat.empty_bucket, mat.water_bucket, 1 },
{mat.obsidian, mat.empty_bucket, mat.lava_bucket, 1 },
}

if minetest.get_modpath("ethereal") then
Expand Down
10 changes: 5 additions & 5 deletions technic/machines/register/battery_box.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local digilines_path = minetest.get_modpath("digilines")
local S = technic.getter
local tube_entry = "^pipeworks_tube_connection_metallic.png"
local cable_entry = "^technic_cable_connection_overlay.png"
local mat = technic.materials
local mat = xcompat.materials

-- Battery recipes:
-- Tin-copper recipe:
Expand All @@ -23,11 +23,11 @@ minetest.register_craft({
output = "technic:battery",
recipe = {
{"group:wood", "technic:sulfur_lump", "group:wood"},
{"technic:lead_ingot", mat.bucket_water, "technic:lead_ingot"},
{"technic:lead_ingot", mat.water_bucket, "technic:lead_ingot"},
{"group:wood", "technic:sulfur_lump", "group:wood"},
},
replacements = {
{mat.bucket_water, mat.bucket_empty}
{mat.water_bucket, mat.empty_bucket}
}
})
-- With oil extract:
Expand All @@ -45,11 +45,11 @@ minetest.register_craft({
output = "technic:battery",
recipe = {
{"group:wood", "technic:sulfur_dust", "group:wood"},
{"technic:lead_ingot", mat.bucket_water, "technic:lead_ingot"},
{"technic:lead_ingot", mat.water_bucket, "technic:lead_ingot"},
{"group:wood", "technic:sulfur_dust", "group:wood"},
},
replacements = {
{mat.bucket_water, mat.bucket_empty}
{mat.empty_bucket, mat.empty_bucket}
}
})
-- With oil extract:
Expand Down
4 changes: 2 additions & 2 deletions technic/machines/register/centrifuge_recipes.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

technic.register_recipe_type("separating", {
description = S("Separating"),
Expand Down Expand Up @@ -40,7 +40,7 @@ if minetest.get_modpath("farming") or minetest.get_modpath("mcl_farming") then
table.insert(recipes, { "farming:barley", "farming:seed_barley", "cottages:straw_mat" })
else
-- work in a less fancy and less efficient manner
table.insert(recipes, { mat.wheat.." 4", mat.seed_wheat.." 3", mat.dry_shrub })
table.insert(recipes, { mat.wheat.." 4", mat.wheat_seed.." 3", mat.dry_shrub })
table.insert(recipes, { "farming:barley 4", "farming:seed_barley 3", mat.dry_shrub })
end
end
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/register/common.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

-- handles the machine upgrades every tick
function technic.handle_machine_upgrades(meta)
Expand Down
2 changes: 1 addition & 1 deletion technic/machines/register/compressor_recipes.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials
local has_mcl = minetest.get_modpath("mcl_core")

technic.register_recipe_type("compressing", {
Expand Down
8 changes: 4 additions & 4 deletions technic/machines/register/freezer_recipes.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

technic.register_recipe_type("freezing", {
description = S("Freezing"),
Expand All @@ -13,10 +13,10 @@ function technic.register_freezer_recipe(data)
end

local recipes = {
{mat.bucket_water, { mat.ice, mat.bucket_empty } },
{mat.bucket_river_water, { mat.ice, mat.bucket_empty } },
{mat.water_bucket, { mat.ice, mat.empty_bucket } },
{mat.river_water_bucket, { mat.ice, mat.empty_bucket } },
{mat.dirt, mat.dirt_with_snow },
{mat.bucket_lava, { mat.obsidian, mat.bucket_empty } }
{mat.lava_bucket, { mat.obsidian, mat.empty_bucket } }
}

for _, data in pairs(recipes) do
Expand Down
4 changes: 2 additions & 2 deletions technic/machines/register/grinder_recipes.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

technic.register_recipe_type("grinding", {
description = S("Grinding"),
Expand Down Expand Up @@ -63,7 +63,7 @@ minetest.clear_craft({
})

if minetest.get_modpath("farming") then
table.insert(recipes, {mat.seed_wheat, "farming:flour 1"})
table.insert(recipes, {mat.wheat_seed, "farming:flour 1"})
end

if minetest.get_modpath("moreores") then
Expand Down
6 changes: 3 additions & 3 deletions technic/machines/register/grindings.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local S = technic.getter
local moretrees = minetest.get_modpath("moretrees")
local dye = minetest.get_modpath("dye")
local mat = technic.materials
local mat = xcompat.materials

-- sawdust, the finest wood/tree grinding
local sawdust = "technic:sawdust"
Expand All @@ -10,7 +10,7 @@ minetest.register_craftitem(sawdust, {
inventory_image = "technic_sawdust.png",
})
minetest.register_craft({ type = "fuel", recipe = sawdust, burntime = 6 })
technic.register_compressor_recipe({ input = {sawdust .. " 4"}, output = mat.wood })
technic.register_compressor_recipe({ input = {sawdust .. " 4"}, output = mat.apple_planks })

-- tree/wood grindings
local function register_tree_grinding(name, tree, wood, extract, grinding_color)
Expand Down Expand Up @@ -52,7 +52,7 @@ local default_extract = dye and "dye:brown 2"
local acacia_extract = dye and "dye:brown 8"

-- Specific recipes for acacia and rubber trees
register_tree_grinding("Acacia", mat.acacia_tree, mat.acacia_wood, acacia_extract)
register_tree_grinding("Acacia", mat.acacia_tree, mat.acacia_planks, acacia_extract)
register_tree_grinding("Rubber Tree", "moretrees:rubber_tree_trunk", rubber_planks, "technic:raw_latex 2")
register_tree_grinding("Rubber Tree", "moretrees:rubber_tree_trunk_empty", nil, "technic:raw_latex")

Expand Down
2 changes: 1 addition & 1 deletion technic/machines/switching_station.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local mesecons_path = minetest.get_modpath("mesecons")
local digilines_path = minetest.get_modpath("digilines")

local S = technic.getter
local mat = technic.materials
local mat = xcompat.materials

local cable_entry = "^technic_cable_connection_overlay.png"

Expand Down
Loading
Loading