Ejemplo n.º 1
0
 @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);
 }
Ejemplo n.º 2
0
 @Override
 public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
   Entity ent = getExpr().getSingle(e); // Called to get the Target which is Player in this case.
   if (ent == null) return;
   if (ent.getType() != EntityType.ARMOR_STAND) {
     return;
   }
   Boolean b = (Boolean) (delta[0]);
   if (mode == Changer.ChangeMode.SET) {
     ((ArmorStand) ent).setSmall(b);
   }
 }