@Override void onUpdate() { if (as != null && as.isValid()) { as.setHeadPose(as.getHeadPose().add(0, 0.1, 0)); UtilParticles.display(Particles.PORTAL, 3f, 3f, 3f, as.getLocation(), 150); UtilParticles.display(Particles.SPELL_WITCH, .3f, .3f, .3f, as.getEyeLocation(), 5); for (Entity ent : as.getNearbyEntities(3, 2, 3)) { if (ent instanceof LivingEntity && !(ent instanceof ArmorStand)) MathUtils.applyVelocity(ent, new Vector(0, 0.05, 0)); } } }
@EventHandler public void onKick(PlayerKickEvent event) { try { if (running) { if (as != null && as.isValid() && event.getReason().contains("Fly")) { if (as.getLocation().distance(event.getPlayer().getLocation()) < 8) { event.setCancelled(true); System.out.println("UltraCosmetics >> Cancelling invalid Flight KicK."); return; } } event.setCancelled(true); System.out.println("UltraCosmetics >> Cancelling invalid Flight KicK."); return; } } catch (Exception exc) { } }