mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 21:56:33 +01:00
Fix region caching
This commit is contained in:
parent
d61c21f60e
commit
8461f406cf
@ -69,6 +69,9 @@ public class WEManager {
|
|||||||
*/
|
*/
|
||||||
public RegionWrapper[] getMask(final FawePlayer<?> player) {
|
public RegionWrapper[] getMask(final FawePlayer<?> player) {
|
||||||
// HashSet<RegionWrapper> mask = TaskManager.IMP.sync(new RunnableVal<HashSet<RegionWrapper>>() {
|
// HashSet<RegionWrapper> mask = TaskManager.IMP.sync(new RunnableVal<HashSet<RegionWrapper>>() {
|
||||||
|
if (player.hasPermission("fawe.bypass") || !Settings.REGION_RESTRICTIONS) {
|
||||||
|
return new RegionWrapper[] {new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE)};
|
||||||
|
}
|
||||||
HashSet<RegionWrapper> mask = new RunnableVal<HashSet<RegionWrapper>>() {
|
HashSet<RegionWrapper> mask = new RunnableVal<HashSet<RegionWrapper>>() {
|
||||||
@Override
|
@Override
|
||||||
public void run(HashSet<RegionWrapper> ignore) {
|
public void run(HashSet<RegionWrapper> ignore) {
|
||||||
@ -79,14 +82,16 @@ public class WEManager {
|
|||||||
player.deleteMeta("lastMask");
|
player.deleteMeta("lastMask");
|
||||||
}
|
}
|
||||||
player.setMeta("lastMaskWorld", world);
|
player.setMeta("lastMaskWorld", world);
|
||||||
if (player.hasPermission("fawe.bypass") || !Settings.REGION_RESTRICTIONS) {
|
|
||||||
value.add(new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (final FaweMaskManager manager : managers) {
|
for (final FaweMaskManager manager : managers) {
|
||||||
if (player.hasPermission("fawe." + manager.getKey())) {
|
if (player.hasPermission("fawe." + manager.getKey())) {
|
||||||
final FaweMask mask = manager.getMask(player);
|
final FaweMask mask = manager.getMask(player);
|
||||||
if (mask != null) {
|
if (mask != null) {
|
||||||
|
TaskManager.IMP.async(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
value.addAll(mask.getRegions());
|
value.addAll(mask.getRegions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user