Files
src
build.gradle
Code
5 286
src/main/java/com/kodari/damagenotifications/DamageNotificationsPlugin.java
package com.kodari.damagenotifications;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;
public final class DamageNotificationsPlugin extends JavaPlugin {
private DamageNotificationListener damageNotificationListener;
@Override
public void onEnable() {
saveDefaultConfig();
damageNotificationListener = new DamageNotificationListener(this);
Bukkit.getPluginManager().registerEvents(damageNotificationListener, this);
getCommand("damagenotifications").setExecutor((sender, command, label, args) -> {
if (args.length != 1 || !args[0].equalsIgnoreCase("reload")) {
sender.sendMessage(ChatColor.RED + "Usage: /damagenotifications reload");
return true;
}
reloadConfig();
sender.sendMessage(ChatColor.GREEN + "DamageNotifications config reloaded.");
return true;
});
}
@Override
public void onDisable() {
if (damageNotificationListener != null) {
damageNotificationListener.clearAllHolograms();
}
}
}