Пример #1
0
 @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
 @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);
     }
   }
 }