mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 23:22:10 -07:00
@@ -1,21 +1,22 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
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
|
||||
PIANO(0x0), // All other
|
||||
BASS_DRUM(0x1), // Stone
|
||||
SNARE_DRUM(0x2), // Sand
|
||||
STICKS(0x3), // Glass
|
||||
BASS_GUITAR(0x4); // Wood
|
||||
|
||||
private final byte type;
|
||||
private final static Map<Byte, Instrument> types = new HashMap<Byte, Instrument>();
|
||||
private final static Map<Byte, Instrument> BY_DATA = Maps.newHashMap();
|
||||
|
||||
private Instrument(byte type) {
|
||||
this.type = type;
|
||||
private Instrument(final int type) {
|
||||
this.type = (byte) type;
|
||||
}
|
||||
|
||||
public byte getType() {
|
||||
@@ -23,12 +24,12 @@ public enum Instrument {
|
||||
}
|
||||
|
||||
public static Instrument getByType(final byte type) {
|
||||
return types.get(type);
|
||||
return BY_DATA.get(type);
|
||||
}
|
||||
|
||||
static {
|
||||
for (Instrument instrument : Instrument.values()) {
|
||||
types.put(instrument.getType(), instrument);
|
||||
BY_DATA.put(instrument.getType(), instrument);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user