Hi NEED HELP WITH A PLUGIN ERROR!

Discussion in 'Plugin Development' started by Scott102, Jan 6, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Scott102

    Hi, I'm having an error with a plugin I'm working on, can anyone help me fix it? Here is my error log and also it says I'm having an error at a class file which is this.
    ---------------------------------------------------------------------------------------------------------------------------------------------
    Main Class
    ---------------------------------------------------------------------------------------------------------------------------------------------
    Code:
    package com.xxscott102xx.SK;
    
    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.configuration.ConfigurationSection;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    import com.sk89q.worldedit.bukkit.WorldEditPlugin;
    import com.xxscott102xx.Listeners.EntityDamage;
    import com.xxscott102xx.Listeners.PlayerJoin;
    import com.xxscott102xx.Listeners.PlayerLeaveArena;
    import com.xxscott102xx.Listeners.PlayerMove;
    import com.xxscott102xx.Listeners.RollbackManager;
    import com.xxscott102xx.Listeners.SignManager;
    
    public class Main extends JavaPlugin {
    
        private static RollbackManager rollbackManager;
    
        public void onEnable() {
            ArenaManager.getInstance().setup();
       
            getCommand("silentkiller").setExecutor(new CommandManager());
       
            PluginManager pm = Bukkit.getServer().getPluginManager();
            pm.registerEvents(new EntityDamage(), this);
            pm.registerEvents(new PlayerJoin(), this);
            pm.registerEvents(new PlayerLeaveArena(), this);
            pm.registerEvents(new PlayerMove(), this);
            pm.registerEvents(setRollbackManager(new RollbackManager()), this);
            pm.registerEvents(new SignManager(), this);
    
        }
    
        public static Plugin getPlugin() {
            return Bukkit.getServer().getPluginManager().getPlugin("silentkiller");
        }
    
        public static WorldEditPlugin getWorldEdit() {
            return (WorldEditPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldEdit");
        }
    
        public static void saveLocation(Location location, ConfigurationSection section) {
            section.set("world", location.getWorld().getName());
            section.set("x", location.getX());
            section.set("y", location.getY());
            section.set("z", location.getZ());
            section.set("pitch", location.getPitch());
            section.set("yaw", location.getYaw());
        }
    
        public static Location loadLocation(ConfigurationSection section) {
            return new Location(
                    Bukkit.getServer().getWorld(section.getString("world")),
                    section.getDouble("x"),
                    section.getDouble("y"),
                    section.getDouble("z"),
                    (float) section.getDouble("pitch"),
                    (float) section.getDouble("yaw")
            );
        }
    
        public static RollbackManager getRollbackManager() {
            return rollbackManager;
        }
    
        public static RollbackManager setRollbackManager(RollbackManager rollbackManager) {
            Main.rollbackManager = rollbackManager;
            return rollbackManager;
        }
    }
    Arena Manager Class

    Code:
    package com.xxscott102xx.SK;
    
    import java.util.ArrayList;
    
    import org.bukkit.entity.Player;
    
    public class ArenaManager {
    
        private static ArenaManager instance = new ArenaManager();
    
        public static ArenaManager getInstance() {
            return instance;
        }
    
        private ArrayList<Arena> arenas;
    
        private ArenaManager() {
            this.arenas = new ArrayList<Arena>();
        }
    
        public void setup() {
            arenas.clear();
       
            for (String arenaID : SettingsManager.getArenas().getKeys()) {
                arenas.add(new Arena(arenaID));
            }
        }
    
        public Arena getArena(String id) {
            for (Arena arena : arenas) {
                if (arena.getID().equals(id)) {
                    return arena;
                }
            }
       
            return null;
        }
    
        public Arena getArena(Player p) {
            for (Arena arena : arenas) {
                if (arena.hasPlayer(p)) {
                    return arena;
                }
            }
       
            return null;
        }
    
    
        public ArrayList<Arena> getArenas() {
            return arenas;
        }
    }
    Error:
    Code:
    [23:28:57] [Server thread/INFO]: Starting minecraft server version 1.7.9
    [23:28:57] [Server thread/INFO]: Loading properties
    [23:28:57] [Server thread/INFO]: Default game type: SURVIVAL
    [23:28:57] [Server thread/INFO]: Generating keypair
    [23:28:57] [Server thread/INFO]: Starting Minecraft server on *:25565
    [23:28:57] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.2)
    [23:28:57] [Server thread/INFO]: [Testplugin] Loading Testplugin v1.0
    [23:28:57] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v5.6.3
    [23:28:57] [Server thread/INFO]: [motd] Loading motd v1.0
    [23:28:57] [Server thread/INFO]: [SilentKiller] Loading SilentKiller v1.0
    [23:28:57] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    [23:28:57] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
    [23:28:57] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
    [23:28:57] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
    [23:28:57] [Server thread/INFO]: Preparing level "world"
    [23:28:57] [Server thread/INFO]: Preparing start region for level 0 (Seed: -1473107107254635872)
    [23:28:58] [Thread-8/WARN]: Could not get information about this CraftBukkit version; perhaps you are running a custom one?: IOException
    [23:28:58] [Server thread/INFO]: Preparing start region for level 1 (Seed: -4176839390586411301)
    [23:28:58] [Thread-8/WARN]: Could not get latest artifact information: IOException
    [23:28:59] [Server thread/INFO]: Preparing start region for level 2 (Seed: -4176839390586411301)
    [23:28:59] [Server thread/INFO]: [Testplugin] Enabling Testplugin v1.0
    [23:28:59] [Server thread/INFO]: [Testplugin] Plugin Enabled! Duh!
    [23:28:59] [Server thread/INFO]: [WorldEdit] Enabling WorldEdit v5.6.3
    [23:28:59] [Server thread/INFO]: WEPIF: Using the Bukkit Permissions API.
    [23:28:59] [Server thread/INFO]: [motd] Enabling motd v1.0
    [23:28:59] [Server thread/INFO]: [SilentKiller] Enabling SilentKiller v1.0
    [23:28:59] [Server thread/ERROR]: Error occurred while enabling SilentKiller v1.0 (Is it up to date?)
    java.lang.ExceptionInInitializerError
        at com.xxscott102xx.SK.ArenaManager.setup(ArenaManager.java:24) ~[?:?]
        at com.xxscott102xx.SK.Main.onEnable(Main.java:23) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:324) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugin(CraftServer.java:446) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.enablePlugins(CraftServer.java:380) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.n(MinecraftServer.java:352) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.g(MinecraftServer.java:326) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.a(MinecraftServer.java:282) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:182) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.NullPointerException
        at com.xxscott102xx.SK.SettingsManager.<init>(SettingsManager.java:34) ~[?:?]
        at com.xxscott102xx.SK.SettingsManager.<clinit>(SettingsManager.java:13) ~[?:?]
        ... 13 more
    [23:28:59] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [23:28:59] [Server thread/INFO]: Done (1.473s)! For help, type "help" or "?"
    [23:29:05] [Server thread/INFO]: xxscott102xx[/127.0.0.1:57438] logged in with entity id 300 at ([world] 668.0035556338398, 100.0, 909.0904555924614)
    [23:29:06] [Server thread/INFO]: xxscott102xx issued server command: /pl
    [23:29:11] [Server thread/INFO]: xxscott102xx issued server command: /silentkiller
    [23:29:38] [Server thread/INFO]: xxscott102xx issued server command: /sg
    [23:29:40] [Server thread/INFO]: xxscott102xx issued server command: /sk
    [23:29:44] [Server thread/INFO]: xxscott102xx issued server command: /silentkiller join
    [23:29:48] [Server thread/INFO]: xxscott102xx issued server command: /silentkiller join 1
    [23:35:10] [Server thread/INFO]: [SilentKiller] Disabling SilentKiller v1.0
    [23:35:10] [Server thread/INFO]: [motd] Disabling motd v1.0
    [23:35:10] [Server thread/INFO]: [WorldEdit] Disabling WorldEdit v5.6.3
    [23:35:10] [Server thread/INFO]: [Testplugin] Disabling Testplugin v1.0
    [23:35:10] [Server thread/INFO]: [Testplugin] Loading Testplugin v1.0
    [23:35:10] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v5.6.3
    [23:35:10] [Server thread/INFO]: [motd] Loading motd v1.0
    [23:35:10] [Server thread/INFO]: [SilentKiller] Loading SilentKiller v1.0
    [23:35:10] [Server thread/INFO]: [Testplugin] Enabling Testplugin v1.0
    [23:35:10] [Server thread/INFO]: [Testplugin] Plugin Enabled! Duh!
    [23:35:10] [Server thread/INFO]: [WorldEdit] Enabling WorldEdit v5.6.3
    [23:35:10] [Server thread/INFO]: WEPIF: Using the Bukkit Permissions API.
    [23:35:10] [Server thread/INFO]: [motd] Enabling motd v1.0
    [23:35:10] [Server thread/INFO]: [SilentKiller] Enabling SilentKiller v1.0
    [23:35:10] [Server thread/ERROR]: Error occurred while enabling SilentKiller v1.0 (Is it up to date?)
    java.lang.ExceptionInInitializerError
        at com.xxscott102xx.SK.ArenaManager.setup(ArenaManager.java:24) ~[?:?]
        at com.xxscott102xx.SK.Main.onEnable(Main.java:23) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:324) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:404) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugin(CraftServer.java:446) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.enablePlugins(CraftServer.java:380) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.reload(CraftServer.java:799) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.Bukkit.reload(Bukkit.java:288) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchServerCommand(CraftServer.java:688) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:296) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:261) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [CB.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.NullPointerException
        at com.xxscott102xx.SK.SettingsManager.<init>(SettingsManager.java:34) ~[?:?]
        at com.xxscott102xx.SK.SettingsManager.<clinit>(SettingsManager.java:13) ~[?:?]
        ... 18 more
    [23:35:10] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [23:35:11] [Server thread/INFO]: CONSOLE: [0;32;1mReload complete.[m
    [23:35:26] [Server thread/INFO]: xxscott102xx issued server command: /silentkiller
    [23:36:16] [Server thread/INFO]: xxscott102xx lost connection: Disconnected
    [23:36:16] [Server thread/INFO]: xxscott102xx left the game.
     
    Last edited: Jan 6, 2015
  2. @Scott102 Please put in code tags so people can easily read it.
     
  3. Offline

    Scott102

    how do I do that?
     
  4. @Scott102 [ code ] and [/ code ] around your code and error (no spaces of course)
     
  5. Offline

    xMakerx

    DANG IT. I got NINJA'D
     
  6. Offline

    Scott102

    liddat?
     
  7. @Scott102 I meant close ([/ code ]) after each class/error, it is ok I will fix it.
     
  8. Offline

    Scott102

    Oh sorry, and thanks, and do you know how to fix it though?
     
  9. There ^

    Error at line 34 and 13 of class SettingManager.

    Locked, offline mode is not supported here.
     
Thread Status:
Not open for further replies.

Share This Page