1 Commits

Author SHA1 Message Date
wsor4035
81802d90ed get started on group support 2024-06-23 22:01:50 -04:00
40 changed files with 87 additions and 11386 deletions

View File

@@ -1,23 +0,0 @@
name: farlands_reloaded
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://github.com/TerraQuest-Studios/farlands_reloaded
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 = farlands_reloaded.txt

View File

@@ -1,23 +0,0 @@
name: hades_revisited
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/Wuzzy/Hades_Revisited
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 = hades_revisited.txt

View File

@@ -1,23 +0,0 @@
name: mineclonia
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/mineclonia/mineclonia
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 = mineclonia.txt

View File

@@ -1,23 +0,0 @@
name: minetest_game
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://github.com/minetest/minetest_game
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 = minetest.txt

View File

@@ -1,23 +0,0 @@
name: voxelibre
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://git.minetest.land/VoxeLibre/VoxeLibre/
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 = voxelibre.txt

View File

@@ -1,6 +1,5 @@
globals = { globals = {
"minetest", "minetest",
"core",
"xcompat", "xcompat",
} }
@@ -17,10 +16,5 @@ read_globals = {
"fl_trees", "fl_trees",
"hades_sounds", "hades_sounds",
"rp_sounds", "rp_sounds",
"mtt",
"sounds", "sounds",
"player_api",
"mcl_player",
"fl_player",
"stairs",
} }

View File

@@ -1,5 +1,5 @@
MIT Copyright 2021-2025 wsor4035, mt-mods and contributors MIT Copyright 2021-2024 wsor4035
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in

View File

