Debian Codegraph @

tests/inputs/double_doors.dsc

raw
1 doubledoors_world:
2 type: world
3 debug: false
4 events:
5 # Use monitor to allow the event to be cancelled by any other scripts or plugins
6 # But use 'on' to make the door move as immediately as possible
7 on player right clicks *_door bukkit_priority:monitor:
8 # Iron doors aren't opened on click
9 - if <context.location.material.name> == iron_door:
10 - stop
11 - define face <context.location.block_facing>
12 # A door faces outward, rotate the outward face opposite the direction of the hinge to get the other door
13 - if <context.location.material.hinge> == left:
14 # Note: pi/2 is radian equivalent of 90 degrees.
15 - define face <[face].rotate_around_y[-<util.pi.div[2]>]>
16 - else:
17 - define face <[face].rotate_around_y[<util.pi.div[2]>]>
18 - define door2 <context.location.add[<[face]>]>
19 # Check that the double door *exists*
20 - if <[door2].material.name> == <context.location.material.name>:
21 - switch <[door2]>