|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Copyright (c) 2018 VectorNetworkProject. All rights reserved. MIT license. |
|
4
|
|
|
* |
|
5
|
|
|
* GitHub: https://github.com/VectorNetworkProject/TheMix |
|
6
|
|
|
* Website: https://www.vector-network.tk |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace VectorNetworkProject\TheMix\lib\sound; |
|
10
|
|
|
|
|
11
|
|
|
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket; |
|
12
|
|
|
use pocketmine\Player; |
|
13
|
|
|
|
|
14
|
|
|
class LevelSounds |
|
|
|
|
|
|
15
|
|
|
{ |
|
16
|
|
|
/** |
|
17
|
|
|
* @param Player $player |
|
18
|
|
|
* |
|
19
|
|
|
* @return void |
|
20
|
|
|
*/ |
|
21
|
|
View Code Duplication |
public static function LevelUp(Player $player): void |
|
|
|
|
|
|
22
|
|
|
{ |
|
23
|
|
|
$packet = new LevelSoundEventPacket(); |
|
24
|
|
|
$packet->position = $player->asVector3(); |
|
25
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_LEVELUP; |
|
26
|
|
|
$packet->extraData = 0x10000000; |
|
27
|
|
|
$player->sendDataPacket($packet); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @param Player $player |
|
32
|
|
|
* |
|
33
|
|
|
* @return void |
|
34
|
|
|
*/ |
|
35
|
|
View Code Duplication |
public static function Anvil(Player $player): void |
|
|
|
|
|
|
36
|
|
|
{ |
|
37
|
|
|
$packet = new LevelSoundEventPacket(); |
|
38
|
|
|
$packet->position = $player->asVector3(); |
|
39
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_RANDOM_ANVIL_USE; |
|
40
|
|
|
$player->sendDataPacket($packet); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @param Player $player |
|
45
|
|
|
* |
|
46
|
|
|
* @return void |
|
47
|
|
|
*/ |
|
48
|
|
View Code Duplication |
public static function Travle(Player $player): void |
|
|
|
|
|
|
49
|
|
|
{ |
|
50
|
|
|
$packet = new LevelSoundEventPacket(); |
|
51
|
|
|
$packet->position = $player->asVector3(); |
|
52
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_PORTAL_TRAVEL; |
|
53
|
|
|
$player->sendDataPacket($packet); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @param Player $player |
|
58
|
|
|
* |
|
59
|
|
|
* @return void |
|
60
|
|
|
*/ |
|
61
|
|
View Code Duplication |
public static function EndPortalSpawn(Player $player): void |
|
|
|
|
|
|
62
|
|
|
{ |
|
63
|
|
|
$packet = new LevelSoundEventPacket(); |
|
64
|
|
|
$packet->position = $player->asVector3(); |
|
65
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_BLOCK_END_PORTAL_SPAWN; |
|
66
|
|
|
$player->sendDataPacket($packet); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* @param Player $player |
|
71
|
|
|
* |
|
72
|
|
|
* @return void |
|
73
|
|
|
*/ |
|
74
|
|
View Code Duplication |
public static function Portal(Player $player): void |
|
|
|
|
|
|
75
|
|
|
{ |
|
76
|
|
|
$packet = new LevelSoundEventPacket(); |
|
77
|
|
|
$packet->position = $player->asVector3(); |
|
78
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_BLOCK_END_PORTAL_SPAWN; |
|
79
|
|
|
$player->sendDataPacket($packet); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @param Player $player |
|
84
|
|
|
* |
|
85
|
|
|
* @return void |
|
86
|
|
|
*/ |
|
87
|
|
View Code Duplication |
public static function Thunder(Player $player): void |
|
|
|
|
|
|
88
|
|
|
{ |
|
89
|
|
|
$packet = new LevelSoundEventPacket(); |
|
90
|
|
|
$packet->position = $player->asVector3(); |
|
91
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_ITEM_TRIDENT_THUNDER; |
|
92
|
|
|
$player->sendDataPacket($packet); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @param Player $player |
|
97
|
|
|
* |
|
98
|
|
|
* @return void |
|
99
|
|
|
*/ |
|
100
|
|
View Code Duplication |
public static function Remedy(Player $player): void |
|
|
|
|
|
|
101
|
|
|
{ |
|
102
|
|
|
$packet = new LevelSoundEventPacket(); |
|
103
|
|
|
$packet->position = $player->asVector3(); |
|
104
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_REMEDY; |
|
105
|
|
|
$player->sendDataPacket($packet); |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* @param Player $player |
|
110
|
|
|
* |
|
111
|
|
|
* @return void |
|
112
|
|
|
*/ |
|
113
|
|
View Code Duplication |
public static function Launch(Player $player): void |
|
|
|
|
|
|
114
|
|
|
{ |
|
115
|
|
|
$packet = new LevelSoundEventPacket(); |
|
116
|
|
|
$packet->position = $player->asVector3(); |
|
117
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_LAUNCH; |
|
118
|
|
|
$player->sendDataPacket($packet); |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* @param Player $player |
|
123
|
|
|
* |
|
124
|
|
|
* @return void |
|
125
|
|
|
*/ |
|
126
|
|
View Code Duplication |
public static function Blast(Player $player): void |
|
|
|
|
|
|
127
|
|
|
{ |
|
128
|
|
|
$packet = new LevelSoundEventPacket(); |
|
129
|
|
|
$packet->position = $player->asVector3(); |
|
130
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_BLAST; |
|
131
|
|
|
$player->sendDataPacket($packet); |
|
132
|
|
|
} |
|
133
|
|
|
|
|
134
|
|
|
/** |
|
135
|
|
|
* @param Player $player |
|
136
|
|
|
* |
|
137
|
|
|
* @return void |
|
138
|
|
|
*/ |
|
139
|
|
View Code Duplication |
public static function LargeBlast(Player $player): void |
|
|
|
|
|
|
140
|
|
|
{ |
|
141
|
|
|
$packet = new LevelSoundEventPacket(); |
|
142
|
|
|
$packet->position = $player->asVector3(); |
|
143
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_LARGE_BLAST; |
|
144
|
|
|
$player->sendDataPacket($packet); |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* @param Player $player |
|
149
|
|
|
* |
|
150
|
|
|
* @return void |
|
151
|
|
|
*/ |
|
152
|
|
View Code Duplication |
public static function Twinklt(Player $player): void |
|
|
|
|
|
|
153
|
|
|
{ |
|
154
|
|
|
$packet = new LevelSoundEventPacket(); |
|
155
|
|
|
$packet->position = $player->asVector3(); |
|
156
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_TWINKLE; |
|
157
|
|
|
$player->sendDataPacket($packet); |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* @param Player $player |
|
162
|
|
|
*/ |
|
163
|
|
View Code Duplication |
public static function NotePiano(Player $player): void |
|
|
|
|
|
|
164
|
|
|
{ |
|
165
|
|
|
$packet = new LevelSoundEventPacket(); |
|
166
|
|
|
$packet->position = $player->asVector3(); |
|
167
|
|
|
$packet->sound = LevelSoundEventPacket::SOUND_NOTE; |
|
168
|
|
|
$player->sendDataPacket($packet); |
|
169
|
|
|
} |
|
170
|
|
|
} |
|
171
|
|
|
|
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.