Make region wand act more like /rg info.

Addresses the part that #1534 and #1817 missed.
This commit is contained in:
wizjany 2023-05-16 15:25:52 -04:00
parent 40adfe9cef
commit 7ae7a04721
No known key found for this signature in database
GPG Key ID: 1DB5861C03B76B5E
1 changed files with 2 additions and 4 deletions

View File

@ -258,13 +258,11 @@ public class WorldGuardPlayerListener extends AbstractListener {
}
if (wcfg.useRegions) {
//Block placedIn = block.getRelative(event.getBlockFace());
ApplicableRegionSet set =
WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery().getApplicableRegions(BukkitAdapter.adapt(block.getLocation()));
//ApplicableRegionSet placedInSet = plugin.getRegionContainer().createQuery().getApplicableRegions(placedIn.getLocation());
LocalPlayer localPlayer = getPlugin().wrapPlayer(player);
if (item != null && item.getType().getKey().toString().equals(wcfg.regionWand) && getPlugin().hasPermission(player, "worldguard.region.wand")) {
ApplicableRegionSet set = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery()
.getApplicableRegions(BukkitAdapter.adapt(block.getLocation()), RegionQuery.QueryOption.SORT);
if (set.size() > 0) {
player.sendMessage(ChatColor.YELLOW + "Can you build? " + (set.testState(localPlayer, Flags.BUILD) ? "Yes" : "No"));