mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-11 21:06:55 +00:00
use internal method for message sending, replace some try/catch with null checks
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user