コード例 #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);
 }
コード例 #2
0
 public GadgetAntiGravity(UUID owner) {
   super(owner, GadgetType.ANTIGRAVITY);
   UltraCosmetics.getInstance().registerListener(this);
 }