Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-20 01:40:06 +01:00
fix: invalidate cached allowed regions if WG region deleted (#2572)
Dieser Commit ist enthalten in:
Ursprung
a502287906
Commit
d1e1d5105e
@ -163,13 +163,22 @@ public class WorldGuardFeature extends BukkitMaskManager implements Listener {
|
||||
final Location location = player.getLocation();
|
||||
final Set<ProtectedRegion> regions = this.getRegions(localplayer, location, isWhitelist);
|
||||
if (!regions.isEmpty()) {
|
||||
RegionManager manager = WorldGuard
|
||||
.getInstance()
|
||||
.getPlatform()
|
||||
.getRegionContainer()
|
||||
.get(BukkitAdapter.adapt(location.getWorld()));
|
||||
if (manager == null) {
|
||||
return null;
|
||||
}
|
||||
Set<Region> result = new HashSet<>();
|
||||
for (ProtectedRegion myRegion : regions) {
|
||||
if (myRegion.getId().equals("__global__")) {
|
||||
return new FaweMask(RegionWrapper.GLOBAL()) {
|
||||
@Override
|
||||
public boolean isValid(com.sk89q.worldedit.entity.Player player, MaskType type) {
|
||||
return isAllowed(worldguard.wrapPlayer(BukkitAdapter.adapt(player)), myRegion);
|
||||
return manager.hasRegion(myRegion.getId())
|
||||
&& isAllowed(worldguard.wrapPlayer(BukkitAdapter.adapt(player)), myRegion);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
@ -185,7 +194,7 @@ public class WorldGuardFeature extends BukkitMaskManager implements Listener {
|
||||
public boolean isValid(com.sk89q.worldedit.entity.Player player, MaskType type) {
|
||||
final LocalPlayer localplayer = worldguard.wrapPlayer(BukkitAdapter.adapt(player));
|
||||
for (ProtectedRegion myRegion : regions) {
|
||||
if (!isAllowed(localplayer, myRegion)) {
|
||||
if (!manager.hasRegion(myRegion.getId()) || !isAllowed(localplayer, myRegion)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren