diff options
author | Blockhead <jbis1337@hotmail.com> | 2023-08-17 02:01:57 +1000 |
---|---|---|
committer | Gabriel PĂ©rez-Cerezo <gabriel@gpcf.eu> | 2023-08-16 20:26:16 +0200 |
commit | 9e5faf24870811972d2028ca51aa2ce9b5ff32e3 (patch) | |
tree | d91d69ff4a7a264487f1f8e00a7d8abce076820d | |
parent | ae059f2061e752700d69da817f217e21f8ec7170 (diff) | |
download | farebox-9e5faf24870811972d2028ca51aa2ce9b5ff32e3.tar.gz farebox-9e5faf24870811972d2028ca51aa2ce9b5ff32e3.tar.bz2 farebox-9e5faf24870811972d2028ca51aa2ce9b5ff32e3.zip |
* Make faregate unclimbable by making its collision boxes 2m tall.
* Set node dig predictions to predict not breaking, to prevent vanilla
clients on recent versions from lagging through.
* Apply the metadata inventory movement restrictions to the open gate as
well.
-rw-r--r-- | faregate.lua | 15 | ||||
-rw-r--r-- | init.lua | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/faregate.lua b/faregate.lua index 2871e54..0a739a3 100644 --- a/faregate.lua +++ b/faregate.lua @@ -19,6 +19,14 @@ minetest.register_node("farebox:faregate", { {0.0625, -0.5, -0.0625, 0.4375, 0.6875, 0}, -- NodeBox7 } }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.1, 0.5, 1.5, 0.1}, + {-0.5, -0.5, -0.4375, -0.4375, 1.5, 0.4375}, -- NodeBox3 + {0.4375, -0.5, -0.4375, 0.5, 1.5, 0.4375}, -- NodeBox5 + }, + }, mesecons = { effector = { rules = mesecon.rules.default, @@ -46,6 +54,7 @@ minetest.register_node("farebox:faregate", { allow_metadata_inventory_put = farebox.allow_metadata_inventory_put, allow_metadata_inventory_take = farebox.allow_metadata_inventory_take, allow_metadata_inventory_move = farebox.allow_metadata_inventory_move, + node_dig_prediction = "farebox:faregate", }) minetest.register_node("farebox:faregate_open", { @@ -73,7 +82,11 @@ minetest.register_node("farebox:faregate_open", { {0.375, -0.5, -0.0625, 0.4375, 0.6875, 0.3125}, -- NodeBox7 } }, - drop = "farebox:faregate" + drop = "farebox:faregate", + allow_metadata_inventory_put = farebox.allow_metadata_inventory_put, + allow_metadata_inventory_take = farebox.allow_metadata_inventory_take, + allow_metadata_inventory_move = farebox.allow_metadata_inventory_move, + node_dig_prediction = "farebox:faregate", }) minetest.register_craft({output = "farebox:faregate", @@ -186,7 +186,7 @@ minetest.register_node("farebox:farebox", { on_rightclick = function(pos, node, player, itemstack, pointed_thing) farebox.show_formspec(pos, player) end, - + node_dig_prediction = "farebox:farebox", }) minetest.register_craft({ |