@@ -1,6 +1,6 @@
# XCompat # XCompat
[![luacheck](https://github.com/mt-mods/xcompat/actions/workflows/luacheck.yml/badge.svg?branch=master)](https://github.com/mt-mods/xcompat/actions/workflows/luacheck.yml) [![luacheck](https://github.com/mt-mods/xcompat/workflows/luacheck/badge.svg)](https://github.com/mt-mods/xcompat/actions)
[![ContentDB](https://content.minetest.net/packages/mt-mods/xcompat/shields/downloads/)](https://content.minetest.net/packages/mt-mods/xcompat/) [![ContentDB](https://content.minetest.net/packages/mt-mods/xcompat/shields/downloads/)](https://content.minetest.net/packages/mt-mods/xcompat/)
Provides cross compatibility between games and mods for sounds and crafting materials. Provides cross compatibility between games and mods for sounds and crafting materials.
@@ -15,16 +15,16 @@ See the respective sub apis doc file in /doc for detailed documentation.
## Directly supported games and mods ## Directly supported games and mods
| Games | Sounds | Materials | Textures | Player | Stairs | | Games | Sounds | Materials | Textures |
| ----------------- | --------- | --------- | --------- | ------ | ------ | | ----------------- | --------- | --------- | --------- |
| Minetest Game | x | x | x | x | x | | Minetest Game | x | x | x |
| MineClone2 | x | x | | x | | | MineClone2 | x | x | |
| Mineclonia | x | x | | x | | | Mineclonia | x | x | |
| Hades Revisited | x | x | | | | | Hades Revisited | x | x | |
| Farlands Reloaded | x | x | x | x | x | | Farlands Reloaded | x | x | x |
| Exile | x | | | | | | Exile | x | | |
| KSurvive 2 | x | | | | | | KSurvive 2 | x | | |
| Forgotten Lands | x | | | | | | Forgotten Lands | x | | |
For functions see /doc/functions.md for the specifics relating to the function For functions see /doc/functions.md for the specifics relating to the function

View File

@@ -1,16 +1,13 @@
# Functions API # Functions API
## `can_interact_with_node(player, pos)` ## `can_interact_with_node(player, pos)`
returns `bool` returns `bool`
checks for the ability to interact with a node via: checks for the ability to interact with a node via:
* if a player * if a player
* owner metadata key * owner metadata key
* `protection_bypass` * protection_bypass
supports supports
* minetest game default if present * minetest game default if present
* else polyfill * else polyfill

View File

@@ -6,7 +6,7 @@ simply returns `minetest.get_game_info().id`
## minetest versions < 5.7 ## minetest versions < 5.7
approximates the gameid value via a hardcoded table of gameid =\> modname, approximates the gameid value via a hardcoded table of gameid=>modname
and then checks via `minetest.get_modpath()`. If it fails, it falls and then checks via `minetest.get_modpath()`. If it fails, it falls
back to using `xcompat_unknown_gameid` as the id. See the chart in the back to using `xcompat_unknown_gameid` as the id. See the chart in the
readme for which games are supported readme for which games are supported

View File

@@ -1,26 +1,3 @@
# Materials API # Materials API
## Usage consult `/src/materials/minetest.lua` at this time
The materials can be accessed anywhere in your mod with `xcompat.materials.material_name`.
Behind the scenes, xcompat automatically changes the `xcompat.materials`
variable to contain the correct materials for whichever game the mod is
launched in.
## Game support
See the [the support table in the readme](https://github.com/mt-mods/xcompat/tree/master?tab=readme-ov-file#directly-supported-games-and-mods)
for an overview of supported games, and see the contents of `/src/materials/`
for the supported materials and their names.
## Examples
Writing `xcompat.materials.steel_ingot` returns the string of whichever item
would closest represent the `steel_ingot` material in the current game.
The `/src/materials/mineclonia.lua` file shows what the keys of
`xcompat.materials` resolve to when playing Mineclonia, such as
`xcompat.materials.steel_ingot` resolving to `mcl_core:iron_ingot`, and
`xcompat.materials.mesa_crystal` resolving to `mcl_redstone:redstone` if
supported.

View File

@@ -1,21 +0,0 @@
# Player API
## Usage
The player api can be accessed in your script through `xcompat.player`.
This object mimics the `player_api` from Minetest Game, and should be a drop-in
replacement in most cases. You should be able to simply replace instances
of `player_api` in your script with `xcompat.player`.
## Note on `xcompat.player.player_attached`
Reading & writing to this object works, but because it's a proxy table it can't
be looped over.
Looping over this object would require lua5.2 `__pairs`/`__ipairs` metamethod support.
It would be possible to implement support for this through polyfill,
using [this method](https://stackoverflow.com/a/77354254)
(luajit supports this via 5.2 extensions), but it's not implemented as of now.
Additionally see [this engine issue](https://github.com/minetest/minetest/issues/15133).

View File

@@ -1,6 +1,5 @@
# Sound API # Sound API
## Option 1: Agnostically depend ## Option 1: Agnostically depend
You can do this by using a custom field in your node def instead of the `sounds` key. You can do this by using a custom field in your node def instead of the `sounds` key.
@@ -23,7 +22,7 @@ where:
## Option 2: Hard depend ## Option 2: Hard depend
add this mod to your mod.confs depends and directly call the `sound_api` as follows add this mod to your mod.confs depends and directly call the sound_api as follows
```lua ```lua
minetest.register_node(nodename, { minetest.register_node(nodename, {
@@ -33,13 +32,4 @@ minetest.register_node(nodename, {
}) })
``` ```
* input: optional table to override some or all of returned values * input: optional table to override some or all of returned values
## Note
In some instances, when sounds are defined by strings and the sound doesn't
belong to a block or anything mod-specific, xcompat may not be needed. E.g.
the sound `"default_dig_choppy"` is accessed in the same way in both Mineclonia
and Minetest Game, without xcompat.

View File

@@ -1,30 +0,0 @@
you can use this via `xcompat.stairs.register(nodename, def)`
an example would be:
```lua
xcompat.stairs.register(
"xcompat_stairs_test:fake_node",
core.registered_nodes["xcompat_stairs_test:fake_node"]
)
```
if the game you are running on isnt supported (see readme),
it falls back to using a polyfill. each backend adds aliases
to the polyfill, mainly so that if we add a future backend
that ran on polyfill, everything keeps working (yay)
at this time stairsplus/moreblocks compatibility/upgrading
isnt supported, however should be added in the future. for
now, in your mod code do something like the following:
```lua
if core.registered_modes("moreblocks") then
--call stairs plus
else
xcompat.stairs.register(node, def)
end
```
that way in the future nothing will break when support is
added and at your convince the first part of the if can be
removed

View File

@@ -1,20 +1,3 @@
# Textures API # Textures API
## Usage consult `/src/texture/minetest.lua` at this time
To use a texture in your mod, find the texture you want by looking at one of
the files in `/src/texture`, and append its path to `xcompat.textures`.
If a texture isn't supported for the current game, xcompat creates a solid
color texture using texture modifiers as a fallback, ensuring compatibility.
## Example
| Path | Result in Minetest Game |
| - | - |
| xcompat.textures.wool.white | `"wool_white.png"` |
| xcompat.textures.wood.apple.planks | `"default_wood.png"` |
| xcompat.textures.wood.jungle.leaves | `"default_jungleleaves.png"` |
| xcompat.textures.glass.pane | `"default_glass.png"` |
For games like Minetest and Mineclonia, see the file `/src/textures/minetest.lua`.

View File

@@ -1,2 +0,0 @@
test export-ignore
.github export-ignore

View File

@@ -11,8 +11,8 @@ xcompat.sounds = dofile(modpath .. "/src/sounds.lua")
xcompat.materials = dofile(modpath .. "/src/materials.lua") xcompat.materials = dofile(modpath .. "/src/materials.lua")
xcompat.textures = dofile(modpath .. "/src/textures.lua") xcompat.textures = dofile(modpath .. "/src/textures.lua")
xcompat.functions = dofile(modpath .. "/src/functions.lua") xcompat.functions = dofile(modpath .. "/src/functions.lua")
xcompat.player = dofile(modpath .. "/src/player.lua")
xcompat.stairs = dofile(modpath .. "/src/stairs.lua") dofile(modpath .. "/src/groups.lua")
local function validate_sound(key) local function validate_sound(key)
if key and xcompat.sounds[key] then if key and xcompat.sounds[key] then
@@ -44,9 +44,4 @@ minetest.register_on_mods_loaded(function()
end end
end) end)
dofile(modpath .. "/src/commands.lua") dofile(modpath .. "/src/commands.lua")
if minetest.get_modpath("mtt") and mtt.enabled then
-- register tests
dofile(modpath .. "/mtt.lua")
end

View File

@@ -1,3 +1,3 @@
name = xcompat name = xcompat
description = Provides cross compatibility between mods and games for sounds and crafting materials. 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 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

10
mtt.lua
View File

@@ -1,10 +0,0 @@
-- emerge a part of the world (basic smoketest)
mtt.emerge_area({ x=0, y=0, z=0 }, { x=10, y=10, z=10 })
-- check nodelist
local mtt_nodelist = minetest.settings:get("mtt_nodelist")
if mtt_nodelist then
-- nodelist specified, check if all the required nodes are present
mtt.validate_nodenames(minetest.get_modpath("xcompat") .. "/test/nodelist/" .. mtt_nodelist)
end

View File

@@ -66,11 +66,11 @@ minetest.register_chatcommand("xcompat_test_sounds", {
for gameid, game_sounds in pairs(sounds) do for gameid, game_sounds in pairs(sounds) do
for sound, _ in pairs(reference_sounds) do for sound, _ in pairs(reference_sounds) do
if not game_sounds[sound] then if not game_sounds[sound] then
minetest.chat_send_player(name, "Missing sound: "..sound.." in game: "..gameid) minetest.chat_send_player(name, "Missing material: "..sound.." in game: "..gameid)
end end
end end
end end
minetest.chat_send_player(name, "Sounds test complete") minetest.chat_send_player(name, "Sounds test complete")
end end
}) })

View File

@@ -16,40 +16,4 @@ function functions.can_interact_with_node(player, pos)
return false return false
end end
function functions.sapling_on_place(
itemstack, player, pointed_thing, sapling_name, minp_relative, maxp_relative, interval
)
if default then
return default.sapling_on_place(
itemstack, player, pointed_thing, sapling_name, minp_relative, maxp_relative, interval
)
end
local pos = pointed_thing.above
local pname = player and player:get_player_name() or ""
local below_node = minetest.get_node_or_nil(pointed_thing.under)
if below_node and minetest.registered_items[below_node.name] and
minetest.registered_items[below_node.name].buildable_to then
pos = pointed_thing.under
end
--check protection
if minetest.is_protected(pos, pname) then
minetest.record_protection_violation(pos, pname)
return itemstack
end
--actually place sapling
minetest.set_node(pos, {name = sapling_name})
--handle survival
if not minetest.is_creative_enabled(pname) then
itemstack:take_item()
end
return itemstack
end
return functions return functions

26
src/groups.lua Normal file
View File

@@ -0,0 +1,26 @@
local function on_mods_loaded()
for name, def in pairs(minetest.registered_nodes) do
if def.groups and def.groups.xcompat_autohandle_groups and def.groups.xcompat_autohandle_groups==1 then
local groups = table.copy(def.groups)
groups.xcompat_autohandle_groups = nil
groups.xcompat_was_handled = 1
minetest.override_item(name, {
groups = groups
})
end
end
--todo: override minetest.register_node to handle groups registered after this point
end
--sticking it at the front so that our overrides are applied first
table.insert(minetest.registered_on_mods_loaded, 1, on_mods_loaded)
--test node, delete before merge
minetest.register_node("xcompat:groups_test", {
description = "xCompat Groups test",
groups = {xcompat_autohandle_groups=1},
tiles = {xcompat.textures.gravel},
})

View File

@@ -39,7 +39,6 @@ local materials = {
dye_orange = "fl_dyes:orange_dye", dye_orange = "fl_dyes:orange_dye",
dye_pink = "fl_dyes:pink_dye", dye_pink = "fl_dyes:pink_dye",
dye_cyan = "fl_dyes:cyan_dye", dye_cyan = "fl_dyes:cyan_dye",
dye_magenta = "fl_dyes:magenta_dye",
silver_ingot = "fl_ores:iron_ingot", silver_ingot = "fl_ores:iron_ingot",
silicon = "mesecons_materials:silicon", silicon = "mesecons_materials:silicon",
string = "fl_plantlife:oxeye_daisy", string = "fl_plantlife:oxeye_daisy",
@@ -77,8 +76,6 @@ local materials = {
birch_planks = "fl_trees:aspen_plank", birch_planks = "fl_trees:aspen_plank",
jungle_leaves = "fl_trees:jungletree_leaves", jungle_leaves = "fl_trees:jungletree_leaves",
bowl = "", bowl = "",
stick = "fl_trees:stick",
obsidian = "",
} }
if minetest.get_modpath("basic_materials") then if minetest.get_modpath("basic_materials") then

View File

@@ -46,7 +46,6 @@ local materials = {
dye_orange = "dye:orange", dye_orange = "dye:orange",
dye_pink = "dye:pink", dye_pink = "dye:pink",
dye_cyan = "dye:cyan", dye_cyan = "dye:cyan",
dye_magenta = "dye:magenta",
silicon = "hades_materials:silicon", silicon = "hades_materials:silicon",
string = "hades_farming:string", string = "hades_farming:string",
paper = "hades_core:paper", paper = "hades_core:paper",
@@ -84,8 +83,6 @@ local materials = {
jungle_leaves = "hades_trees:jungle_leaves", jungle_leaves = "hades_trees:jungle_leaves",
--hades has no bowl but you get plate on eat so makes most sense? --hades has no bowl but you get plate on eat so makes most sense?
bowl = "hades_food:plate", bowl = "hades_food:plate",
stick = "hades_core:stick",
obsidian = "hades_core:obsidian",
} }
if minetest.get_modpath("hades_bucket") then if minetest.get_modpath("hades_bucket") then

View File

@@ -1,8 +1,5 @@
--note this file handles mineclonia, mineclone2, and its rename voxelibre --note this file handles mineclonia, mineclone2, and its rename voxelibre
local mcl_dyes = minetest.get_modpath("mcl_dyes")
local mcl_dyes_name = mcl_dyes and "mcl_dyes" or "mcl_dye"
local materials = { local materials = {
sand = "mcl_core:sand", sand = "mcl_core:sand",
sandstone = "mcl_core:sandstone", sandstone = "mcl_core:sandstone",
@@ -12,41 +9,43 @@ local materials = {
steel_ingot = "mcl_core:iron_ingot", steel_ingot = "mcl_core:iron_ingot",
gold_ingot = "mcl_core:gold_ingot", gold_ingot = "mcl_core:gold_ingot",
tin_ingot = "mcl_core:iron_ingot", tin_ingot = "mcl_core:iron_ingot",
copper_block = "mcl_copper:block", copper_block = "mcl_copper:copper_block",
steel_block = "mcl_core:ironblock", steel_block = "mcl_core:iron_block",
gold_block = "mcl_core:goldblock", gold_block = "mcl_core:gold_block",
tin_block = "mcl_core:ironblock", tin_block = "mcl_core:iron_block",
axe_steel = "mcl_core:axe_steel", axe_steel = "mcl_core:axe_steel",
axe_diamond = "mcl_core:axe_diamond", axe_diamond = "mcl_core:axe_diamond",
axe_bronze = "mcl_core:axe_bronze", axe_bronze = "mcl_core:axe_bronze",
axe_stone = "mcl_core:axe_stone", axe_stone = "mcl_core:axe_stone",
axe_wood = "mcl_core:axe_wood", axe_wood = "mcl_core:axe_wood",
pick_steel = "mcl_core:pick_steel", pick_steel = "mcl_core:pick_steel",
mese = "mesecons_torch:redstoneblock",
mese_crystal = "mesecons:redstone",
mese_crystal_fragment = "mcl_core:iron_ingot",
torch = "mcl_torches:torch", torch = "mcl_torches:torch",
diamond = "mcl_core:diamond", diamond = "mcl_core:diamond",
clay_lump = "mcl_core:clay_lump", clay_lump = "default:clay_lump",
water_bucket = "mcl_buckets:bucket_water", water_bucket = "mcl_buckets:bucket:bucket_water",
empty_bucket = "mcl_buckets:bucket_empty", empty_bucket = "mcl_buckets:bucket_empty",
dye_dark_grey = mcl_dyes_name .. ":dark_grey", dye_dark_grey = "mcl_dyes:dark_grey",
dye_black = mcl_dyes_name .. ":black", dye_black = "mcl_dyes:black",
dye_white = mcl_dyes_name .. ":white", dye_white = "mcl_dyes:white",
dye_green = mcl_dyes_name .. ":green", dye_green = "mcl_dyes:green",
dye_red = mcl_dyes_name .. ":red", dye_red = "mcl_dyes:red",
dye_yellow = mcl_dyes_name .. ":yellow", dye_yellow = "mcl_dyes:yellow",
dye_brown = mcl_dyes_name .. ":brown", dye_brown = "mcl_dyes:brown",
dye_blue = mcl_dyes_name .. ":blue", dye_blue = "mcl_dyes:blue",
dye_violet = mcl_dyes_name .. ":violet", dye_violet = "mcl_dyes:violet",
dye_grey = mcl_dyes_name .. ":grey", dye_grey = "mcl_dyes:grey",
dye_dark_green = mcl_dyes_name .. ":dark_green", dye_dark_green = "mcl_dyes:dark_green",
dye_orange = mcl_dyes_name .. ":orange", dye_orange = "mcl_dyes:orange",
dye_pink = mcl_dyes_name .. ":pink", dye_pink = "mcl_dyes:pink",
dye_cyan = mcl_dyes_name .. ":cyan", dye_cyan = "mcl_dyes:cyan",
dye_magenta = mcl_dyes_name .. ":magenta",
silicon = "mcl_core:iron_ingot", silicon = "mcl_core:iron_ingot",
string = "mcl_mobitems:string", string = "mcl_mobitems:string",
paper = "mcl_core:paper", paper = "mcl_core:paper",
book = "mcl_books:book", book = "mcl_core:book",
iron_lump = "mcl_raw_ores:raw_iron", iron_lump = "mcl_core:stone_with_iron",
wool_grey = "mcl_wool:grey", wool_grey = "mcl_wool:grey",
wool_green = "mcl_wool:green", wool_green = "mcl_wool:green",
wool_dark_green = "mcl_wool:dark_green", wool_dark_green = "mcl_wool:dark_green",
@@ -57,8 +56,8 @@ local materials = {
slab_wood = "mcl_stairs:slab_wood", slab_wood = "mcl_stairs:slab_wood",
glass = "mcl_core:glass", glass = "mcl_core:glass",
glass_block = "mcl_core:glass", glass_block = "mcl_core:glass",
glass_bottle = "mcl_potions:glass_bottle", glass_bottle = "mcl_core:glass_bottle",
coal_lump = "mcl_core:coal_lump", coal_lump = "mcl_core:coal",
stone = "mcl_core:stone", stone = "mcl_core:stone",
desert_stone = "mcl_core:redsandstone", desert_stone = "mcl_core:redsandstone",
desert_sand = "mcl_core:sand", desert_sand = "mcl_core:sand",
@@ -70,49 +69,14 @@ local materials = {
water_flowing = "mcl_core:water_flowing", water_flowing = "mcl_core:water_flowing",
dirt = "mcl_core:dirt", dirt = "mcl_core:dirt",
dirt_with_grass = "mcl_core:dirt_with_grass", dirt_with_grass = "mcl_core:dirt_with_grass",
apple_leaves = "mcl_trees:leaves_oak",
apple_log = "mcl_trees:tree_oak",
apple_planks = "mcl_trees:wood_oak",
birch_leaves = "mcl_trees:leaves_birch",
birch_log = "mcl_trees:tree_birch",
birch_planks = "mcl_trees:wood_birch",
jungle_leaves = "mcl_trees:leaves_jungle",
bowl = "mcl_core:bowl", bowl = "mcl_core:bowl",
stick = "mcl_core:stick",
obsidian = "mcl_core:obsidian",
} }
if minetest.get_modpath("mcl_redstone") then return materials
materials.mese = "mcl_redstone_torch:redstoneblock"
materials.mese_crystal = "mcl_redstone:redstone"
materials.mese_crystal_fragment = "mcl_core:iron_ingot"
else
materials.mese = "mesecons_torch:redstoneblock"
materials.mese_crystal = "mesecons:redstone"
materials.mese_crystal_fragment = "mcl_core:iron_ingot"
end
if minetest.get_modpath("mcl_trees") then
materials.apple_leaves = "mcl_trees:leaves_oak"
materials.apple_log = "mcl_trees:tree_oak"
materials.apple_planks = "mcl_trees:wood_oak"
materials.birch_leaves = "mcl_trees:leaves_birch"
materials.birch_log = "mcl_trees:tree_birch"
materials.birch_planks = "mcl_trees:wood_birch"
materials.jungle_leaves = "mcl_trees:leaves_jungle"
else
materials.apple_leaves = "mcl_core:leaves"
materials.apple_log = "mcl_core:tree"
materials.apple_planks = "mcl_core:wood"
materials.birch_leaves = "mcl_core:birchleaves"
materials.birch_log = "mcl_core:birchtree"
materials.birch_planks = "mcl_core:birchwood"
materials.jungle_leaves = "mcl_core:jungleleaves"
end
if minetest.get_modpath("moreores") then
materials.tin_ingot = "moreores:tin_ingot"
materials.tin_block = "moreores:tin_block"
materials.silver_ingot = "moreores:silver_ingot"
end
if minetest.get_modpath("technic") then
materials.lead_ingot = "technic:lead_ingot"
materials.carbon_steel_ingot = "technic:carbon_steel_ingot"
materials.stainless_steel_ingot = "technic:stainless_steel_ingot"
end
return materials

View File

@@ -39,7 +39,6 @@ local materials = {
dye_orange = "dye:orange", dye_orange = "dye:orange",
dye_pink = "dye:pink", dye_pink = "dye:pink",
dye_cyan = "dye:cyan", dye_cyan = "dye:cyan",
dye_magenta = "dye:magenta",
silicon = "mesecons_materials:silicon", silicon = "mesecons_materials:silicon",
string = "farming:string", string = "farming:string",
paper = "default:paper", paper = "default:paper",
@@ -76,8 +75,6 @@ local materials = {
birch_planks = "default:aspen_wood", birch_planks = "default:aspen_wood",
jungle_leaves = "default:jungleleaves", jungle_leaves = "default:jungleleaves",
bowl = "", bowl = "",
stick = "default:stick",
obsidian = "default:obsidian",
} }
if minetest.registered_items["farming:bowl"] then if minetest.registered_items["farming:bowl"] then

View File

@@ -1,8 +0,0 @@
local filename = xcompat.gameid
--if we dont have a player file for the game, use minetest
if not xcompat.utilities.file_exists(xcompat.modpath .. "/src/player/" .. filename .. ".lua") then
filename = "xcompat_agnostic"
end
return dofile(xcompat.modpath .. "/src/player/" .. filename .. ".lua")

View File

@@ -1,51 +0,0 @@
local papi = {}
local models = {}
function papi.register_model(name, def)
models[name] = def
end
function papi.set_model(player, model_name)
local model = models[model_name]
if not model then return end
player:set_properties({
mesh = model_name,
textures = model.textures,
visual = "mesh",
visual_size = model.visual_size,
stepheight = model.stepheight
})
end
function papi.get_animation(_)
--stub to keep from crashing
end
function papi.get_textures(player)
return player:get_properties().textures
end
function papi.set_textures(player, textures)
player:set_properties({textures = textures})
end
function papi.set_animation(player, anim_name, speed, loop)
player:set_animation(fl_player.animations[anim_name], speed, 0, loop)
end
local metatable = {
__index = function (_, key)
return fl_player.ignore[key]
end,
__newindex = function (_, key, value)
rawset(fl_player.ignore, key, value)
end
}
papi.player_attached = {}
setmetatable(papi.player_attached, metatable)
return papi

View File

@@ -1,40 +0,0 @@
local papi = {}
function papi.register_model(name, def)
return mcl_player.player_register_model(name, def)
end
function papi.set_model(player, model)
return mcl_player.player_set_model(player, model)
end
function papi.get_animation(player)
return mcl_player.player_get_animation(player)
end
function papi.get_textures(player)
return player:get_properties().textures
end
function papi.set_textures(player, textures)
player:set_properties({textures = textures})
end
function papi.set_animation(player, anim_name, speed, _)
return mcl_player.player_set_animation(player, anim_name, speed)
end
local metatable = {
__index = function (_, key)
return mcl_player.player_attached[key]
end,
__newindex = function (_, key, value)
rawset(mcl_player.player_attached, key, value)
end
}
papi.player_attached = {}
setmetatable(papi.player_attached, metatable)
return papi

View File

@@ -1,41 +0,0 @@
local papi = {}
function papi.register_model(name, def)
return player_api.register_model(name, def)
end
function papi.set_model(player, model)
return player_api.set_model(player, model)
end
function papi.get_animation(player)
return player_api.get_animation(player)
end
function papi.get_textures(player)
return player_api.get_textures(player)
end
function papi.set_textures(player, texture)
return player_api.set_textures(player, texture)
end
function papi.set_animation(player, anim_name, speed, loop)
return player_api.set_animation(player, anim_name, speed, loop)
end
local metatable = {
__index = function (_, key)
return player_api.player_attached[key]
end,
__newindex = function (_, key, value)
rawset(player_api.player_attached, key, value)
end
}
papi.player_attached = {}
setmetatable(papi.player_attached, metatable)
return papi

View File

@@ -1,41 +0,0 @@
local papi = {}
local models = {}
function papi.register_model(name, def)
models[name] = def
end
function papi.set_model(player, model_name)
local model = models[model_name]
if not model then return end
player:set_properties({
mesh = model_name,
textures = model.textures,
visual = "mesh",
visual_size = model.visual_size,
stepheight = model.stepheight
})
end
function papi.get_animation(_)
--stub to keep from crashing
end
function papi.get_textures(player)
return player:get_properties().textures
end
function papi.set_textures(player, textures)
player:set_properties({textures = textures})
end
function papi.set_animation(_, _, _, _)
--stub to keep from crashing
end
--nothing to do here as we have no globalstep .....that we know about anyways
papi.player_attached = {}
return papi

View File

@@ -1,8 +0,0 @@
local filename = xcompat.gameid
--if we dont have a stairs file for the game, use xcompat_agnostic
if not xcompat.utilities.file_exists(xcompat.modpath .. "/src/stairs/" .. filename .. ".lua") then
filename = "xcompat_agnostic"
end
return dofile(xcompat.modpath .. "/src/stairs/" .. filename .. ".lua")

View File

@@ -1,25 +0,0 @@
local function register(name, _)
local splitName = name:split(":")
local sName = splitName[2]
local groups = core.registered_nodes[name].groups
groups.stairable = 1
core.override_item(name, {groups = groups})
local flStairNameOverrides = {
["stair_inner"] = "inner_stair",
["stair_outer"] = "outer_stair"
}
for _, type in pairs({"slab", "stair", "stair_inner", "stair_outer"}) do
minetest.register_alias(
splitName[1] .. ":" .. type .. "_" .. sName,
splitName[1] .. ":" .. sName .. "_" .. (flStairNameOverrides[type] or type)
)
end
end
return {register = register}

View File

@@ -1,19 +0,0 @@
local function register(name, def)
local splitName = name:split(":")
local sName = splitName[2]
stairs.register_stair_and_slab(
sName,
nil,
def.groups,
def.tiles,
def.description,
def.sounds
)
for _, type in pairs({"slab", "stair", "stair_inner", "stair_outer"}) do
minetest.register_alias(splitName[1] .. ":" .. type .. "_" .. sName, "stairs:" .. type .. "_" .. sName)
end
end
return {register = register}

View File

@@ -1,48 +0,0 @@
local stairtable = {
{
"slab",
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
{
"stair",
{
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
},
},
{
"stair_inner",
{
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
{-0.5, 0.0, 0.0, 0.5, 0.5, 0.5},
{-0.5, 0.0, -0.5, 0.0, 0.5, 0.0},
},
},
{
"stair_outer",
{
{-0.5, -0.5, -0.5, 0.5, 0.0, 0.5},
{-0.5, 0.0, 0.0, 0.0, 0.5, 0.5},
},
},
}
local function register(name, def)
for _, sdef in pairs(stairtable) do
local split = name:split(":")
local ndef = table.copy(def)
local item_name = ":" .. sdef[1] .. "_" .. split[2]
ndef.description = def.description .. " " .. string.gsub(sdef[1], "_", " ")
ndef.paramtype, ndef.paramtype2 = "light", "facedir"
ndef.drawtype = "nodebox"
ndef.node_box = {
type = "fixed",
fixed = sdef[2],
}
minetest.register_node(":" .. split[1] .. item_name, ndef)
end
end
return {register = register}

View File

@@ -1,356 +0,0 @@
fl_furniture:yellow_ipe_table
fl_trees:palm_trunk
fl_stone:mossy_stone
fl_trees:acacia_sapling
fl_doors:copper_door_a
fl_trees:jungletree_plank
fl_workshop:furnace_active
fl_topsoil:wet_farmland
fl_trees:spruce_leaves
fl_stone:stone_brick
fl_light_sources:lantern
fl_plantlife:red_mushroom_leaves
fl_stone:basalt
fl_topsoil:condensed_ice
fl_doors:apple_door_b
fl_beds:bed_pink
fl_plantlife:petunia_blue
fl_trees:acacia_leaves
fl_stone:basalt_block
fl_ores:coal_in_tuff
fl_topsoil:sea_grass_3
fl_agriculture:carrot_2
fl_beds:bed_violet
fl_stone:basalt_rubble
fl_furniture:spruce_bench
fl_ores:copper_in_tuff
fl_trees:willow_plank
fl_trees:yellow_ipe_plank_fence
fl_storage:spruce_vessel_shelf
fl_beds:bed_blue
fl_stone:stone_block
fl_stone:tuff_rubble
fl_ores:mithite_in_stone
fl_topsoil:savannah_dirt_with_grass
fl_furniture:pine_table
fl_trees:pine_plank_fence
fl_furniture:baobab_chair
fl_plantlife:grass_2
fl_trees:pine_sapling
fl_beds:bed_dark_green
fl_plantlife:cactus
fl_storage:spruce_book_shelf
fl_signs:sign_wood
fl_plantlife:pink_ground_flower
fl_doors:steel_door_b
fl_topsoil:sea_grass_1
fl_trees:aspen_leaves
fl_stone:ors_brick
fl_doors:jungletree_door_a
fl_paintings:forest
fl_storage:spruce_multi_shelf
fl_beds:bed_red
fl_tnt:tnt
fl_beds:bed_brown
fl_storage:pine_multi_shelf
fl_ores:mithite_block
fl_beds:bed_orange
fl_ores:coal_in_desert_stone
fl_plantlife:red_ground_flower
fl_ores:gold_in_desert_stone
fl_stone:silver_sandstone_block
fl_storage:wood_chest
fl_furniture:aspen_table
fl_doors:aspen_door_a
fl_stone:ors
fl_stone:sandstone_brick
fl_doors:pine_door_b
fl_furniture:acacia_table
fl_trees:acacia_trunk
fl_stone:mossy_stone_block
fl_doors:baobab_door_b
fl_plantlife:pansy_purple
fl_industrial:conveyor_funnel
fl_stone:savannah_rubble
fl_trains:straight_rise_track
fl_storage:baobab_book_shelf
fl_plantlife:purple_allium
fl_ores:diamond_block
fl_topsoil:dirt_with_grass
fl_plantlife:ground_waterlily
fl_plantlife:flowerpot
fl_plantlife:grass_4
fl_storage:pine_book_shelf
fl_doors:palm_door_a
fl_furniture:willow_table
fl_trains:straight_45_track
fl_trees:palm_leaves
fl_glass:framed_glass_panes
fl_storage:yellow_ipe_vessel_shelf
fl_ores:coal_block
fl_plantlife:dandelion_yellow
fl_beds:bed_cyan
fl_topsoil:gravel
fl_storage:acacia_book_shelf
fl_furniture:baobab_bench
fl_furniture:willow_bench
fl_plantlife:savannah_grass_1
fl_industrial:conveyor
fl_storage:acacia_vessel_shelf
fl_light_sources:chain
fl_trees:spruce_plank
fl_trees:apple_leaves
fl_trees:baobab_leaves
fl_stone:silver_sand
fl_stone:desert_stone
fl_furniture:spruce_chair
fl_ores:copper_in_desert_stone
fl_topsoil:snow_block
fl_ores:mithite_in_savannah
fl_trees:acacia_plank
fl_topsoil:dirt
fl_fire:fire
fl_stone:gneiss_rubble
fl_furniture:acacia_bench
fl_storage:willow_vessel_shelf
fl_plantlife:lantana
fl_stone:sandstone
fl_furniture:jungletree_chair
fl_workshop:furnace
fl_stone:gneiss
fl_agriculture:potato_4
fl_topsoil:permafrost_with_stones
fl_topsoil:snow
fl_trees:baobab_plank
fl_stone:tuff_brick
fl_stone:desert_sandstone_block
fl_bones:bone_block
fl_stone:basalt_brick
fl_doors:steel_door_a
fl_furniture:aspen_bench
fl_ores:tin_in_savannah
fl_trees:palm_plank_fence
fl_doors:apple_door_a
fl_wool:wool
fl_furniture:spruce_table
fl_agriculture:carrot_1
fl_ores:iron_in_stone
fl_stone:desert_sandstone_brick
fl_storage:apple_empty_shelf
fl_stone:gneiss_block
fl_stone:mossy_stone_rubble
fl_agriculture:carrot_3
fl_trees:willow_trunk
fl_trees:pine_leaves
fl_trains:curve_right_track
fl_doors:copper_door_b
fl_doors:jungletree_door_b
fl_furniture:jungletree_bench
fl_doors:willow_door_b
fl_topsoil:sea_grass_2
fl_ores:gold_in_ors
fl_doors:willow_door_a
fl_trains:switch_right_track
fl_doors:aspen_door_b
fl_doors:palm_door_b
fl_stone:stone
fl_plantlife:rose
fl_doors:yellow_ipe_door_b
fl_doors:yellow_ipe_door_a
fl_plantlife:grass_3
fl_storage:apple_vessel_shelf
fl_plantlife:tulip
fl_light_sources:torch
fl_trees:palm_sapling
fl_doors:blocker_top
fl_bricks:terracotta
fl_bricks:clay_block
fl_bricks:brick
fl_agriculture:carrot_4
fl_paintings:cthulhu
fl_trees:aspen_trunk
fl_furniture:willow_chair
fl_glass:tinted_framed_glass_panes
fl_stone:sandstone_block
fl_glass:tinted_framed_glass
fl_ores:gold_block
fl_furniture:apple_chair
fl_glass:framed_glass
fl_storage:pine_vessel_shelf
fl_beds:bed_yellow
fl_beds:bed_black
fl_stone:silver_sandstone
fl_beds:bed_dark_grey
fl_beds:bed_green
fl_ores:tin_in_tuff
fl_beds:bed_grey
fl_beds:bed_magenta
fl_beds:bed_white
fl_wildlife:spawner
fl_wool:wool_carpet
fl_paintings:dragon
fl_topsoil:dirt_with_snow
fl_ores:tin_block
fl_furniture:baobab_table
fl_dyes:demo_node
fl_plantlife:viola
fl_ores:diamond_in_ors
fl_plantlife:savannah_grass_4
fl_plantlife:oxeye_daisy
fl_plantlife:geranium
fl_plantlife:mushroom_trunk
fl_stone:ors_rubble
fl_doors:baobab_door_a
fl_light_sources:lantern_c
fl_doors:acacia_door_b
fl_plantlife:petunia_white
fl_storage:spruce_empty_shelf
fl_plantlife:petunia_pink
fl_ores:tin_in_stone
fl_ores:mithite_in_desert_stone
fl_stone:desert_sand
fl_plantlife:pansy_blue
fl_plantlife:frozen_rose
fl_ores:gold_in_tuff
fl_stone:savannah_brick
fl_ores:coal_in_savannah
fl_plantlife:blue_ground_flower
fl_ores:iron_in_desert_stone
fl_industrial:injector
fl_trees:aspen_plank_fence
fl_plantlife:savannah_grass_2
fl_plantlife:dandelion_white
fl_plantlife:flame_lily
fl_plantlife:brown_mushroom
fl_plantlife:red_mushroom
fl_trees:jungletree_plank_fence
fl_plantlife:brown_mushroom_leaves
fl_plantlife:raw_mushroom_leaves
fl_plantlife:savannah_grass_5
fl_stone:tuff_block
fl_plantlife:savannah_grass_3
fl_trees:acacia_plank_fence
fl_trees:jungletree_sapling
fl_furniture:pine_bench
fl_plantlife:grass_1
fl_plantlife:lavender_flower
fl_ores:coal_in_stone
fl_plantlife:grass_5
fl_ores:bronze_block
fl_trees:yellow_ipe_plank
fl_stone:gneiss_brick
fl_ores:diamond_in_savannah
fl_trees:pine_plank
fl_ores:diamond_in_desert_stone
fl_ores:diamond_in_tuff
fl_storage:baobab_empty_shelf
fl_storage:yellow_ipe_empty_shelf
fl_paintings:landscape
fl_stairs:tablesaw
fl_furniture:yellow_ipe_chair
fl_ores:copper_in_ors
fl_trees:apple_trunk
fl_trees:yellow_ipe_leaves
fl_trees:dead_aspen_leaves
fl_liquids:water_flowing
fl_furniture:aspen_chair
fl_plantlife:lobelia
fl_topsoil:dry_farmland
fl_trees:apple_plank
ignore
fl_trains:switch_left_track
fl_storage:willow_empty_shelf
fl_trees:spruce_plank_fence
fl_ores:copper_in_savannah
fl_stone:sand
fl_furniture:pine_chair
fl_storage:aspen_empty_shelf
fl_topsoil:coarse_dirt
fl_storage:acacia_multi_shelf
fl_ores:mithite_in_ors
fl_paintings:waterlilie
fl_stone:tuff
fl_stone:savannah_block
fl_trees:willow_plank_fence
fl_storage:baobab_vessel_shelf
fl_furniture:apple_table
fl_paintings:rose
fl_liquids:river_water_source
fl_trees:pine_trunk
fl_storage:aspen_vessel_shelf
fl_topsoil:ice
fl_storage:aspen_book_shelf
fl_liquids:lava_source
fl_agriculture:potato_2
fl_storage:aspen_multi_shelf
fl_storage:willow_book_shelf
fl_furniture:acacia_chair
fl_trains:crossing_track
fl_trees:apple_plank_fence
fl_liquids:river_water_flowing
fl_trees:baobab_sapling
fl_ores:gold_in_stone
fl_trains:curve_left_track
fl_trains:straight_track
fl_doors:acacia_door_a
fl_storage:apple_multi_shelf
fl_trees:aspen_plank
fl_trees:spruce_trunk
fl_stone:desert_stone_rubble
fl_trees:baobab_trunk
fl_ores:copper_in_stone
fl_industrial:conveyor_left
fl_storage:acacia_empty_shelf
fl_trees:palm_plank
fl_agriculture:potato_1
fl_trees:apple_sapling
fl_trees:baobab_plank_fence
fl_furniture:yellow_ipe_bench
fl_ores:tin_in_desert_stone
fl_furniture:palm_bench
fl_storage:yellow_ipe_book_shelf
fl_stone:savannah
fl_furniture:apple_bench
fl_ores:iron_block
fl_furniture:palm_chair
fl_glass:tinted_connected_glass
fl_agriculture:potato_3
fl_trees:aspen_sapling
fl_storage:baobab_multi_shelf
fl_storage:willow_multi_shelf
fl_furniture:palm_table
fl_furniture:jungletree_table
fl_trees:jungletree_trunk
fl_stone:stone_rubble
fl_doors:pine_door_a
fl_storage:pine_empty_shelf
fl_stone:mossy_stone_brick
fl_stone:ors_block
fl_paintings:possessedwoman
fl_storage:apple_book_shelf
fl_storage:yellow_ipe_multi_shelf
fl_stone:desert_stone_block
fl_stone:desert_stone_brick
fl_trees:jungletree_leaves
fl_liquids:water_source
fl_stone:desert_sandstone
fl_trees:willow_leaves
fl_workshop:anvil
fl_paintings:mistiriusgirl
fl_trees:yellow_ipe_trunk
fl_topsoil:savannah_dirt
fl_ores:coal_in_ors
fl_topsoil:permafrost
fl_liquids:lava_flowing
fl_ores:iron_in_ors
fl_industrial:conveyor_right
fl_ores:iron_in_tuff
fl_ores:iron_in_savannah
fl_ores:copper_block
fl_stone:silver_sandstone_brick
air
fl_ores:gold_in_savannah
fl_ores:tin_in_ors
fl_ores:mithite_in_tuff
fl_stone:bedrock
fl_ores:diamond_in_stone

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff