File tree Expand file tree Collapse file tree
src/main/java/net/raphimc/noteblocklib/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323import net .raphimc .noteblocklib .model .song .Song ;
2424
2525import java .text .DecimalFormat ;
26+ import java .util .Collections ;
2627import java .util .EnumSet ;
27- import java .util .HashSet ;
28+ import java .util .IdentityHashMap ;
2829import java .util .Set ;
2930
3031public class SongUtil {
@@ -62,7 +63,7 @@ public static Set<MinecraftInstrument> getUsedVanillaInstruments(final Song song
6263 * @return The used custom instruments
6364 */
6465 public static Set <NbsCustomInstrument > getUsedNbsCustomInstruments (final Song song ) {
65- final Set <NbsCustomInstrument > usedInstruments = new HashSet <>();
66+ final Set <NbsCustomInstrument > usedInstruments = Collections . newSetFromMap ( new IdentityHashMap <>() );
6667 song .getNotes ().forEach (note -> {
6768 if (note .getInstrument () instanceof NbsCustomInstrument ) {
6869 usedInstruments .add ((NbsCustomInstrument ) note .getInstrument ());
You can’t perform that action at this time.
0 commit comments