Update NoteBlockEvent with new instruments. Resolves #4018. (#4019)

This commit is contained in:
Ben Staddon 2017-06-21 07:50:32 +01:00 committed by LexManos
parent 98f464ad43
commit a30316e6a1

View file

@ -143,14 +143,19 @@ public class NoteBlockEvent extends BlockEvent
BASSDRUM,
SNARE,
CLICKS,
BASSGUITAR;
BASSGUITAR,
FLUTE,
BELL,
GUITAR,
CHIME,
XYLOPHONE;
// cache to avoid creating a new array every time
private static final Instrument[] values = values();
static Instrument fromId(int id)
{
return id < 0 || id > 4 ? PIANO : values[id];
return id < 0 || id >= values.length ? PIANO : values[id];
}
}