mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-24 19:15:48 +01:00
a49d51ce97
- Added partial transactions (You have 5 items, shop wants 10 - you can sell your items for half the price) - Added a warning to the HTML generator - Fixed Towny integration - Fixed occasional ArrayOutOfBoundsExceptions - Fixed an error when a shop couldn't be created because a sign (not shop sign) was on other side of the block - Added SCL (SimpleChestLock) protection plugin to supported plugins - Updated Metrics (and added a new asynch thread for startup) - Removed Bukkit-1.0 workaround - Fixed plugin.yml formatting
36 lines
783 B
Java
36 lines
783 B
Java
package com.Acrobot.ChestShop.Utils;
|
|
|
|
/**
|
|
* Checks if string is a numerical value
|
|
*
|
|
* @author Acrobot
|
|
*/
|
|
public class uNumber {
|
|
public static boolean isInteger(String string) {
|
|
try {
|
|
Integer.parseInt(string);
|
|
return true;
|
|
} catch (NumberFormatException e) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static boolean isFloat(String string) {
|
|
try {
|
|
Float.parseFloat(string);
|
|
return true;
|
|
} catch (NumberFormatException e) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static boolean isDouble(String string) {
|
|
try {
|
|
Double.parseDouble(string);
|
|
return true;
|
|
} catch (NumberFormatException e) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|