Пример #1
0
 @Command(
     identifier = "heal",
     permissions = {Perms.COMMAND_HEAL})
 public void onHealCommand(Player player, @Arg(name = "target", def = "?sender") Player target) {
   Players.heal(target);
   Chat.message(target, Messages.PLAYER_HEALED);
   // If the player using the command healed themself.
   if (!target.getUniqueId().equals(player.getUniqueId())) {
     if (!player.hasPermission(Perms.COMMAND_HEAL_OTHER)) {
       Chat.message(player, Messages.permissionRequired(Perms.COMMAND_HEAL_OTHER));
       return;
     }
     Chat.message(player, Messages.playerHealed(target.getName()));
   }
 }
  public static void loadItem(File file) {
    String itemName = FilenameUtils.removeExtension(file.getName());

    XmlItemStack item = null;
    try {
      item = serializer.read(XmlItemStack.class, file);
    } catch (Exception e) {
      e.printStackTrace();
    }

    if (item == null) {
      return;
    }

    items.put(itemName, item.getItemStack());
    Chat.debug(
        String.format(
            "Loaded item %s",
            StringUtil.joinString(Messages.itemInfo(item.getItemStack()), "\n", 0)));
  }