v1.1.4 Update || Less bugs and a new Aliases.

Hello, this update fixes a couple bugs and also adds the /HDV aliases
so players in Europe because they use that instead of /Ac.

Added:
- /HDV aliases to the command so some servers in Europe.

Bugs:
- Error in console when trying to get a players money.
- Players loosing items when inventory is full.
This commit is contained in:
BadBones69 2016-11-22 18:26:08 -05:00
parent 8f17e3d751
commit 6f429b38f4
4 changed files with 23 additions and 14 deletions

View File

@ -2,11 +2,11 @@ name: CrazyAuctions
author: BadBones69
main: me.badbones69.crazyauctions.Main
website: https://www.spigotmc.org/resources/authors/kicjow.9719/
version: 1.1.3
version: 1.1.4
depend: [Vault]
description: >
A plugin to auction off items globally.
commands:
ca:
description: Opens the Crazy Auctions GUI.
aliases: [crazyauction, crazyauctions, ah]
aliases: [crazyauction, crazyauctions, ah, hdv]

View File

@ -29,7 +29,10 @@ public class Vault {
return econ != null;
}
public static Long getMoney(Player player){
return (long) econ.getBalance(player);
if(player != null){
return (long) econ.getBalance(player);
}
return 0L;
}
public static void removeMoney(Player player, Long amount){
econ.withdrawPlayer(player, amount);

View File

@ -906,15 +906,20 @@ public class GUI implements Listener{
for(String i : data.getConfigurationSection("OutOfTime/Cancelled").getKeys(false)){
int ID = data.getInt("OutOfTime/Cancelled."+i+".StoreID");
if(id==ID){
T=true;
player.sendMessage(Api.getPrefix()+Api.color(msg.getString("Messages.Got-Item-Back")));
ItemStack IT = data.getItemStack("OutOfTime/Cancelled."+i+".Item");
player.getInventory().addItem(IT);
data.set("OutOfTime/Cancelled."+i, null);
Main.settings.saveData();
playClick(player);
openPlayersExpiredList(player, 1);
return;
if(!Api.isInvFull(player)){
T=true;
player.sendMessage(Api.getPrefix()+Api.color(msg.getString("Messages.Got-Item-Back")));
ItemStack IT = data.getItemStack("OutOfTime/Cancelled."+i+".Item");
player.getInventory().addItem(IT);
data.set("OutOfTime/Cancelled."+i, null);
Main.settings.saveData();
playClick(player);
openPlayersExpiredList(player, 1);
return;
}else{
player.sendMessage(Api.getPrefix() + Api.color(msg.getString("Messages.Inventory-Full")));
return;
}
}
}
}

View File

@ -56,8 +56,9 @@ public class Main extends JavaPlugin implements Listener{
}
public boolean onCommand(CommandSender sender, Command cmd, String commandLable, String[] args){
if(commandLable.equalsIgnoreCase("CrazyAuctions")||commandLable.equalsIgnoreCase("CrazyAuction")
||commandLable.equalsIgnoreCase("CA")||commandLable.equalsIgnoreCase("AH")){
if(commandLable.equalsIgnoreCase("CrazyAuctions") || commandLable.equalsIgnoreCase("CrazyAuction")
|| commandLable.equalsIgnoreCase("CA") || commandLable.equalsIgnoreCase("AH")
|| commandLable.equalsIgnoreCase("HDV")){
if(args.length == 0){
if(!Api.hasPermission(sender, "Access"))return true;
if(!(sender instanceof Player)){