Skip to content

Commit

Permalink
Add choppy group to sliding doors
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklp09 authored and SmallJoker committed Dec 27, 2023
1 parent f1fdabe commit 55cc1b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
22 changes: 11 additions & 11 deletions my_sliding_doors/jdoors1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
local par = minetest.dir_to_facedir(placer:get_look_dir())
local par2 = par + 2
local above = vector.add(pos, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand Down Expand Up @@ -106,7 +106,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -150,7 +150,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -188,7 +188,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = doora,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -228,7 +228,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -268,7 +268,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand All @@ -286,7 +286,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
local pos = pointed_thing.above
local pos2 = vector.add(pos, {x=0,y=1,z=0})
local na = minetest.get_node(pos2)

if not placer or not placer:is_player() then
return
end
Expand Down Expand Up @@ -337,7 +337,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = "",
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -370,7 +370,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand All @@ -394,7 +394,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
local pos = pointed_thing.above
local pos2 = vector.add(pos, {x=0,y=1,z=0})
local na = minetest.get_node(pos2)

if not placer or not placer:is_player() then
return
end
Expand Down Expand Up @@ -445,7 +445,7 @@ local function add_door(doora, doorb, doorc, doord, num, des)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = "",
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down
13 changes: 6 additions & 7 deletions my_sliding_doors/jdoors2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ local doors = {
local function add_door(doora, doorb, doorc, doord, num)
local function onplace(itemstack, placer, pointed_thing)
local pos1 = pointed_thing.above
local pos2 = vector.add(pos, {x=0,y=1,z=0})
local pos2 = vector.add(pos1, {x=0,y=1,z=0})

if not placer or not placer:is_player() then
return
end
Expand All @@ -20,7 +20,6 @@ local function add_door(doora, doorb, doorc, doord, num)
end

local p2 = minetest.dir_to_facedir(placer:get_look_dir())
local p4 = (p2+2)%4
local pos3 = vector.add(pos1, minetest.facedir_to_dir((p2-1)%4))

local player_name = placer:get_player_name()
Expand Down Expand Up @@ -110,7 +109,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype2 = "facedir",
drop = doora,
sunlight_propagates = true,
groups = {cracky = 3},
groups = {choppy = 3, cracky = 3},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -154,7 +153,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -192,7 +191,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype2 = "facedir",
sunlight_propagates = true,
drop = doora,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down Expand Up @@ -232,7 +231,7 @@ local function add_door(doora, doorb, doorc, doord, num)
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {cracky = 1},
groups = {choppy = 1, cracky = 1},
node_box = {
type = "fixed",
fixed = {
Expand Down

0 comments on commit 55cc1b0

Please sign in to comment.