mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 23:22:10 -07:00
Added Instrument enum, Note class and get/setNote functions. Thanks xZise!
By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
34
paper-api/src/main/java/org/bukkit/Instrument.java
Normal file
34
paper-api/src/main/java/org/bukkit/Instrument.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum Instrument {
|
||||
|
||||
PIANO((byte) 0x0), // All other
|
||||
BASS_DRUM((byte) 0x1), // Stone
|
||||
SNARE_DRUM((byte) 0x2), // Sand
|
||||
STICKS((byte) 0x3), // Glass
|
||||
BASS_GUITAR((byte) 0x4); // Wood
|
||||
|
||||
private final byte type;
|
||||
private final static Map<Byte, Instrument> types = new HashMap<Byte, Instrument>();
|
||||
|
||||
private Instrument(byte type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public byte getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public static Instrument getByType(final byte type) {
|
||||
return types.get(type);
|
||||
}
|
||||
|
||||
static {
|
||||
for (Instrument instrument : Instrument.values()) {
|
||||
types.put(instrument.getType(), instrument);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user