This repository was archived by the owner on Oct 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎵 List all songs and execute play command after click event
- Loading branch information
1 parent
877466f
commit 98fd92f
Showing
2 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,42 @@ | ||
package de.petropia.nbsDemo; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import de.petropia.nbsDemo.commands.SongCommand; | ||
import de.petropia.nbsDemo.song.SongList; | ||
|
||
public class NbsDemo extends JavaPlugin { | ||
|
||
private static JavaPlugin instance; | ||
private static NbsDemo instance; | ||
private SongList songList; | ||
|
||
@Override | ||
public void onEnable() { | ||
if(!isNoteBlockApiPresent()) { | ||
getLogger().warning("Bitte füge das NoteBlockAPI plugin in den Pluginsordner hinzu, damit dieses Plugin ordnungsgemäß funktioniert!"); | ||
getServer().getPluginManager().disablePlugin(this); | ||
return; | ||
} | ||
instance = this; | ||
songList = new SongList(getDataFolder().toPath().toString() + "/Songs"); | ||
getCommand("songs").setExecutor(new SongCommand()); | ||
} | ||
|
||
private boolean isNoteBlockApiPresent() { | ||
return Bukkit.getServer().getPluginManager().getPlugin("NoteBlockAPI") != null; | ||
} | ||
|
||
public static JavaPlugin getInstance() { | ||
public static NbsDemo getInstance() { | ||
return instance; | ||
} | ||
|
||
public SongList getSongList() { | ||
return songList; | ||
} | ||
|
||
public void setSongList(SongList songList) { | ||
this.songList = songList; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters