Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Commit fbabc45

Browse files
committed
サウンドを簡単に扱えるように
1 parent 6e8cef1 commit fbabc45

File tree

1 file changed

+148
-0
lines changed

1 file changed

+148
-0
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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+
12+
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
13+
use pocketmine\Player;
14+
15+
class LevelSounds
16+
{
17+
/**
18+
* @param Player $player
19+
* @return void
20+
*/
21+
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+
* @return void
33+
*/
34+
public static function Anvil(Player $player): void
35+
{
36+
$packet = new LevelSoundEventPacket();
37+
$packet->position = $player->asVector3();
38+
$packet->sound = LevelSoundEventPacket::SOUND_RANDOM_ANVIL_USE;
39+
$player->sendDataPacket($packet);
40+
}
41+
42+
/**
43+
* @param Player $player
44+
* @return void
45+
*/
46+
public static function Travle(Player $player): void
47+
{
48+
$packet = new LevelSoundEventPacket();
49+
$packet->position = $player->asVector3();
50+
$packet->sound = LevelSoundEventPacket::SOUND_PORTAL_TRAVEL;
51+
$player->sendDataPacket($packet);
52+
}
53+
54+
/**
55+
* @param Player $player
56+
* @return void
57+
*/
58+
public static function EndPortalSpawn(Player $player): void
59+
{
60+
$packet = new LevelSoundEventPacket();
61+
$packet->position = $player->asVector3();
62+
$packet->sound = LevelSoundEventPacket::SOUND_BLOCK_END_PORTAL_SPAWN;
63+
$player->sendDataPacket($packet);
64+
}
65+
66+
/**
67+
* @param Player $player
68+
* @return void
69+
*/
70+
public static function Portal(Player $player): void
71+
{
72+
$packet = new LevelSoundEventPacket();
73+
$packet->position = $player->asVector3();
74+
$packet->sound = LevelSoundEventPacket::SOUND_BLOCK_END_PORTAL_SPAWN;
75+
$player->sendDataPacket($packet);
76+
}
77+
78+
/**
79+
* @param Player $player
80+
* @return void
81+
*/
82+
public static function Thunder(Player $player): void
83+
{
84+
$packet = new LevelSoundEventPacket();
85+
$packet->position = $player->asVector3();
86+
$packet->sound = LevelSoundEventPacket::SOUND_ITEM_TRIDENT_THUNDER;
87+
$player->sendDataPacket($packet);
88+
}
89+
90+
/**
91+
* @param Player $player
92+
* @return void
93+
*/
94+
public static function Remedy(Player $player): void
95+
{
96+
$packet = new LevelSoundEventPacket();
97+
$packet->position = $player->asVector3();
98+
$packet->sound = LevelSoundEventPacket::SOUND_REMEDY;
99+
$player->sendDataPacket($packet);
100+
}
101+
102+
/**
103+
* @param Player $player
104+
* @return void
105+
*/
106+
public static function Launch(Player $player): void
107+
{
108+
$packet = new LevelSoundEventPacket();
109+
$packet->position = $player->asVector3();
110+
$packet->sound = LevelSoundEventPacket::SOUND_LAUNCH;
111+
$player->sendDataPacket($packet);
112+
}
113+
114+
/**
115+
* @param Player $player
116+
* @return void
117+
*/
118+
public static function Blast(Player $player): void
119+
{
120+
$packet = new LevelSoundEventPacket();
121+
$packet->position = $player->asVector3();
122+
$packet->sound = LevelSoundEventPacket::SOUND_BLAST;
123+
$player->sendDataPacket($packet);
124+
}
125+
126+
/**
127+
* @param Player $player
128+
* @return void
129+
*/
130+
public static function LargeBlast(Player $player): void
131+
{
132+
$packet = new LevelSoundEventPacket();
133+
$packet->position = $player->asVector3();
134+
$packet->sound = LevelSoundEventPacket::SOUND_LARGE_BLAST;
135+
$player->sendDataPacket($packet);
136+
}
137+
138+
/**
139+
* @param Player $player
140+
* @return void
141+
*/
142+
public static function Twinklt(Player $player): void
143+
{
144+
$packet = new LevelSoundEventPacket();
145+
$packet->sound = LevelSoundEventPacket::SOUND_TWINKLE;
146+
$player->sendDataPacket($packet);
147+
}
148+
}

0 commit comments

Comments
 (0)