Adding/expanding documentation

By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
Bukkit/Spigot
2012-02-26 12:13:30 -05:00
parent 795a61bbeb
commit 15e2f69fa6
20 changed files with 162 additions and 16 deletions

View File

@@ -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);
}