コード例 #1
0
ファイル: BrewingStand.java プロジェクト: stewbasic/Vanilla
 @Override
 public boolean close(Player player) {
   BrewingStandCloseEvent event =
       player.getEngine().getEventManager().callEvent(new BrewingStandCloseEvent(this, player));
   if (!event.isCancelled()) {
     return super.close(player);
   }
   return false;
 }
コード例 #2
0
ファイル: BrewingStand.java プロジェクト: stewbasic/Vanilla
 @Override
 public boolean open(Player player) {
   BrewingStandOpenEvent event =
       player.getEngine().getEventManager().callEvent(new BrewingStandOpenEvent(this, player));
   if (!event.isCancelled()) {
     player
         .get(WindowHolder.class)
         .openWindow(new BrewingStandWindow(player, this, getInventory()));
     return true;
   }
   return false;
 }
コード例 #3
0
 private void executeBindings(Set<Binding> bindings, Player player, boolean pressed) {
   ChatArguments args = new ChatArguments(pressed ? "+" : "-");
   // Queue up sync bindings first
   for (Binding binding : bindings) {
     if (!binding.isAsync()) {
       player
           .getEngine()
           .getScheduler()
           .scheduleSyncDelayedTask(null, new BindingTask(player, binding.getCommand(), args));
     }
   }
   // Execute async bindings
   for (Binding binding : bindings) {
     if (binding.isAsync()) {
       player.processCommand(binding.getCommand(), args);
     }
   }
 }