v1.1.3 Update || Small fix

This update fixes a small bug that was reported. Minecraft 1.11 should
already be supported and not break this plugin when updating to 1.11.
Bug:
  - Small bug with how the numbers work.
This commit is contained in:
BadBones69 2016-11-18 10:04:58 -05:00
parent 92420f2a8a
commit 8f17e3d751
3 changed files with 12 additions and 3 deletions

View File

@ -2,7 +2,7 @@ name: CrazyAuctions
author: BadBones69
main: me.badbones69.crazyauctions.Main
website: https://www.spigotmc.org/resources/authors/kicjow.9719/
version: 1.1.2
version: 1.1.3
depend: [Vault]
description: >
A plugin to auction off items globally.

View File

@ -188,6 +188,15 @@ public class Api {
return true;
}
public static boolean isLong(String s) {
try {
Long.parseLong(s);
} catch (NumberFormatException nfe) {
return false;
}
return true;
}
public static Player getPlayer(String name){
return Bukkit.getServer().getPlayer(name);
}

View File

@ -154,7 +154,7 @@ public class Main extends JavaPlugin implements Listener{
if(amount<=0)amount=1;
if(amount>item.getAmount())amount=item.getAmount();
}
if(!Api.isInt(args[1])){
if(!Api.isLong(args[1])){
player.sendMessage(Api.getPrefix()+Api.color(settings.getMsg().getString("Messages.Not-A-Number")
.replaceAll("%Arg%", args[1]).replaceAll("%arg%", args[1])));
return true;
@ -163,7 +163,7 @@ public class Main extends JavaPlugin implements Listener{
player.sendMessage(Api.getPrefix()+Api.color(settings.getMsg().getString("Messages.Doesnt-Have-Item-In-Hand")));
return false;
}
int price = Integer.parseInt(args[1]);
Long price = Long.parseLong(args[1]);
if(args[0].equalsIgnoreCase("Bid")){
if(price<settings.getConfig().getLong("Settings.Minimum-Bid-Price")){
player.sendMessage(Api.getPrefix()+Api.color(settings.getMsg().getString("Messages.Bid-Price-To-Low")));