Added method for exception events

This commit is contained in:
Norbi Peti 2016-11-02 18:31:43 +01:00
parent 4424eb551d
commit f48c1ca9cc
3 changed files with 113 additions and 108 deletions

View file

@ -7,8 +7,7 @@ import java.util.logging.Logger;
import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.lib.EventExceptionCoreHandler; import buttondevteam.lib.TBMCCoreAPI;
import buttondevteam.lib.EventExceptionHandler;
import buttondevteam.lib.TBMCPlayer; import buttondevteam.lib.TBMCPlayer;
public class MainPlugin extends JavaPlugin { public class MainPlugin extends JavaPlugin {
@ -25,7 +24,7 @@ public class MainPlugin extends JavaPlugin {
logger = getLogger(); logger = getLogger();
logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion() + ")."); logger.info(pdfFile.getName() + " has been Enabled (V." + pdfFile.getVersion() + ").");
EventExceptionHandler.registerEvents(new PlayerListener(), this, new EventExceptionCoreHandler()); TBMCCoreAPI.RegisterEventsForExceptions(new PlayerListener(), this);
} }
@Override @Override

View file

@ -13,6 +13,8 @@ import java.util.List;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
@ -97,4 +99,8 @@ public final class TBMCCoreAPI {
Bukkit.getLogger().warning(sourcemsg); Bukkit.getLogger().warning(sourcemsg);
e.printStackTrace(); e.printStackTrace();
} }
public static void RegisterEventsForExceptions(Listener listener, Plugin plugin) {
EventExceptionHandler.registerEvents(listener, plugin, new EventExceptionCoreHandler());
}
} }