use internal method for message sending, replace some try/catch with null checks

This commit is contained in:
2022-05-14 11:53:31 +02:00
parent 4088a6dd5b
commit 5a36ba7748
7 changed files with 104 additions and 103 deletions
@@ -55,6 +55,7 @@ public class WorldGuardHook {
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
RegionQuery query = container.createQuery();
org.bukkit.Location loc = player.getLocation();
if (loc.getWorld() == null) return false;
LocalPlayer localPlayer = WorldGuardPlugin.inst().wrapPlayer(player);
ApplicableRegionSet set = query.getApplicableRegions(new Location(BukkitAdapter.adapt(loc.getWorld()), loc.getX(), loc.getY(), loc.getZ()));
return set.testState(localPlayer, FORCE_PVP_FLAG);