@Override void onRightClick() { as = getPlayer().getWorld().spawn(getPlayer().getLocation(), ArmorStand.class); as.setGravity(false); as.setSmall(true); running = true; as.setVisible(false); as.setHelmet(new ItemStack(Material.SEA_LANTERN)); Bukkit.getScheduler() .runTaskLater( UltraCosmetics.getInstance(), new Runnable() { @Override public void run() { as.remove(); as = null; Bukkit.getScheduler() .runTaskLater( UltraCosmetics.getInstance(), new Runnable() { @Override public void run() { running = false; } }, 20); } }, 220); }
public GadgetAntiGravity(UUID owner) { super(owner, GadgetType.ANTIGRAVITY); UltraCosmetics.getInstance().registerListener(this); }