com.sk89q.util.yaml.YAMLNode.getVector()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(64)

本文整理了Java中com.sk89q.util.yaml.YAMLNode.getVector()方法的一些代码示例,展示了YAMLNode.getVector()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLNode.getVector()方法的具体详情如下:
包路径:com.sk89q.util.yaml.YAMLNode
类名称:YAMLNode
方法名:getVector

YAMLNode.getVector介绍

[英]Gets a vector at a location. This will either return an Vector or a null. If the object at the particular location is not actually a string, it will be converted to its string representation.
[中]获取某个位置的向量。这将返回向量或空值。如果特定位置的对象实际上不是字符串,它将转换为其字符串表示形式。

代码示例

代码示例来源:origin: EngineHub/WorldEdit

/**
 * Gets a string at a location. This will either return an Vector
 * or the default value. If the object at the particular location is not
 * actually a string, it will be converted to its string representation.
 * 
 * @param path path to node (dot notation)
 * @param def default value
 * @return string or default
 */
public Vector3 getVector(String path, Vector3 def) {
  Vector3 v = getVector(path);
  if (v == null) {
    if (writeDefaults) setProperty(path, def);
    return def;
  }
  return v;
}

代码示例来源:origin: EngineHub/WorldGuard

continue;
} else if (type.equals("cuboid")) {
  Vector3 pt1 = checkNotNull(node.getVector("min"));
  Vector3 pt2 = checkNotNull(node.getVector("max"));
  BlockVector3 min = pt1.getMinimum(pt2).toBlockPoint();
  BlockVector3 max = pt1.getMaximum(pt2).toBlockPoint();

相关文章