本文整理汇总了Java中org.bukkit.Bukkit.getViewDistance方法的典型用法代码示例。如果您正苦于以下问题:Java Bukkit.getViewDistance方法的具体用法?Java Bukkit.getViewDistance怎么用?Java Bukkit.getViewDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.Bukkit
的用法示例。
在下文中一共展示了Bukkit.getViewDistance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getShouldUseChunks
import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static List<Coord<Integer, Integer>> getShouldUseChunks(Location loc) {
List<Coord<Integer, Integer>> chunks = Lists.newArrayList();
int vd = Bukkit.getViewDistance();
int hvd = vd / 2;
for (int i = loc.getChunk().getX() - hvd; i <= loc.getChunk().getX() + hvd; i++) {
for (int ii = loc.getChunk().getZ() - hvd; ii <= loc.getChunk().getZ() + hvd; ii++) {
chunks.add(AzureAPI.wrapCoord(i, ii));
}
}
return chunks;
}
示例2: viewDistance
import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static int viewDistance(final Player player) {
return isPaper() && player != null ? Bukkit.getViewDistance() : Bukkit.getViewDistance();
}
示例3: viewDistanceBlock
import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static int viewDistanceBlock(final Player player) {
if (player != null && customViewDistance(player)) return Bukkit.getViewDistance() * 16;
return bukkitVDBlock;
}
示例4: viewDistanceChunk
import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static int viewDistanceChunk(final Player player) {
if (player != null && customViewDistance(player)) return (Bukkit.getViewDistance() * 2) ^ 2 + 1;
return bukkitVDChunk;
}
示例5: customViewDistance
import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static boolean customViewDistance(final Player player) {
if (!isPaper()) return false;
return Bukkit.getViewDistance() != Bukkit.getViewDistance();
}
示例6: viewDistance
import org.bukkit.Bukkit; //导入方法依赖的package包/类
public static int viewDistance(final Player player) {
return /*isPaper() ? player.getViewDistance() :*/ Bukkit.getViewDistance();
}