Ejemplo n.º 1
0
 @Override
 public void unbind(String cmd) {
   for (Binding binding : bindings) {
     if (binding.getCommand().equalsIgnoreCase(cmd)) {
       bindings.remove(binding);
       return;
     }
   }
 }
Ejemplo n.º 2
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);
     }
   }
 }