From 661c130bc788975e595cb58d94e0bfc33f5b0eb4 Mon Sep 17 00:00:00 2001 From: mbartlett21 <29034492+mbartlett21@users.noreply.github.com> Date: Tue, 3 Sep 2019 16:41:28 +1000 Subject: [PATCH] Tall fences --- mods/default/functions.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 0f3cb764..daab4731 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -273,6 +273,7 @@ end -- -- Fence registration helper -- +local fence_collision_extra = minetest.settings:get_bool("enable_fence_tall") and 3/8 or 0 function default.register_fence(name, def) minetest.register_craft({ @@ -303,6 +304,16 @@ function default.register_fence(name, def) connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16}, {1/8,-5/16,-1/16,1/2,-3/16,1/16}}, }, + collision_box = { + type = "connected", + fixed = {-1/8, -1/2, -1/8, 1/8, 1/2 + fence_collision_extra, 1/8}, + -- connect_top = + -- connect_bottom = + connect_front = {-1/8,-1/2,-1/2,1/8,1/2 + fence_collision_extra,-1/8}, + connect_left = {-1/2,-1/2,-1/8,-1/8,1/2 + fence_collision_extra,1/8}, + connect_back = {-1/8,-1/2,1/8,1/8,1/2 + fence_collision_extra,1/2}, + connect_right = {1/8,-1/2,-1/8,1/2,1/2 + fence_collision_extra,1/8}, + }, connects_to = {"group:fence", "group:wood", "group:tree", "group:wall"}, inventory_image = fence_texture, wield_image = fence_texture, @@ -368,6 +379,16 @@ function default.register_fence_rail(name, def) {1/16, 3/16, -1/16, 1/2, 5/16, 1/16}, {1/16, -5/16, -1/16, 1/2, -3/16, 1/16}}, }, + collision_box = { + type = "connected", + fixed = {-1/8, -1/2, -1/8, 1/8, 1/2 + fence_collision_extra, 1/8}, + -- connect_top = + -- connect_bottom = + connect_front = {-1/8,-1/2,-1/2,1/8,1/2 + fence_collision_extra,-1/8}, + connect_left = {-1/2,-1/2,-1/8,-1/8,1/2 + fence_collision_extra,1/8}, + connect_back = {-1/8,-1/2,1/8,1/8,1/2 + fence_collision_extra,1/2}, + connect_right = {1/8,-1/2,-1/8,1/2,1/2 + fence_collision_extra,1/8}, + }, connects_to = {"group:fence", "group:wall"}, inventory_image = fence_rail_texture, wield_image = fence_rail_texture,