コード例 #1
0
  @Override
  public void updateDescription() {
    List<String> description = null;
    if (getDescription() != null) {
      description = getDescription();
      String desc = ChatColor.stripColor(getDescription().get(0));

      if (desc.matches("([0-9]+[dhms]:?)+"))
        description.set(
            0, ChatColor.GREEN.toString() + MinigameUtils.convertTime(getValue().getValue(), true));
      else
        description.add(
            0, ChatColor.GREEN.toString() + MinigameUtils.convertTime(getValue().getValue(), true));
    } else {
      description = new ArrayList<String>();
      description.add(
          ChatColor.GREEN.toString() + MinigameUtils.convertTime(getValue().getValue(), true));
    }

    setDescription(description);
  }
コード例 #2
0
  @Override
  public ItemStack onDoubleClick() {
    MinigamePlayer ply = getContainer().getViewer();
    ply.setNoClose(true);
    ply.getPlayer().closeInventory();
    ply.sendMessage(
        "Enter the name of the option into chat for "
            + getName()
            + ", the menu will automatically reopen in 10s if nothing is entered.",
        null);
    ply.setManualEntry(this);
    ply.sendMessage("Possible Options: " + MinigameUtils.listToString(options));

    getContainer().startReopenTimer(10);
    return null;
  }