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:
10
compat/adventuretest.lua
Normal file
10
compat/adventuretest.lua
Normal 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
5
compat/init.lua
Normal 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
15
compat/realtest.lua
Normal 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
|
Reference in New Issue
Block a user