diff --git a/src/main/java/net/knarcraft/clearonworldguard/listener/PlayerListener.java b/src/main/java/net/knarcraft/clearonworldguard/listener/PlayerListener.java index 459b2b6..833cab3 100644 --- a/src/main/java/net/knarcraft/clearonworldguard/listener/PlayerListener.java +++ b/src/main/java/net/knarcraft/clearonworldguard/listener/PlayerListener.java @@ -113,7 +113,7 @@ public class PlayerListener extends WorldGuardListener { private boolean updateClearRegions(@NotNull Player player, @NotNull Location from, @NotNull Location to) { Set regionsEntered = getRegionsEntered(from, to); if (!regionsEntered.isEmpty()) { - if (!player.getInventory().isEmpty()) { + if (!player.getInventory().isEmpty() || player.isInsideVehicle() || !player.getPassengers().isEmpty()) { return true; } Bukkit.getPluginManager().callEvent(new EnterClearRegionEvent(player, regionsEntered)); @@ -172,8 +172,8 @@ public class PlayerListener extends WorldGuardListener { // Block usage of spawn eggs ItemStack item = event.getItem(); - if (item != null && isInClearRegion(player) && item.hasItemMeta()) { - ItemMeta meta = event.getItem().getItemMeta(); + if (item != null && PlayerRegionTracker.isInClearRegion(player)) { + ItemMeta meta = item.getItemMeta(); if (meta instanceof SpawnEggMeta && !player.hasPermission(Permission.BYPASS_MOB_SPAWNING.toString())) { ClearOnWorldGuard.logDebugMessage("Prevented player " + player + " from using the spawn egg " + item); event.setCancelled(true);