Skip to content

Commit e75a7f9

Browse files
committed
Updated NoteBlockLib
1 parent adbb7c3 commit e75a7f9

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repositories {
2424
}
2525

2626
dependencies {
27-
include "net.raphimc:NoteBlockLib:2.1.2"
27+
include "net.raphimc:NoteBlockLib:2.1.3"
2828
include "com.formdev:flatlaf:3.4.1"
2929
include "net.lenni0451.commons:swing:1.5.1"
3030
include "org.lwjgl:lwjgl:3.3.3"

src/main/java/net/raphimc/noteblocktool/frames/EditFrame.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,14 @@ private void initComponents() {
9494
JButton apply = new JButton("Save");
9595
apply.addActionListener(e -> {
9696
for (ListFrame.LoadedSong song : this.songs) {
97-
this.resamplingTab.apply(song.getSong(), song.getSong().getView());
98-
this.instrumentsTab.apply(song.getSong(), song.getSong().getView());
97+
SongView<?> view = song.getSong().getView();
98+
this.resamplingTab.apply(song.getSong(), view);
99+
this.instrumentsTab.apply(song.getSong(), view);
99100
if (this.customInstrumentsTab != null) {
100-
this.customInstrumentsTab.apply(song.getSong(), song.getSong().getView());
101+
this.customInstrumentsTab.apply(song.getSong(), view);
101102
}
102-
this.notesTab.apply(song.getSong(), song.getSong().getView());
103-
this.metadataTab.apply(song.getSong(), song.getSong().getView());
103+
this.notesTab.apply(song.getSong(), view);
104+
this.metadataTab.apply(song.getSong(), view);
104105
}
105106
JOptionPane.showMessageDialog(this, "Saved all changes", "Saved", JOptionPane.INFORMATION_MESSAGE);
106107
for (ListFrame.LoadedSong song : this.songs) this.songRefreshConsumer.accept(song);
@@ -113,7 +114,7 @@ private void initComponents() {
113114
this.resamplingTab.apply(song.getSong(), view);
114115
this.instrumentsTab.apply(song.getSong(), view);
115116
if (this.customInstrumentsTab != null) {
116-
this.customInstrumentsTab.apply(null, view);
117+
this.customInstrumentsTab.apply(song.getSong(), view);
117118
}
118119
this.notesTab.apply(song.getSong(), view);
119120
SongPlayerFrame.open(song, view);

src/main/java/net/raphimc/noteblocktool/frames/edittabs/CustomInstrumentsTab.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package net.raphimc.noteblocktool.frames.edittabs;
1919

2020
import net.raphimc.noteblocklib.format.nbs.model.NbsCustomInstrument;
21-
import net.raphimc.noteblocklib.format.nbs.model.NbsData;
2221
import net.raphimc.noteblocklib.format.nbs.model.NbsNote;
2322
import net.raphimc.noteblocklib.model.Song;
2423
import net.raphimc.noteblocklib.model.SongView;
@@ -73,12 +72,6 @@ public void apply(Song<?, ?, ?> song, SongView<?> view) {
7372
}
7473
}
7574
});
76-
77-
if (song != null) {
78-
for (NbsCustomInstrument customInstrument : replacements.keySet()) {
79-
((NbsData) song.getData()).getCustomInstruments().remove(customInstrument);
80-
}
81-
}
8275
}
8376

8477
}

0 commit comments

Comments
 (0)