mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 15:09:19 +00:00
user == null return on WG listener
This commit is contained in:
@@ -17,13 +17,14 @@ public class WGListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerMove(PlayerMoveEvent event) {
|
public void onPlayerMove(PlayerMoveEvent event) {
|
||||||
|
CosmeticUser user = CosmeticUsers.getUser(event.getPlayer());
|
||||||
|
if (user == null) return;
|
||||||
Location location = event.getPlayer().getLocation();
|
Location location = event.getPlayer().getLocation();
|
||||||
com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(location);
|
com.sk89q.worldedit.util.Location loc = BukkitAdapter.adapt(location);
|
||||||
RegionContainer region = WorldGuard.getInstance().getPlatform().getRegionContainer();
|
RegionContainer region = WorldGuard.getInstance().getPlatform().getRegionContainer();
|
||||||
RegionQuery query = region.createQuery();
|
RegionQuery query = region.createQuery();
|
||||||
ApplicableRegionSet set = query.getApplicableRegions(loc);
|
ApplicableRegionSet set = query.getApplicableRegions(loc);
|
||||||
// TODO: Add more cosmetics
|
// TODO: Add more cosmetics
|
||||||
CosmeticUser user = CosmeticUsers.getUser(event.getPlayer());
|
|
||||||
if (set.getRegions().size() == 0) {
|
if (set.getRegions().size() == 0) {
|
||||||
user.showCosmetics();
|
user.showCosmetics();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user