diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 79ade15..c2359b9 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -20,6 +20,7 @@ package me.ryanhamshire.GriefPrevention; import me.ryanhamshire.GriefPrevention.DataStore.NoTransferException; import me.ryanhamshire.GriefPrevention.alttd.tasks.ClaimExpireTask; +import me.ryanhamshire.GriefPrevention.alttd.tasks.IgnoreClaimWarningTask; import me.ryanhamshire.GriefPrevention.events.PreventBlockBreakEvent; import me.ryanhamshire.GriefPrevention.events.SaveTrappedPlayerEvent; import me.ryanhamshire.GriefPrevention.events.TrustChangedEvent; @@ -246,6 +247,8 @@ public class GriefPrevention extends JavaPlugin private Pl3xMapHook pl3xmapHook; + private HashMap ignoreClaimWarningTasks; + //how far away to search from a tree trunk for its branch blocks public static final int TREE_RADIUS = 5; @@ -403,6 +406,7 @@ public class GriefPrevention extends JavaPlugin if (getServer().getPluginManager().isPluginEnabled("Pl3xMap")) { pl3xmapHook = new Pl3xMapHook(this); } + ignoreClaimWarningTasks = new HashMap<>(); AddLogEntry("Boot finished."); try @@ -1301,14 +1305,21 @@ public class GriefPrevention extends JavaPlugin playerData.ignoreClaims = !playerData.ignoreClaims; + UUID uuid = player.getUniqueId(); //toggle ignore claims mode on or off if (!playerData.ignoreClaims) { GriefPrevention.sendMessage(player, TextMode.Success, Messages.RespectingClaims); + if(ignoreClaimWarningTasks.containsKey(uuid)) + { + ignoreClaimWarningTasks.get(uuid).cancel(); + ignoreClaimWarningTasks.remove(uuid); + } } else { GriefPrevention.sendMessage(player, TextMode.Success, Messages.IgnoringClaims); + ignoreClaimWarningTasks.put(uuid, new IgnoreClaimWarningTask(this, uuid)); } return true; diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/alttd/config/AlttdConfig.java b/src/main/java/me/ryanhamshire/GriefPrevention/alttd/config/AlttdConfig.java index 250d62a..09117fd 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/alttd/config/AlttdConfig.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/alttd/config/AlttdConfig.java @@ -165,4 +165,13 @@ public class AlttdConfig extends AbstractConfiguration EXPIRING_CLAIM_TOOLTIP = config.getString("settings.region.tooltip.expiring-claim", EXPIRING_CLAIM_TOOLTIP); } + public static int ignoreClaimWarningDelay = 20 * 600; + public static String ignoreClaimWarningMessage = " has had ignore claims on since