mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 23:22:10 -07:00
Adding/expanding documentation
By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
@@ -6,11 +6,26 @@ import com.google.common.collect.Maps;
|
||||
|
||||
public enum Instrument {
|
||||
|
||||
PIANO(0x0), // All other
|
||||
BASS_DRUM(0x1), // Stone
|
||||
SNARE_DRUM(0x2), // Sand
|
||||
STICKS(0x3), // Glass
|
||||
BASS_GUITAR(0x4); // Wood
|
||||
/**
|
||||
* Piano is the standard instrument for a note block.
|
||||
*/
|
||||
PIANO(0x0),
|
||||
/**
|
||||
* Bass drum is normally played when a note block is on top of a stone-like block
|
||||
*/
|
||||
BASS_DRUM(0x1),
|
||||
/**
|
||||
* Snare drum is normally played when a note block is on top of a sandy block.
|
||||
*/
|
||||
SNARE_DRUM(0x2),
|
||||
/**
|
||||
* Sticks are normally played when a note block is on top of a glass block.
|
||||
*/
|
||||
STICKS(0x3),
|
||||
/**
|
||||
* Bass guitar is normally played when a note block is on top of a wooden block.
|
||||
*/
|
||||
BASS_GUITAR(0x4);
|
||||
|
||||
private final byte type;
|
||||
private final static Map<Byte, Instrument> BY_DATA = Maps.newHashMap();
|
||||
@@ -19,10 +34,18 @@ public enum Instrument {
|
||||
this.type = (byte) type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The type ID of this instrument.
|
||||
*/
|
||||
public byte getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an instrument by its type ID.
|
||||
* @param type The type ID
|
||||
* @return The instrument
|
||||
*/
|
||||
public static Instrument getByType(final byte type) {
|
||||
return BY_DATA.get(type);
|
||||
}
|
||||
|
Reference in New Issue
Block a user