当前位置: 首页>>代码示例>>Java>>正文


Java ChunkCoordinates类代码示例

本文整理汇总了Java中net.minecraft.server.ChunkCoordinates的典型用法代码示例。如果您正苦于以下问题:Java ChunkCoordinates类的具体用法?Java ChunkCoordinates怎么用?Java ChunkCoordinates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ChunkCoordinates类属于net.minecraft.server包,在下文中一共展示了ChunkCoordinates类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canBuild

import net.minecraft.server.ChunkCoordinates; //导入依赖的package包/类
private static boolean canBuild(CraftWorld world, Player player, int x, int z) {
    WorldServer worldServer = world.getHandle();
    int spawnSize = Bukkit.getServer().getSpawnRadius();

    if (world.getHandle().dimension != 0) return true;
    if (spawnSize <= 0) return true;
    if (((CraftServer) Bukkit.getServer()).getHandle().getOPs().isEmpty()) return true;
    if (player.isOp()) return true;

    ChunkCoordinates chunkcoordinates = worldServer.getSpawn();

    int distanceFromSpawn = Math.max(Math.abs(x - chunkcoordinates.x), Math.abs(z - chunkcoordinates.z));
    return distanceFromSpawn > spawnSize;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:15,代码来源:CraftEventFactory.java

示例2: canBuild

import net.minecraft.server.ChunkCoordinates; //导入依赖的package包/类
private static boolean canBuild(CraftWorld world, Player player, int x, int z) {
    WorldServer worldServer = world.getHandle();
    int spawnSize = Bukkit.getServer().getSpawnRadius();

    if (world.getHandle().dimension != 0) return true;
    if (spawnSize <= 0) return true;
    if (((CraftServer) Bukkit.getServer()).getHandle().getOPs().isEmpty()) return true;
    if (player.isOp()) return true;

    ChunkCoordinates chunkcoordinates = worldServer.getSpawn();

    int distanceFromSpawn = Math.max(Math.abs(x - chunkcoordinates.x), Math.abs(z - chunkcoordinates.z));
    return distanceFromSpawn >= spawnSize;
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:15,代码来源:CraftEventFactory.java

示例3: findPortal

import net.minecraft.server.ChunkCoordinates; //导入依赖的package包/类
public Location findPortal(Location location) {
    PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().getTravelAgent();
    ChunkCoordinates found = pta.findPortal(location.getX(), location.getY(), location.getZ(), this.getSearchRadius());
    return found != null ? new Location(location.getWorld(), found.x, found.y, found.z, location.getYaw(), location.getPitch()) : null;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftTravelAgent.java

示例4: findPortal

import net.minecraft.server.ChunkCoordinates; //导入依赖的package包/类
public Location findPortal(Location location) {
    PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().t(); // Should be getTravelAgent
    ChunkCoordinates found = pta.findPortal(location.getX(), location.getY(), location.getZ(), this.getSearchRadius());
    return found != null ? new Location(location.getWorld(), found.x, found.y, found.z, location.getYaw(), location.getPitch()) : null;
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:6,代码来源:CraftTravelAgent.java

示例5: b

import net.minecraft.server.ChunkCoordinates; //导入依赖的package包/类
public ChunkCoordinates b() {
    return new ChunkCoordinates(0, 0, 0);
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:4,代码来源:ServerCommandListener.java

示例6: findPortal

import net.minecraft.server.ChunkCoordinates; //导入依赖的package包/类
public Location findPortal(Location location) {
    PortalTravelAgent pta = ((CraftWorld) location.getWorld()).getHandle().s();
    ChunkCoordinates found = pta.findPortal(location.getX(), location.getY(), location.getZ(), this.getSearchRadius());
    return found != null ? new Location(location.getWorld(), found.x, found.y, found.z, location.getYaw(), location.getPitch()) : null;
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:6,代码来源:CraftTravelAgent.java


注:本文中的net.minecraft.server.ChunkCoordinates类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。