1
0
spegling av https://github.com/Sokomine/cottages.git synced 2025-11-02 04:55:26 +01:00

refactor, cleanup, API, bugfixes (#1)

This commit is contained in:
fluxionary
2022-10-09 14:13:47 -07:00
committad av flux
förälder dbe69bcfaf
incheckning 846308ef5a
106 ändrade filer med 5594 tillägg och 4596 borttagningar

10
compat/adventuretest.lua Normal file
Visa fil

@@ -0,0 +1,10 @@
-- search for the workbench in AdventureTest
local workbench = minetest.registered_nodes["workbench:3x3"]
if workbench then
local cottages_table_def = minetest.registered_nodes["cottages:table"]
minetest.override_item("cottages:table", {
tiles = {workbench.tiles[1], cottages_table_def.tiles[1]},
on_rightclick = workbench.on_rightclick
})
end

5
compat/init.lua Normal file
Visa fil

@@ -0,0 +1,5 @@
if cottages.has.workbench then
cottages.dofile("compat", "adventuretest")
cottages.dofile("compat", "realtest")
end

15
compat/realtest.lua Normal file
Visa fil

@@ -0,0 +1,15 @@
-- search for the workbench from RealTest
local workbench = minetest.registered_nodes["workbench:work_bench_birch"]
if workbench then
local cottages_table_def = minetest.registered_nodes["cottages:table"]
minetest.override_item("cottages:table", {
tiles = {workbench.tiles[1], cottages_table_def.tiles[1]},
on_construct = workbench.on_construct,
can_dig = workbench.can_dig,
on_metadata_inventory_take = workbench.on_metadata_inventory_take,
on_metadata_inventory_move = workbench.on_metadata_inventory_move,
on_metadata_inventory_put = workbench.on_metadata_inventory_put,
})
end