From a14dc4e5412ba90b329c9515a6c8fa99b7fd0897 Mon Sep 17 00:00:00 2001 From: Thijs Wiefferink Date: Mon, 29 Dec 2014 16:39:54 +0100 Subject: [PATCH] Fix a bug with the periodic updating of signs If there is no sign connected to the region it would spam an error to the console when the periodic update task runs. --- src/nl/evolutioncoding/areashop/regions/BuyRegion.java | 2 +- src/nl/evolutioncoding/areashop/regions/GeneralRegion.java | 2 +- src/nl/evolutioncoding/areashop/regions/RentRegion.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nl/evolutioncoding/areashop/regions/BuyRegion.java b/src/nl/evolutioncoding/areashop/regions/BuyRegion.java index f877f7a..d68dd68 100644 --- a/src/nl/evolutioncoding/areashop/regions/BuyRegion.java +++ b/src/nl/evolutioncoding/areashop/regions/BuyRegion.java @@ -406,7 +406,7 @@ public class BuyRegion extends GeneralRegion { if(inactiveSetting <= 0 || player.isOp()) { return false; } - AreaShop.debug("inactivetimemillis: " + inactiveSetting * 60 * 1000); + //AreaShop.debug("inactivetimemillis: " + inactiveSetting * 60 * 1000); if(Calendar.getInstance().getTimeInMillis() > (player.getLastPlayed() + inactiveSetting * 60 * 1000)) { plugin.getLogger().info("Region " + getName() + " sold because of inactivity for player " + getPlayerName()); this.sell(true); diff --git a/src/nl/evolutioncoding/areashop/regions/GeneralRegion.java b/src/nl/evolutioncoding/areashop/regions/GeneralRegion.java index e45f60c..84c260d 100644 --- a/src/nl/evolutioncoding/areashop/regions/GeneralRegion.java +++ b/src/nl/evolutioncoding/areashop/regions/GeneralRegion.java @@ -654,7 +654,7 @@ public abstract class GeneralRegion { if(isDeleted() || !isRentRegion()) { return false; } - Set signs = null; + Set signs = new HashSet(); if(config.getConfigurationSection("general.signs") != null) { signs = config.getConfigurationSection("general.signs").getKeys(false); } diff --git a/src/nl/evolutioncoding/areashop/regions/RentRegion.java b/src/nl/evolutioncoding/areashop/regions/RentRegion.java index 28f61e4..f670e6c 100644 --- a/src/nl/evolutioncoding/areashop/regions/RentRegion.java +++ b/src/nl/evolutioncoding/areashop/regions/RentRegion.java @@ -607,7 +607,7 @@ public class RentRegion extends GeneralRegion { if(inactiveSetting <= 0 || player.isOp()) { return false; } - AreaShop.debug("inactivetimemillis: " + inactiveSetting * 60 * 1000); + //AreaShop.debug("inactivetimemillis: " + inactiveSetting * 60 * 1000); if(Calendar.getInstance().getTimeInMillis() > (player.getLastPlayed() + inactiveSetting * 60 * 1000)) { plugin.getLogger().info("Region " + getName() + " unrented because of inactivity for player " + getPlayerName()); this.unRent(true);