summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSokomine <wegwerf@anarres.dyndns.org>2015-07-31 00:15:49 +0200
committerSokomine <wegwerf@anarres.dyndns.org>2015-07-31 00:15:49 +0200
commitaf0787a420d95337941af85b6634eee0014cc40c (patch)
tree258476ed29b6c0ee615fb2f478e7578046f19537
parent050005c6cfa04620e112b592620a32147b0f82ff (diff)
the table now acts as a workbench in realtest and adventuretest
-rw-r--r--nodes_furniture.lua25
1 files changed, 22 insertions, 3 deletions
diff --git a/nodes_furniture.lua b/nodes_furniture.lua
index fcb5da7..2c03b10 100644
--- a/nodes_furniture.lua
+++ b/nodes_furniture.lua
@@ -145,7 +145,7 @@ minetest.register_node("cottages:bench", {
-- a simple table; possible replacement: 3dforniture:table
-minetest.register_node("cottages:table", {
+local cottages_table_def = {
description = S("table"),
drawtype = "nodebox",
-- top, bottom, side1, side2, inner, outer
@@ -167,8 +167,27 @@ minetest.register_node("cottages:table", {
},
},
is_ground_content = false,
-})
-
+}
+
+
+-- search for the workbench in AdventureTest
+local workbench = minetest.registered_nodes[ "workbench:3x3"];
+if( workbench ) then
+ cottages_table_def.tiles = {workbench.tiles[1], cottages_table_def.tiles[1]};
+ cottages_table_def.on_rightclick = workbench.on_rightclick;
+end
+-- search for the workbench from RealTEst
+workbench = minetest.registered_nodes[ "workbench:work_bench_birch"];
+if( workbench ) then
+ cottages_table_def.tiles = {workbench.tiles[1], cottages_table_def.tiles[1]};
+ cottages_table_def.on_construct = workbench.on_construct;
+ cottages_table_def.can_dig = workbench.can_dig;
+ cottages_table_def.on_metadata_inventory_take = workbench.on_metadata_inventory_take;
+ cottages_table_def.on_metadata_inventory_move = workbench.on_metadata_inventory_move;
+ cottages_table_def.on_metadata_inventory_put = workbench.on_metadata_inventory_put;
+end
+
+minetest.register_node("cottages:table", cottages_table_def );
-- looks better than two slabs impersonating a shelf; also more 3d than a bookshelf
-- the infotext shows if it's empty or not