Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
210 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
nmshandler/src/main/java/net/aufdemrand/denizen/nms/interfaces/SoundHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package net.aufdemrand.denizen.nms.interfaces; | ||
|
||
import org.bukkit.Sound; | ||
|
||
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 | ||
}; | ||
|
||
|
||
Sound getMidiInstrumentFromPatch(int patch); | ||
|
||
Sound getDefaultMidiInstrument(); | ||
|
||
Sound getChestOpen(); | ||
|
||
Sound getChestClose(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
v1_10_R1/src/main/java/net/aufdemrand/denizen/nms/helpers/SoundHelper_v1_10_R1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.nms.helpers; | ||
|
||
import net.aufdemrand.denizen.nms.interfaces.SoundHelper; | ||
import org.bukkit.Sound; | ||
|
||
public class SoundHelper_v1_10_R1 implements SoundHelper { | ||
|
||
@Override | ||
public Sound getMidiInstrumentFromPatch(int patch) { | ||
// look up the instrument matching the patch | ||
switch (instruments[patch]) { | ||
case 1: | ||
return Sound.BLOCK_NOTE_BASS; | ||
case 2: | ||
return Sound.BLOCK_NOTE_SNARE; | ||
case 3: | ||
return Sound.BLOCK_NOTE_HARP; | ||
case 4: | ||
return Sound.BLOCK_NOTE_HAT; | ||
case 5: | ||
return Sound.BLOCK_NOTE_PLING; | ||
case 6: | ||
return Sound.BLOCK_NOTE_BASEDRUM; | ||
} | ||
return getDefaultMidiInstrument(); | ||
} | ||
|
||
@Override | ||
public Sound getDefaultMidiInstrument() { | ||
return Sound.BLOCK_NOTE_HAT; | ||
} | ||
|
||
@Override | ||
public Sound getChestOpen() { | ||
return Sound.BLOCK_CHEST_OPEN; | ||
} | ||
|
||
@Override | ||
public Sound getChestClose() { | ||
return Sound.BLOCK_CHEST_CLOSE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
v1_8_R3/src/main/java/net/aufdemrand/denizen/nms/helpers/SoundHelper_v1_8_R3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.nms.helpers; | ||
|
||
import net.aufdemrand.denizen.nms.interfaces.SoundHelper; | ||
import org.bukkit.Sound; | ||
|
||
public class SoundHelper_v1_8_R3 implements SoundHelper { | ||
|
||
@Override | ||
public Sound getMidiInstrumentFromPatch(int patch) { | ||
// look up the instrument matching the patch | ||
switch (instruments[patch]) { | ||
case 1: | ||
return Sound.NOTE_BASS_GUITAR; | ||
case 2: | ||
return Sound.NOTE_SNARE_DRUM; | ||
case 3: | ||
return Sound.NOTE_STICKS; | ||
case 4: | ||
return Sound.NOTE_BASS_DRUM; | ||
case 5: | ||
return Sound.NOTE_PLING; | ||
case 6: | ||
return Sound.NOTE_BASS; | ||
} | ||
return getDefaultMidiInstrument(); | ||
} | ||
|
||
@Override | ||
public Sound getDefaultMidiInstrument() { | ||
return Sound.NOTE_PIANO; | ||
} | ||
|
||
@Override | ||
public Sound getChestOpen() { | ||
return Sound.CHEST_OPEN; | ||
} | ||
|
||
@Override | ||
public Sound getChestClose() { | ||
return Sound.CHEST_CLOSE; | ||
} | ||
} |
Oops, something went wrong.