Skip to content

Commit

Permalink
Fixed holograms of stacked blocks being checked for entity limits (#1041
Browse files Browse the repository at this point in the history
)
  • Loading branch information
OmerBenGera committed Apr 9, 2022
1 parent 151cef5 commit 5841978
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -63,6 +63,9 @@ private final class EntityLimitsListener implements Listener {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onEntitySpawn(CreatureSpawnEvent e) {
if (EntityUtils.canBypassEntityLimit(e.getEntity()))
return;

Island island = plugin.getGrid().getIslandAt(e.getLocation());

if (island == null)
Expand All @@ -80,6 +83,9 @@ public void onEntitySpawn(CreatureSpawnEvent e) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onHangingPlace(HangingPlaceEvent e) {
if (EntityUtils.canBypassEntityLimit(e.getEntity()))
return;

Island island = plugin.getGrid().getIslandAt(e.getEntity().getLocation());

if (island == null)
Expand Down Expand Up @@ -119,7 +125,7 @@ public void onVehicleSpawn(PlayerInteractEvent e) {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onVehicleSpawn(VehicleCreateEvent e) {
if (!(e.getVehicle() instanceof Minecart))
if (!(e.getVehicle() instanceof Minecart) || EntityUtils.canBypassEntityLimit(e.getVehicle()))
return;

Island island = plugin.getGrid().getIslandAt(e.getVehicle().getLocation());
Expand Down

0 comments on commit 5841978

Please sign in to comment.