Date: 2017/09/14 15:31:36 UTC-07: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
gpa_advancedLights_main:
type: world
debug: false
events:
on server start:
- wait 5s
- foreach <server.list_flags[gpa.advancedLights.]> {
- define f '<def[value]>'
- foreach <server.flag[<def[f]>].as_list||li@> {
- light <def[value]> <def[f].after[gpa.advancedLights.]>
}
}
on player places skull:
- if <context.item_in_hand.material> != m@human_skull || <context.item_in_hand.skull_skin.full||null> == 'null' || <context.cancelled> {
- queue clear
}
- define white_candle '<i@gpa_advancedLights_items_white_candle.skin.full>'
- define brown_candle '<i@gpa_advancedLights_items_brown_candle.skin.full>'
- define ivory_candle '<i@gpa_advancedLights_items_ivory_candle.skin.full>'
- define red_candle '<i@gpa_advancedLights_items_red_candle.skin.full>'
- define paper_lantern '<i@gpa_advancedLights_items_paper_lantern.skin.full>'
- define chinese_lantern '<i@gpa_advancedLights_items_chinese_lantern.skin.full>'
- define japanese_lantern '<i@gpa_advancedLights_items_japanese_lantern.skin.full>'
- define metal_lantern '<i@gpa_advancedLights_items_metal_lantern.skin.full>'
- define oriental_lantern '<i@gpa_advancedLights_items_oriental_lantern.skin.full>'
- define toggle_lantern '<i@gpa_advancedLights_items_toggle_lantern.skin.full>'
- define lava_bucket '<i@gpa_advancedLights_items_lava_bucket.skin.full>'
- choose <player.item_in_hand.skin.full||null>:
- case <def[white_candle]>:
- light <context.location> 6
- flag server 'gpa.advancedLights.6:->:<context.location>'
- case <def[brown_candle]>:
- light <context.location> 6
- flag server 'gpa.advancedLights.6:->:<context.location>'
- case <def[ivory_candle]>:
- light <context.location> 6
- flag server 'gpa.advancedLights.6:->:<context.location>'
- case <def[red_candle]>:
- light <context.location> 6
- flag server 'gpa.advancedLights.6:->:<context.location>'
- case <def[paper_lantern]>:
- light <context.location> 8
- flag server 'gpa.advancedLights.8:->:<context.location>'
- case <def[chinese_lantern]>:
- light <context.location> 8
- flag server 'gpa.advancedLights.8:->:<context.location>'
- case <def[japanese_lantern]>:
- light <context.location> 8
- flag server 'gpa.advancedLights.8:->:<context.location>'
- case <def[metal_lantern]>:
- light <context.location> 10
- flag server 'gpa.advancedLights.10:->:<context.location>'
- case <def[oriental_lantern]>:
- light <context.location> 11
- flag server 'gpa.advancedLights.11:->:<context.location>'
- case <def[toggle_lantern]>:
- light <context.location> 13
- flag server 'gpa.advancedLights.13:->:<context.location>'
- case <def[lava_bucket]>:
- light <context.location> 15
- flag server 'gpa.advancedLights.15:->:<context.location>'
- define ar 'cu@<player.location.sub[16,0,16]>|<player.location.add[16,0,16]>'
- adjust <def[ar].list_partial_chunks> refresh_chunk_sections
on player breaks skull:
- if <context.location.skull_type||null> != 'PLAYER' || <context.cancelled> {
- queue clear
}
- define toggle_lantern '<i@gpa_advancedLights_items_toggle_lantern.skin.full>'
- define toggle_lantern_off 'b74968df-8511-4dec-b5d7-58f31e2144c4|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDJjODFiNDM1ZGMyMmQyOWQ0Nzc4ZmZkMjJmZWI4NDZhNjhiNjQ4ZGQxYWY1ZGU4MThiNTE3ZjA1NzRkIn19fQ=='
- define lava_bucket '<i@gpa_advancedLights_items_lava_bucket.skin.full>'
- choose <context.location.skull_skin.full||null>:
- case <def[toggle_lantern_off]>:
- determine 'i@gpa_advancedLights_items_toggle_lantern'
- case <def[lava_bucket]>:
- narrate '<&c>Right click the lava bucket to pick it up!' targets:<player>
- determine 'CANCELLED'
- foreach <server.list_flags[gpa.advancedLights.]> {
- if <server.flag[<def[value]>].as_list.contains[<context.location>]||false> {
- light <context.location> reset
- flag server '<def[value]>:<-:<context.location>'
}
}
- define ar 'cu@<player.location.sub[16,0,16]>|<player.location.add[16,0,16]>'
- adjust <def[ar].list_partial_chunks> refresh_chunk_sections
on player right clicks skull:
- if <context.cancelled> {
- queue clear
}
- define toggle_lantern '<i@gpa_advancedLights_items_toggle_lantern.skin.full>'
- define toggle_lantern_off 'b74968df-8511-4dec-b5d7-58f31e2144c4|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDJjODFiNDM1ZGMyMmQyOWQ0Nzc4ZmZkMjJmZWI4NDZhNjhiNjQ4ZGQxYWY1ZGU4MThiNTE3ZjA1NzRkIn19fQ=='
- define lava_bucket '<i@gpa_advancedLights_items_lava_bucket.skin.full>'
- choose <context.location.skull_skin.full||null>:
- case <def[toggle_lantern]>:
- if <server.flag[gpa.advancedLights.13].contains[<context.location>]||false> {
- light <context.location> reset
- flag server 'gpa.advancedLights.13:<-:<context.location>'
#- adjust <context.location> 'skull_skin:<def[toggle_lantern_off]>'
}
else {
- light <context.location> 13
- flag server 'gpa.advancedLights.13:->:<context.location>'
#- adjust <context.location> 'skull_skin:<def[toggle_lantern]>'
}
- define ar 'cu@<player.location.sub[16,0,16]>|<player.location.add[16,0,16]>'
- adjust <def[ar].list_partial_chunks> refresh_chunk_sections
- case <def[lava_bucket]>:
- light <context.location> reset
- flag server 'gpa.advancedLights.15:<-:<context.location>'
- modifyblock <context.location> m@air
- drop i@lava_bucket <context.location>
- define ar 'cu@<player.location.sub[16,0,16]>|<player.location.add[16,0,16]>'
- adjust <def[ar].list_partial_chunks> refresh_chunk_sections