mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-06-25 22:04:44 +02:00
Small fixes
This commit is contained in:
parent
ef91e8ccb5
commit
0a5707c4d8
|
@ -73,9 +73,10 @@ public class NumberUtil {
|
||||||
public static double roundUp(double number) {
|
public static double roundUp(double number) {
|
||||||
return Math.ceil(number * 100) / 100;
|
return Math.ceil(number * 100) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rounds the number down to two decimal points
|
* Rounds the number down to two decimal points
|
||||||
*
|
*
|
||||||
* @param number Number to round
|
* @param number Number to round
|
||||||
* @return Rounded number
|
* @return Rounded number
|
||||||
*/
|
*/
|
||||||
|
@ -101,16 +102,12 @@ public class NumberUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a number to roman
|
* Converts a number to roman (only 1-9, because of the enchantment decorations)
|
||||||
*
|
*
|
||||||
* @param number number to convert
|
* @param number number to convert
|
||||||
* @return Converted number
|
* @return Converted number
|
||||||
*/
|
*/
|
||||||
public static String toRoman(int number) {
|
public static String toRoman(int number) {
|
||||||
if (number < 1 || number > 9) {
|
|
||||||
throw new IllegalArgumentException("The number must be in range 1-9 (This is only for enchantment level decoration)");
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (number) {
|
switch (number) {
|
||||||
case 1:
|
case 1:
|
||||||
return "I";
|
return "I";
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.Acrobot.ChestShop.ChestShop;
|
||||||
import com.avaje.ebean.ExpressionList;
|
import com.avaje.ebean.ExpressionList;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
||||||
|
import javax.persistence.PersistenceException;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -162,7 +163,10 @@ public class Generator implements Runnable {
|
||||||
fileEnd(generationTime);
|
fileEnd(generationTime);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ChestShop.getBukkitLogger().severe("Couldn't generate statistics page!");
|
ChestShop.getBukkitLogger().severe("Couldn't generate statistics page!");
|
||||||
e.printStackTrace();
|
|
||||||
|
if (!(e instanceof PersistenceException)) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,14 +21,14 @@ public class ChestShopSign {
|
||||||
public static final byte ITEM_LINE = 3;
|
public static final byte ITEM_LINE = 3;
|
||||||
|
|
||||||
public static final Pattern[] SHOP_SIGN_PATTERN = {
|
public static final Pattern[] SHOP_SIGN_PATTERN = {
|
||||||
Pattern.compile("^$|^\\w.+$"),
|
Pattern.compile("^[\\w ]*$"),
|
||||||
Pattern.compile("[0-9]+"),
|
Pattern.compile("[0-9]+"),
|
||||||
Pattern.compile(".+"),
|
Pattern.compile("^[\\dbs(free) :]+$"),
|
||||||
Pattern.compile("[\\w : -]+")
|
Pattern.compile("[\\w : -]+")
|
||||||
};
|
};
|
||||||
|
|
||||||
public static boolean isAdminShop(String owner) {
|
public static boolean isAdminShop(String owner) {
|
||||||
return owner.toLowerCase().replace(" ", "").equals(Config.getString(ADMIN_SHOP_NAME).toLowerCase().replace(" ", ""));
|
return owner.replace(" ", "").equalsIgnoreCase(Config.getString(ADMIN_SHOP_NAME).replace(" ", ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAdminShop(Sign sign) {
|
public static boolean isAdminShop(Sign sign) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user