Files
src
build.gradle
settings.gradle
Code
9 342
src/main/java/com/novaitems/NovaItems.java
package com.novaitems;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public final class NovaItems extends JavaPlugin implements Listener {
private ItemRegistry items;
private PackService pack;
@Override
public void onEnable() {
saveDefaultConfig();
saveResource("items/exemple.yml", false);
items = new ItemRegistry(this);
pack = new PackService(this);
items.reload();
NovaCommand command = new NovaCommand(this, items, pack);
getCommand("novaitems").setExecutor(command);
getCommand("novaitems").setTabCompleter(command);
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onJoin(PlayerJoinEvent event) {
if (getConfig().getBoolean("pack.send-on-join", false)) {
pack.send(event.getPlayer());
}
}
}