Fixes FS-314

This commit is contained in:
Video 2022-11-04 22:58:36 -06:00
parent af710edc88
commit 3b61ba408f

View File

@ -163,15 +163,12 @@ public class EventBlocker extends FreedomService
if (ConfigEntry.ENABLE_PET_PROTECT.getBoolean()) if (ConfigEntry.ENABLE_PET_PROTECT.getBoolean())
{ {
Entity entity = event.getEntity(); Entity entity = event.getEntity();
if (entity instanceof Tameable) if (entity instanceof Tameable tameable && tameable.isTamed())
{
if (((Tameable) entity).isTamed())
{ {
event.setCancelled(true); event.setCancelled(true);
} }
} }
} }
}
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void onPlayerDropItem(PlayerDropItemEvent event) public void onPlayerDropItem(PlayerDropItemEvent event)