Date: 2015/01/09 11:36:27 UTC-08:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
lumigatecommands:
type: world
debug: false
events:
on lumigate command:
- inject locally path:lumigatecommandhandler
on lg command:
- inject locally path:lumigatecommandhandler
on gate command:
- inject locally path:lumigatecommandhandler
lumigatecommandhandler:
- if <context.args.get[1]> == create inject locally path:lumigatecreate
- if li@delete|remove contains <context.args.get[1]> inject locally path:lumigatedelete
- if <context.args.get[1]> == redefine inject locally path:lumigateredefine
- if <context.args.get[1]> == redirect inject locally path:lumigateredirect
- if <context.args.get[1]> == list inject locally path:lumigatelist
- if <context.args.get[1]> == locate inject locally path:lumigatelocate
- if <context.args.get[1]> == help inject locally path:lumigatehelp
- determine fulfilled
lumigatehelp:
- narrate "<&e>/lg create [gatename] <&6>Creates a gate on your world edit selection with your location as destination. (selection must be made by right clicking with wand.)"
- narrate "<&e>/lg delete [gatename] <&6>Deletes the specified gate entirely."
- narrate "<&e>/lg redefine [gatename] <&6>Redefines the specified gate area to your current world edit selection."
- narrate "<&e>/lg redirect [gatename] <&6>Sets the destination of the specified gate to your current location."
- narrate "<&e>/lg list <&6>Lists the existing gates."
- narrate "<&e>/lg locate [gatename] <&6>Tells you the locations of the specified gates and temporary highlights them with redstone blocks."
lumigatecreate:
- if <player.has_permission[lumigate.create]> {
- if !<player.has_flag[worldeditcuboid1]> || !<player.has_flag[worldeditcuboid2]> {
- narrate "<&c>Please make a World Edit selection first."
} else {
- if <context.args.size> > 1 {
- if <yaml[lumigatesaves].list_keys[lumigates]> !contains <context.args.get[2]> {
- yaml id:lumigatesaves set lumigates.<context.args.get[2]>:->:<player.flag[worldeditcuboid1]>|<player.flag[worldeditcuboid2]>
- yaml id:lumigatesaves set lumigates.<context.args.get[2]>:->:<player.location>
- note cu@<yaml[lumigatesaves].read[lumigates.<context.args.get[2]>].as_list.get[1].replace[li@]> as:<context.args.get[2]>
- narrate "<&6>You created the <&e><context.args.get[2]> <&6>lumigate."
} else {
- narrate "<&c>This gate already exists!"
}
} else {
- narrate "<&c>Please specify a gate name."
}
}
} else {
- narrate "<&c>You do not have the permission to do this."
}
lumigatedelete:
- if <player.has_permission[lumigate.delete]> {
- if <context.args.size> > 1 {
- if <yaml[lumigatesaves].list_keys[lumigates]> contains <context.args.get[2]> {
- yaml id:lumigatesaves set lumigates.<context.args.get[2]>:!
- narrate "<&6>You deleted the <&e><context.args.get[2]><&6> lumigate."
} else {
- narrate "<&c>This gate doesn't exists!"
}
} else {
- narrate "<&c>Please specify a gate name."
}
} else {
- narrate "<&c>You do not have the permission to do this."
}
lumigateredefine:
- if <player.has_permission[lumigate.redefine]> {
- if !<player.has_flag[worldeditcuboid1]> || !<player.has_flag[worldeditcuboid2]> {
- narrate "<&c>Please make a World Edit selection first."
} else {
- if <context.args.size> > 1 {
- if <yaml[lumigatesaves].list_keys[lumigates]> contains <context.args.get[2]> {
- yaml id:lumigatesaves set lumigates.<context.args.get[2]>[1]:<player.flag[worldeditcuboid1]>|<player.flag[worldeditcuboid2]>
- note cu@<yaml[lumigatesaves].read[lumigates.<context.args.get[2]>].as_list.get[1].replace[li@]> as:<context.args.get[2]>
- narrate "<&6>You redefined the <&e><context.args.get[2]> <&6>lumigate."
} else {
- narrate "<&c>This gate doesn't exists!"
}
} else {
- narrate "<&c>Please specify a gate name."
}
}
} else {
- narrate "<&c>You do not have the permission to do this."
}
lumigateredirect:
- if <player.has_permission[lumigate.redirect]> {
- if <context.args.size> > 1 {
- if <yaml[lumigatesaves].list_keys[lumigates]> contains <context.args.get[2]> {
- yaml id:lumigatesaves set lumigates.<context.args.get[2]>[2]:<player.location>
- narrate "<&6>You redirected the <&e><context.args.get[2]> <&6>lumigate."
} else {
- narrate "<&c>This gate doesn't exists!"
}
} else {
- narrate "<&c>Please specify a gate name."
}
} else {
- narrate "<&c>You do not have the permission to do this."
}
lumigatelist:
- if <player.has_permission[lumigate.list]> {
- narrate "<&6>Existing lumigates<&co> <&e><yaml[lumigatesaves].list_keys[lumigates].formatted><&6>."
} else {
- narrate "<&c>You do not have the permission to do this."
}
lumigatelocate:
- if <player.has_permission[lumigate.locate]> {
- if <context.args.size> > 1 {
- if <yaml[lumigatesaves].list_keys[lumigates]> contains <context.args.get[2]> {
- narrate "<&e><context.args.get[2]> <&6>is located from <&e><<yaml[lumigatesaves].read[lumigates.<context.args.get[2]>].as_list.get[1].before[|]>.simple.formatted><&6> to <&e><<yaml[lumigatesaves].read[lumigates.<context.args.get[2]>].as_list.get[1].after[|]>.simple.formatted><&6> and leads to <&e><<yaml[lumigatesaves].read[lumigates.<context.args.get[2]>].as_list.get[2]>.simple.formatted><&6>."
- showfake m@redstone_block <cu@<context.args.get[2]>.get_outline> duration:30s
- showfake m@redstone_block <yaml[lumigatesaves].read[lumigates.<context.args.get[2]>].as_list.get[2]> duration:30s
} else {
- narrate "<&c>This gate doesn't exists!"
}
} else {
- narrate "<&c>Please specify a gate name."
}
} else {
- narrate "<&c>You do not have the permission to do this."
}
gatestonotables:
type: task
debug: true
script:
- foreach <yaml[lumigatesaves].list_keys[lumigates]> {
- note cu@<yaml[lumigatesaves].read[lumigates.%value%].as_list.get[1].replace[li@]> as:%value%
}
lumigateotherevents:
type: world
debug: true
events:
on server start:
- run gatestonotables delay:1s instantly
on player right clicks with i@wood_axe:
- if li@m@air|m@water !contains <player.location.cursor_on[5].material> {
- flag worldeditcuboid2:<player.location.cursor_on[5]>
}
on player left clicks with i@wood_axe:
- if li@m@air|m@water !contains <player.location.cursor_on[5].material> {
- flag worldeditcuboid1:<player.location.cursor_on[5]>
}
on /pos1 command:
- flag worldeditcuboid1:<player.location>
on /pos2 command:
- flag worldeditcuboid2:<player.location>
on /sel command:
- flag worldeditcuboid2:!
- flag worldeditcuboid1:!
on player enters notable cuboid:
#- if <player.location.cuboids.size> < 1 queue clear
- foreach <context.cuboids> {
- if <yaml[lumigatesaves].list_keys[lumigates]> contains <el@val[%value%].replace[cu@]> {
- define location %value%
- teleport <yaml[lumigatesaves].read[lumigates.<el@val[%location%].replace[cu@]>].as_list.get[2]>
- if <player.is_inside_vehicle> teleport <player.get_vehicle>|<player> <yaml[lumigatesaves].read[lumigates.<el@val[%location%].replace[cu@]>].as_list.get[2]>
- foreach <%value%.list_entities> {
- teleport %value% <yaml[lumigatesaves].read[lumigates.<el@val[%location%].replace[cu@]>].as_list.get[2]>
}
- narrate "<&6>You travelled through a Lumigate!"
- playeffect <player.location.sub[0,0.5,0]> effect:ENDER_SIGNAL qty:5
- playsound <player.location> sound:enderman_teleport
}
}