Fix problem with default value 'unlimited' for maxRentTime

This commit is contained in:
Thijs Wiefferink 2015-06-21 19:29:54 +02:00
parent a0239b8837
commit 937db4620d
2 changed files with 4 additions and 2 deletions

View File

@ -698,10 +698,12 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
* @return The duration in milliseconds translated from the durationstring, or if it is invalid then 0
*/
public long durationStringToLong(String duration) {
if(duration == null || duration.indexOf(' ') == -1) {
if(duration == null) {
return 0;
} else if(duration.equalsIgnoreCase("disabled") || duration.equalsIgnoreCase("unlimited")) {
return -1;
} else if(duration.indexOf(' ') == -1) {
return 0;
}
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(0);

View File

@ -1815,7 +1815,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface {
while(!groups.isEmpty()) {
String group = groups.get(0);
if(player.hasPermission("areashop.limits." + group) && this.matchesLimitGroup(group)) {
AreaShop.debug(" has group: " + group);
AreaShop.debug(player.getName() + " has limitGroup: " + group);
int totalLimit = plugin.getConfig().getInt("limitGroups." + group + ".total");
int rentsLimit = plugin.getConfig().getInt("limitGroups." + group + ".rents");
int totalCurrent = hasRegionsInLimitGroup(player, group, totalRegions);