Skip to content
Open
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
23 changes: 23 additions & 0 deletions .github/workflows/age_of_mending.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: age_of_mending
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@main
- uses: buckaroobanzay/mtt@main
with:
modname: xcompat
git_game_repo: https://codeberg.org/Age_of_Mending/Age_of_Mending
git_dependencies: |
https://github.com/mt-mods/unifieddyes
https://github.com/mt-mods/basic_materials
https://github.com/OgelGames/fakelib
https://github.com/mt-mods/pipeworks
https://github.com/mt-mods/steel
https://github.com/mt-mods/display_modpack
https://github.com/mt-mods/homedecor_modpack
additional_config: |
mtt_nodelist = age_of_mending.txt
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ read_globals = {
"mcl_player",
"fl_player",
"stairs",
"aom_cooking",
}
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ See the respective sub apis doc file in /doc for detailed documentation.

## Directly supported games and mods

| Games | Sounds | Materials | Textures | Player | Stairs |
| ----------------- | --------- | --------- | --------- | ------ | ------ |
| Minetest Game | x | x | x | x | x |
| MineClone2 | x | x | | x | |
| Mineclonia | x | x | | x | |
| Hades Revisited | x | x | | | |
| Farlands Reloaded | x | x | x | x | x |
| Exile | x | | | | |
| KSurvive 2 | x | | | | |
| Forgotten Lands | x | | | | |
| Development Test | | x | x | | |
| Games | Sounds | Materials | Textures | Player | Stairs | Crafting |
| ----------------- | --------- | --------- | --------- | ------ | ------ | -------- |
| Minetest Game | x | x | x | x | x | x |
| MineClone2 | x | x | | x | | x |
| Mineclonia | x | x | | x | | x |
| Hades Revisited | x | x | | | | x |
| Farlands Reloaded | x | x | x | x | x | x |
| Exile | x | | | | | |
| KSurvive 2 | x | | | | | x |
| Forgotten Lands | x | | | | | |
| Development Test | | x | x | | | x |
| Age of Mending | | x | | | | x |

For functions see /doc/functions.md for the specifics relating to the function

Expand Down
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ xcompat.textures = dofile(modpath .. "/src/textures.lua")
xcompat.functions = dofile(modpath .. "/src/functions.lua")
xcompat.player = dofile(modpath .. "/src/player.lua")
xcompat.stairs = dofile(modpath .. "/src/stairs.lua")
xcompat.register_craft = dofile(modpath .. "/src/crafting.lua")

local function validate_sound(key)
if key and xcompat.sounds[key] then
Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = xcompat
description = Provides cross compatibility between mods and games for sounds and crafting materials.
optional_depends = default, fl_stone, fl_trees, mcl_sounds, hades_sounds, ks_sounds, nodes_nature, fl_topsoil, fl_trees, mcl_core, farming, x_farming, sounds, mtt, player_api, mcl_player, fl_player, stairs, basenodes, unittests, basetools, testpathfinder, testnodes, chest, tiled
optional_depends = default, fl_stone, fl_trees, mcl_sounds, hades_sounds, ks_sounds, nodes_nature, fl_topsoil, fl_trees, mcl_core, farming, x_farming, sounds, mtt, player_api, mcl_player, fl_player, stairs, basenodes, unittests, basetools, testpathfinder, testnodes, chest, tiled, age_of_mending, aom_cooking, aom_mapgen
8 changes: 8 additions & 0 deletions src/crafting.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
local filename = xcompat.gameid

--if we dont have a crafting file for the game, use minetest
if not xcompat.utilities.file_exists(xcompat.modpath .. "/src/crafting/" .. filename .. ".lua") then
filename = "minetest"
end

return dofile(xcompat.modpath .. "/src/crafting/" .. filename .. ".lua")
25 changes: 25 additions & 0 deletions src/crafting/age_of_mending.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

-- assumes mtg-style crafting definition
return function(def)
local t = def.type
if t == "fuel" then
local item = def.recipe
local igroups = core.registered_items[item].groups
igroups.fuel = def.burntime
core.override_item(item, {groups = igroups})
return
elseif t == "cooking" then
local result = def.output
local is_output_edible =
(core.get_item_group(result, "edible") > 0) or
(core.get_item_group(result, "food") > 0)
return aom_cooking.register_cooking({
raw = def.recipe,
cooked = result,
cook_time = def.cooktime,
groups = {is_output_edible and "cooker_boil" or "cooker_crucible"}
})
else
core.register_craft(def) -- age of mending automatically converts recipes
end
end
3 changes: 3 additions & 0 deletions src/crafting/devtest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

-- function wrapped in case of override
return function(...) return core.register_craft(...) end
3 changes: 3 additions & 0 deletions src/crafting/farlands_reloaded.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

-- function wrapped in case of override
return function(...) return core.register_craft(...) end
3 changes: 3 additions & 0 deletions src/crafting/hades_revisited.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

