Advertisement
Guest User

Line 14 (Throws Exception)

a guest
Apr 20th, 2017
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1.    public void onEnable(){
  2.  
  3.         loadConfiguration();
  4.  
  5.         // Note that before the if statement was added, it still threw the null pointer exception.
  6.         if(getCommand("safepvpmode") != null){
  7.             getCommand("safepvpmode").setExecutor(new SafePvPMode(this));
  8.         // This line ^ (14) throws the exception.
  9.         }
  10.  
  11.         new ToggleListener(this);
  12.     }
  13.  
  14.     public void loadConfiguration() {
  15.         String toggleOnMessage = "toggleonmessage";
  16.         String toggleOffMessage = "toggleoffmessage";
  17.         String noPermission = "permissionmessage";
  18.         getConfig().addDefault(toggleOnMessage, ChatColor.GREEN + "You will no longer destroy blocks when PvPing.");
  19.         getConfig().addDefault(toggleOffMessage, ChatColor.GREEN + "You will now destroy blocks when PvPing.");
  20.         getConfig().addDefault(noPermission, ChatColor.RED + "You do not have permission.");
  21.         getConfig().options().copyDefaults(true);
  22.         saveConfig();
  23.  
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement