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