From e535f8adc9770a8d589ec35f31f2b2297b0d649d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 19 Apr 2016 06:48:58 +1000 Subject: [PATCH] Lastmask / preciousstones fix --- .gitignore | 3 ++- .../bukkit/regions/PreciousStonesFeature.java | 4 ++-- .../java/com/boydti/fawe/util/WEManager.java | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 21b1008d..2a8bbaca 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ /.idea /forge/build forge/.gradle/gradle.log -*.log \ No newline at end of file +*.log +/lib \ No newline at end of file diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/regions/PreciousStonesFeature.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/regions/PreciousStonesFeature.java index 7682d9c6..093bb3cc 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/regions/PreciousStonesFeature.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/regions/PreciousStonesFeature.java @@ -3,9 +3,9 @@ package com.boydti.fawe.bukkit.regions; import com.boydti.fawe.bukkit.FaweBukkit; import com.boydti.fawe.object.FawePlayer; import java.util.List; -import net.sacredlabyrinth.Phaed.PreciousStones.FieldFlag; import net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones; -import net.sacredlabyrinth.Phaed.PreciousStones.vectors.Field; +import net.sacredlabyrinth.Phaed.PreciousStones.field.Field; +import net.sacredlabyrinth.Phaed.PreciousStones.field.FieldFlag; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.Listener; diff --git a/core/src/main/java/com/boydti/fawe/util/WEManager.java b/core/src/main/java/com/boydti/fawe/util/WEManager.java index 23811d86..a1279f0a 100644 --- a/core/src/main/java/com/boydti/fawe/util/WEManager.java +++ b/core/src/main/java/com/boydti/fawe/util/WEManager.java @@ -2,6 +2,7 @@ package com.boydti.fawe.util; import com.boydti.fawe.config.BBC; import com.boydti.fawe.config.Settings; +import com.boydti.fawe.object.FaweLocation; import com.boydti.fawe.object.FawePlayer; import com.boydti.fawe.object.RegionWrapper; import com.boydti.fawe.object.extent.NullExtent; @@ -42,6 +43,7 @@ public class WEManager { final HashSet regions = new HashSet<>(); if (player.hasPermission("fawe.bypass") || !Settings.REGION_RESTRICTIONS) { regions.add(new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE)); + player.deleteMeta("lastmask"); return regions; } for (final FaweMaskManager manager : this.managers) { @@ -52,6 +54,20 @@ public class WEManager { } } } + if (regions.size() == 0) { + HashSet mask = player.>getMeta("lastmask"); + if (mask != null) { + FaweLocation loc = player.getLocation(); + for (RegionWrapper region : mask) { + if (region.isIn(loc.x, loc.z)) { + player.deleteMeta("lastmask"); + return regions; + } + } + return mask; + } + } + player.setMeta("lastmask", regions); return regions; }