Lastmask / preciousstones fix
This commit is contained in:
parent
f8e1bb0b71
commit
e535f8adc9
3
.gitignore
vendored
3
.gitignore
vendored
@ -12,4 +12,5 @@
|
|||||||
/.idea
|
/.idea
|
||||||
/forge/build
|
/forge/build
|
||||||
forge/.gradle/gradle.log
|
forge/.gradle/gradle.log
|
||||||
*.log
|
*.log
|
||||||
|
/lib
|
@ -3,9 +3,9 @@ package com.boydti.fawe.bukkit.regions;
|
|||||||
import com.boydti.fawe.bukkit.FaweBukkit;
|
import com.boydti.fawe.bukkit.FaweBukkit;
|
||||||
import com.boydti.fawe.object.FawePlayer;
|
import com.boydti.fawe.object.FawePlayer;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.sacredlabyrinth.Phaed.PreciousStones.FieldFlag;
|
|
||||||
import net.sacredlabyrinth.Phaed.PreciousStones.PreciousStones;
|
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.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
@ -2,6 +2,7 @@ package com.boydti.fawe.util;
|
|||||||
|
|
||||||
import com.boydti.fawe.config.BBC;
|
import com.boydti.fawe.config.BBC;
|
||||||
import com.boydti.fawe.config.Settings;
|
import com.boydti.fawe.config.Settings;
|
||||||
|
import com.boydti.fawe.object.FaweLocation;
|
||||||
import com.boydti.fawe.object.FawePlayer;
|
import com.boydti.fawe.object.FawePlayer;
|
||||||
import com.boydti.fawe.object.RegionWrapper;
|
import com.boydti.fawe.object.RegionWrapper;
|
||||||
import com.boydti.fawe.object.extent.NullExtent;
|
import com.boydti.fawe.object.extent.NullExtent;
|
||||||
@ -42,6 +43,7 @@ public class WEManager {
|
|||||||
final HashSet<RegionWrapper> regions = new HashSet<>();
|
final HashSet<RegionWrapper> regions = new HashSet<>();
|
||||||
if (player.hasPermission("fawe.bypass") || !Settings.REGION_RESTRICTIONS) {
|
if (player.hasPermission("fawe.bypass") || !Settings.REGION_RESTRICTIONS) {
|
||||||
regions.add(new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE));
|
regions.add(new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE));
|
||||||
|
player.deleteMeta("lastmask");
|
||||||
return regions;
|
return regions;
|
||||||
}
|
}
|
||||||
for (final FaweMaskManager manager : this.managers) {
|
for (final FaweMaskManager manager : this.managers) {
|
||||||
@ -52,6 +54,20 @@ public class WEManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (regions.size() == 0) {
|
||||||
|
HashSet<RegionWrapper> mask = player.<HashSet<RegionWrapper>>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;
|
return regions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user