Fixed Chest Removal Bug

Wasn't removing chest from Chest Link Menu
This commit is contained in:
jameslfc19 2020-04-16 11:48:03 +01:00
parent 18e865d63e
commit 81410994cc
3 changed files with 16 additions and 0 deletions

View File

@ -128,7 +128,12 @@ public class Config {
}
});
storage.dropInventory(player.getLocation());
getPlayer(player).remove(group);
Messages.REMOVED_GROUP(player,group);
} else {
Messages.GROUP_DOESNT_EXIST(player,group);
}
save();
}

View File

@ -58,4 +58,12 @@ public class Messages {
public static void UNABLE_TO_REMOVE_MEMBER(Player target, String toAdd){
target.sendMessage(ChatColor.RED+""+ChatColor.BOLD+TAG+" Unable to remove player "+toAdd+" from ChestLink! Were they already removed?");
}
public static void REMOVED_GROUP(Player target, String toRemove){
target.sendMessage(ChatColor.RED+""+ChatColor.BOLD+TAG+" Succesfully removed group "+toRemove+" from your ChestLink!");
}
public static void GROUP_DOESNT_EXIST(Player target, String toRemove){
target.sendMessage(ChatColor.RED+""+ChatColor.BOLD+TAG+" "+toRemove+" isn't a valid group to remove!");
}
}

View File

@ -102,6 +102,9 @@ public class RemoteChestCommand extends ServerCommand {
if (sender.hasPermission(Permissions.REMOVE)) {
Config.removeChestLink(player, args[1]);
return true;
} else {
Messages.NO_PERMISSION(player);
return true;
}
} else {
player.sendMessage(ChatColor.RED+OPTIONS.REMOVE.commandHelp);