mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-24 17:11:40 +01:00
Make region wand act more like /rg info.
Addresses the part that #1534 and #1817 missed.
This commit is contained in:
parent
40adfe9cef
commit
7ae7a04721
@ -258,13 +258,11 @@ private void handleBlockRightClick(PlayerInteractEvent event) {
|
||||
}
|
||||
|
||||
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"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user