@EventHandler public void handle(EntityPortalExitEvent event) { val remove = portal.remove(event.getEntity().getUniqueId()); if (!nil(remove)) { remove.cancel(); } }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void EntityPortalExitEvent(EntityPortalExitEvent event) { if (event.getEntityType() == EntityType.VILLAGER) { final Entity villager = event.getEntity(); TradeCraftVillager tcv = Villagers.getVillager(villager.getUniqueId().toString()); if(tcv != null) { Logs.debug("portal exit " + tcv.getUUID()); tcv.setPortaling(false); } } }