Exemple #1
0
  private void printTreeType(vMessage vm) {
    String _printout = "";

    boolean _delimiterHelper = true;
    for (TreeType _treeType : TreeType.values()) {
      if (_delimiterHelper) {
        _delimiterHelper = false;
      } else {
        _printout += ", ";
      }
      _printout +=
          ((_treeType.equals(this.treeType))
                  ? ChatColor.GRAY + _treeType.name().toLowerCase()
                  : ChatColor.DARK_GRAY + _treeType.name().toLowerCase())
              + ChatColor.WHITE;
    }

    vm.custom(_printout);
  }
Exemple #2
0
 @Override
 public void getParameterOptions(Spell spell, String parameterKey, Collection<String> examples) {
     if (parameterKey.equals("type")) {
         for (TreeType type : TreeType.values()) {
             examples.add(type.name().toLowerCase());
         }
     } else if (parameterKey.equals("requires_sapling")) {
         examples.addAll(Arrays.asList((BaseSpell.EXAMPLE_BOOLEANS)));
     } else {
         super.getParameterOptions(spell, parameterKey, examples);
     }
 }
Exemple #3
0
	public static TreeType parseTreeString(String s, TreeType defaultTreeType)
	{
		if (s.equalsIgnoreCase("big")) return TreeType.BIG_TREE;
		if (s.equalsIgnoreCase("tall")) return TreeType.TALL_REDWOOD;

		TreeType tree = defaultTreeType;
		for (TreeType t : TreeType.values())
		{
			if (t.name().equalsIgnoreCase(s))
			{
				tree = t;
			}
		}
		return tree;
	}
Exemple #4
0
	public String getTreeName(TreeType treeType)
	{
		if (treeType == null || treeType.name() == null) return "Tree";
		return treeType.name().toLowerCase();
	}