gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-17 01:51:31 27 4
gpt4 key购买 nike

本文整理了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();

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com