-- function wrapped in case of override
return function(...) return core.register_craft(...) end
3 changes: 3 additions & 0 deletions src/crafting/ksurvive2.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

-- function wrapped in case of override
return function(...) return core.register_craft(...) end
4 changes: 4 additions & 0 deletions src/crafting/mineclonia.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--note this file handles mineclonia, mineclone2, and its rename voxelibre

-- function wrapped in case of override
return function(...) return core.register_craft(...) end
3 changes: 3 additions & 0 deletions src/crafting/minetest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

-- function wrapped in case of override
return function(...) return core.register_craft(...) end
2 changes: 2 additions & 0 deletions src/gameid.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local game_alias = {
mineclone2 = "mineclonia",
pmb_core = "age_of_mending",
}

local game_modnames = {
Expand All @@ -10,6 +11,7 @@ local game_modnames = {
exile = "exile_env_sounds",
ksurvive2 = "ks_metals",
devtest = "basenodes",
age_of_mending = "age_of_mending",
}

local gameid = "xcompat_unknown_gameid"
Expand Down
69 changes: 69 additions & 0 deletions src/materials/age_of_mending.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
local materials = {
sand = "aom_soil:sand",
sandstone = "aom_stone:sandstone",
gravel = "aom_soil:gravel",
flint = "aom_stone:cobble",
copper_ingot = "aom_items:copper_bar",
steel_ingot = "aom_items:iron_bar",
gold_ingot = "aom_items:gold_bar",
tin_ingot = "aom_items:tin_bar",
bronze_ingot = "aom_items:bronze_bar",
axe_steel = "aom_tools:iron_axe",
axe_diamond = "aom_tools:diamond_axe",
axe_bronze = "aom_tools:bronze_axe",
axe_stone = "aom_tools:stone_axe",
pick_steel = "aom_tools:iron_pickaxe",
mese = "aom_underworld:mythril",
mese_crystal = "aom_underworld:mythril_strand",
mese_crystal_fragment = "aom_items:ignis",
torch = "aom_lights:torch",
diamond = "aom_items:diamond",
clay_lump = "aom_items:clay_ball",
water_bucket = "aom_items:wooden_bucket_water",
empty_bucket = "aom_items:wooden_bucket",
dye_dark_grey = "aom_dyes:grey",
dye_black = "aom_dyes:black",
dye_white = "aom_dyes:white",
dye_green = "aom_dyes:green",
dye_red = "aom_dyes:red",
dye_yellow = "aom_dyes:yellow",
dye_brown = "aom_dyes:brown",
dye_blue = "aom_dyes:blue",
dye_violet = "aom_dyes:purple",
dye_grey = "aom_dyes:grey",
dye_dark_green = "aom_dyes:dark_green",
dye_orange = "aom_dyes:orange",
dye_pink = "aom_dyes:pink",
dye_cyan = "aom_dyes:light_blue",
dye_magenta = "aom_dyes:magenta",
string = "aom_rope:rope",
iron_lump = "aom_items:iron_nugget",
slab_stone = "aom_stone:stone_slab",
slab_wood = "aom_wood:oak_planks_slab",
glass = "aom_glass:glass",
glass_block = "aom_glass:glass",
glass_bottle = "aom_glass:glass",
coal_lump = "aom_items:coal",
stone = "aom_stone:ironstone",
desert_stone = "aom_stone:ironstone",
desert_sand = "aom_soil:sand",
chest = "aom_storage:chest",
cobble = "aom_stone:cobble",
obsidian_glass = "aom_glass:glass",
water_source = "aom_liquids:water_source",
water_flowing = "aom_liquids:water_flowing",
dirt = "aom_soil:dirt",
dirt_with_grass = "aom_soil:dirt_with_grass",
apple_leaves = "aom_wood:oak_leaves",
apple_log = "aom_wood:oak_log",
apple_planks = "aom_wood:oak_planks",
birch_leaves = "aom_wood:ash_leaves",
birch_log = "aom_wood:ash_log",
birch_planks = "aom_wood:ash_planks",
jungle_leaves = "aom_wood:spruce_leaves",
bowl = "aom_items:wooden_bowl",
stick = "aom_items:stick",
obsidian = "aom_stone:obsidian",
}

return materials
23 changes: 23 additions & 0 deletions test/nodelist/age_of_mending.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
aom_soil:sand
aom_stone:sandstone
aom_soil:gravel
aom_stone:cobble
aom_stone:stone_slab
aom_wood:oak_planks_slab
aom_stone:ironstone
aom_soil:sand
aom_storage:chest
aom_stone:cobble
aom_glass:glass
aom_liquids:water_source
aom_liquids:water_flowing
aom_soil:dirt
aom_soil:dirt_with_grass
aom_wood:oak_leaves
aom_wood:oak_log
aom_wood:oak_planks
aom_wood:ash_leaves
aom_wood:ash_log
aom_wood:ash_planks
aom_wood:spruce_leaves
aom_stone:obsidian