1
0
mirror of https://github.com/Sokomine/cottages.git synced 2025-07-16 06:30:25 +02:00

refactor, cleanup, API, bugfixes (#1)

This commit is contained in:
fluxionary
2022-10-09 14:13:47 -07:00
committed by flux
parent dbe69bcfaf
commit 846308ef5a
106 changed files with 5594 additions and 4596 deletions

10
compat/adventuretest.lua Normal file
View File

@ -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
View File

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

15
compat/realtest.lua Normal file
View File

@ -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