File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
src/main/java/com/xxmicloxx/NoteBlockAPI Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 77 <groupId >com.xxmicloxx</groupId >
88 <artifactId >NoteBlockAPI</artifactId >
99 <version >1.2.0</version >
10+ <name >NoteBlockAPI</name >
1011
1112 <properties >
1213 <maven .compiler.source>1.8</maven .compiler.source>
1314 <maven .compiler.target>1.8</maven .compiler.target>
15+ <mainClass >com.xxmicloxx.NoteBlockAPI.NoteBlockPlayerMain</mainClass >
1416 </properties >
1517
1618 <repositories >
8082 </executions >
8183 </plugin >
8284 </plugins >
85+ <sourceDirectory >src/main/java</sourceDirectory >
86+ <defaultGoal >package</defaultGoal >
87+ <resources >
88+ <resource >
89+ <directory >src/main/resources</directory >
90+ <filtering >true</filtering >
91+ <includes >
92+ <include >plugin.yml</include >
93+ </includes >
94+ </resource >
95+ <resource >
96+ <directory >src/main/resources</directory >
97+ <filtering >false</filtering >
98+ <excludes >
99+ <exclude >**/*.java</exclude >
100+ <exclude >plugin.yml</exclude >
101+ </excludes >
102+ </resource >
103+ </resources >
83104 </build >
84105
85106</project >
Original file line number Diff line number Diff line change 33/**
44 * Version independent Spigot sounds.
55 *
6- * Enum mapping to sound names for different
6+ * Enum mapping to note names for different
77 * Minecraft versions.
88 *
99 * @see https://gist.github.com/NiklasEi/7bd0ffd136f8459df0940e4501d47a8a
@@ -30,10 +30,16 @@ public enum Sound {
3030 this .versionDependentNames = versionDependentNames ;
3131 }
3232
33+ /**
34+ * Attempts to retrieve the org.bukkit.Sound equivalent of a version dependent enum name
35+ * @param bukkitSoundName
36+ * @return org.bukkit.Sound enum
37+ */
3338 public static org .bukkit .Sound getFromBukkitName (String bukkitSoundName ) {
3439 for (Sound sound : values ()) {
35- org .bukkit .Sound bukkitSound = sound .getSound ();
36- if (bukkitSound != null ) return bukkitSound ;
40+ for (String soundName : sound .versionDependentNames ) {
41+ if (soundName .equalsIgnoreCase (bukkitSoundName )) return sound .getSound ();
42+ }
3743 }
3844 return org .bukkit .Sound .valueOf (bukkitSoundName );
3945 }
You can’t perform that action at this time.
0 commit comments