|
1 | 1 | package xyz.theprogramsrc.supercoreapi.plugin; |
2 | 2 |
|
3 | | -import org.bukkit.entity.Player; |
4 | | -import xyz.theprogramsrc.supercoreapi.spigot.commands.CommandResult; |
5 | | -import xyz.theprogramsrc.supercoreapi.spigot.commands.SpigotCommand; |
6 | | -import xyz.theprogramsrc.supercoreapi.spigot.guis.action.ClickAction; |
7 | | -import xyz.theprogramsrc.supercoreapi.spigot.guis.precreated.MaterialBrowser; |
8 | | -import xyz.theprogramsrc.supercoreapi.spigot.utils.SpigotConsole; |
9 | | -import xyz.theprogramsrc.supercoreapi.spigot.utils.xseries.XMaterial; |
10 | | - |
11 | | -public class SpigotPlugin extends xyz.theprogramsrc.supercoreapi.spigot.SpigotPlugin { |
| 3 | +import org.bukkit.Bukkit; |
| 4 | +import org.bukkit.ChatColor; |
| 5 | +import org.bukkit.plugin.java.JavaPlugin; |
12 | 6 |
|
| 7 | +public class SpigotPlugin extends JavaPlugin { |
13 | 8 |
|
14 | 9 | @Override |
15 | | - public void onPluginLoad() { |
16 | | - |
| 10 | + public void onEnable() { |
| 11 | + this.log("&3SuperCoreAPI &awas loaded as .jar file"); |
17 | 12 | } |
18 | 13 |
|
19 | 14 | @Override |
20 | | - public void onPluginEnable() { |
21 | | - new Command(); |
| 15 | + public void onDisable() { |
| 16 | + this.log("&3SuperCoreAPI &awas disabled"); |
22 | 17 | } |
23 | 18 |
|
24 | | - @Override |
25 | | - public void onPluginDisable() { |
26 | | - |
| 19 | + private void log(String s){ |
| 20 | + Bukkit.getConsoleSender().sendMessage(c(s)); |
27 | 21 | } |
28 | 22 |
|
29 | | - static class Command extends SpigotCommand { |
30 | | - |
31 | | - @Override |
32 | | - public String getCommand() { |
33 | | - return "scapi"; |
34 | | - } |
35 | | - |
36 | | - @Override |
37 | | - public CommandResult onPlayerExecute(Player player, String[] args) { |
38 | | - new MaterialBrowser(player){ |
39 | | - @Override |
40 | | - public void onBack(ClickAction clickAction) { |
41 | | - this.close(); |
42 | | - } |
43 | | - |
44 | | - @Override |
45 | | - public void onSelect(ClickAction clickAction, XMaterial xMaterial) { |
46 | | - clickAction.getPlayer().getInventory().addItem(xMaterial.parseItem()); |
47 | | - } |
48 | | - }.open(); |
49 | | - return CommandResult.COMPLETED; |
50 | | - } |
51 | | - |
52 | | - @Override |
53 | | - public CommandResult onConsoleExecute(SpigotConsole console, String[] args) { |
54 | | - return CommandResult.COMPLETED; |
55 | | - } |
| 23 | + private String c(String s){ |
| 24 | + return ChatColor.translateAlternateColorCodes('&', s); |
56 | 25 | } |
57 | 26 | } |
0 commit comments