Skip to content

Commit

Permalink
Reload Command
Browse files Browse the repository at this point in the history
  • Loading branch information
endercrest committed Mar 29, 2014
1 parent 6d2784a commit 3139c69
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions com/endercrest/DisplayChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public void onEnable(){

@Override
public void onDisable(){
this.saveConfig();
}

@SuppressWarnings("deprecation")
Expand All @@ -35,10 +34,10 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
if(args.length > 1){
p.sendMessage("You have too many arguments");
}else if(args.length == 0){
p.sendMessage("To use this command: /dc [create/remove]");
p.sendMessage("To use this command: /dc [create/remove/reload]");
return true;
}else if(args.length == 1){
if(args[0].equalsIgnoreCase("create") || args[0].equalsIgnoreCase("remove")){
if(args[0].equalsIgnoreCase("create") || args[0].equalsIgnoreCase("remove") || args[0].equalsIgnoreCase("reload")){
if(args[0].equalsIgnoreCase("create")){
//Code Goes Here To create Chest
if(p.getTargetBlock(null, 5).getType() == Material.CHEST || p.getTargetBlock(null, 5).getType() == Material.TRAPPED_CHEST){
Expand All @@ -61,6 +60,11 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
}
return true;
}
if(args[0].equalsIgnoreCase("reload")){
this.reloadConfig();
p.sendMessage("The Config has been reloaded.");
return true;
}
}
}
}
Expand Down

0 comments on commit 3139c69

Please sign in to comment.