-
-
Notifications
You must be signed in to change notification settings - Fork 103
/
SoundHelper.java
73 lines (63 loc) · 2.47 KB
/
SoundHelper.java
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
package net.aufdemrand.denizen.nms.interfaces;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
public interface SoundHelper {
// provided by github.com/sk89q/craftbook
int[] instruments = {
0, 0, 0, 0, 0, 0, 0, 5, // 8
6, 0, 0, 0, 0, 0, 0, 0, // 16
0, 0, 0, 0, 0, 0, 0, 5, // 24
5, 5, 5, 5, 5, 5, 5, 5, // 32
6, 6, 6, 6, 6, 6, 6, 6, // 40
5, 5, 5, 5, 5, 5, 5, 2, // 48
5, 5, 5, 5, 0, 0, 0, 0, // 56
0, 0, 0, 0, 0, 0, 0, 0, // 64
0, 0, 0, 0, 0, 0, 0, 0, // 72
0, 0, 0, 0, 0, 0, 0, 0, // 80
0, 0, 0, 0, 0, 0, 0, 0, // 88
0, 0, 0, 0, 0, 0, 0, 0, // 96
0, 0, 0, 0, 0, 0, 0, 0, // 104
0, 0, 0, 0, 0, 0, 0, 0, // 112
1, 1, 1, 3, 1, 1, 1, 5, // 120
1, 1, 1, 1, 1, 2, 4, 3, // 128
};
int[] instruments_1_12 = {
0, 0, 0, 0, 0, 0, 0, 5, // 8
9, 9, 9, 9, 9, 6, 0, 9, // 16
9, 0, 0, 0, 0, 0, 0, 5, // 24
5, 5, 5, 5, 5, 5, 5, 1, // 32
1, 1, 1, 1, 1, 1, 1, 5, // 40
1, 5, 5, 5, 5, 5, 5, 5, // 48
5, 5, 5, 8, 8, 8, 8, 8, // 56
8, 8, 8, 8, 8, 8, 8, 8, // 64
8, 8, 8, 8, 8, 8, 8, 8, // 72
8, 8, 8, 8, 8, 8, 8, 8, // 80
0, 0, 0, 0, 0, 0, 0, 0, // 88
0, 0, 0, 0, 0, 0, 0, 0, // 96
0, 0, 0, 0, 0, 0, 0, 5, // 104
5, 5, 5, 9, 8, 5, 8, 6, // 112
6, 3, 3, 2, 2, 2, 6, 5, // 120
1, 1, 1, 6, 1, 2, 4, 7, // 128
};
Sound getMidiInstrumentFromPatch(int patch);
Sound getDefaultMidiInstrument();
Sound getChestOpen();
Sound getChestClose();
default void playSound(Player player, Location location, String sound, float volume, float pitch, String category) {
if (player == null) {
location.getWorld().playSound(location, sound, volume, pitch);
}
else {
player.playSound(location, sound, volume, pitch);
}
}
default void playSound(Player player, Location location, Sound sound, float volume, float pitch, String category) {
if (player == null) {
location.getWorld().playSound(location, sound, volume, pitch);
}
else {
player.playSound(location, sound, volume, pitch);
}
}
}