Skip to content

Commit 0d0800a

Browse files
committed
Fix music gui search issues
1 parent 69f96ad commit 0d0800a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

core/src/main/java/dev/geco/gmusic/model/gui/MusicGUI.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import dev.geco.gmusic.GMusicMain;
2929
import org.jetbrains.annotations.NotNull;
30+
import org.jetbrains.annotations.Nullable;
3031

3132
import java.util.ArrayList;
3233
import java.util.HashMap;
@@ -53,7 +54,7 @@ public class MusicGUI {
5354
private String searchKey = null;
5455
private final PlaySettings playSettings;
5556

56-
public MusicGUI(UUID uuid, MenuType type) {
57+
public MusicGUI(@NotNull UUID uuid, @NotNull MenuType type) {
5758
this.uuid = uuid;
5859
this.type = type;
5960

@@ -320,7 +321,7 @@ public void inventoryDragEvent(InventoryDragEvent event) {
320321
Bukkit.getPluginManager().registerEvents(listener, gMusicMain);
321322
}
322323

323-
public static MusicGUI getMusicGUI(UUID uuid) { return musicGUIS.get(uuid); }
324+
public static @Nullable MusicGUI getMusicGUI(@NotNull UUID uuid) { return musicGUIS.get(uuid); }
324325

325326
public void close(boolean force) {
326327
if(force) for(HumanEntity entity : new ArrayList<>(inventory.getViewers())) entity.closeInventory();
@@ -329,9 +330,9 @@ public void close(boolean force) {
329330
HandlerList.unregisterAll(listener);
330331
}
331332

332-
private MusicInputGUI getInputGUIInstance(MusicInputGUI.InputCallback call, MusicInputGUI.ValidateCallback validateCall) {
333+
private @Nullable MusicInputGUI getInputGUIInstance(@NotNull MusicInputGUI.InputCallback call, @NotNull MusicInputGUI.ValidateCallback validateCall) {
333334
try {
334-
Class<?> inputGUIClass = Class.forName(gMusicMain.getVersionService().getPackagePath() + ".object.gui.GMusicInputGUI");
335+
Class<?> inputGUIClass = Class.forName(gMusicMain.getVersionService().getPackagePath() + ".model.gui.MusicInputGUI");
335336
return (MusicInputGUI) inputGUIClass.getConstructor(MusicInputGUI.InputCallback.class, MusicInputGUI.ValidateCallback.class).newInstance(call, validateCall);
336337
} catch(Throwable e) { gMusicMain.getLogger().log(Level.SEVERE, "Could not get input gui instance", e); }
337338
return null;
@@ -542,13 +543,13 @@ public void setPage(int newPage) {
542543

543544
private int getMaxPageSize(int songCount) { return (songCount / 45) + (songCount % 45 == 0 ? 0 : 1); }
544545

545-
public UUID getOwner() { return uuid; }
546+
public @NotNull UUID getOwner() { return uuid; }
546547

547-
public MenuType getMenuType() { return type; }
548+
public @NotNull MenuType getMenuType() { return type; }
548549

549-
public PlaySettings getPlaySettings() { return playSettings; }
550+
public @NotNull PlaySettings getPlaySettings() { return playSettings; }
550551

551-
public Inventory getInventory() { return inventory; }
552+
public @NotNull Inventory getInventory() { return inventory; }
552553

553554
public enum MenuType {
554555

0 commit comments

Comments
 (0)