Java 类net.minecraft.server.ChunkCoordinates 实例源码

项目:CraftBukkit    文件:CraftEventFactory.java   
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;
}
项目:Almura-Server    文件:CraftEventFactory.java   
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;
}
项目:Tweakkit-Server    文件:CraftEventFactory.java   
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;
}
项目:Craft-city    文件:CraftEventFactory.java   
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;
}
项目:CraftBukkit    文件:CraftTravelAgent.java   
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;
}
项目:Almura-Server    文件:CraftTravelAgent.java   
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;
}
项目:Almura-Server    文件:ServerCommandListener.java   
public ChunkCoordinates b() {
    return new ChunkCoordinates(0, 0, 0);
}
项目:Tweakkit-Server    文件:CraftTravelAgent.java   
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;
}
项目:Craft-city    文件:CraftTravelAgent.java   
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;
}
项目:Craft-city    文件:ServerCommandListener.java   
public ChunkCoordinates b() {
    return new ChunkCoordinates(0, 0, 0);
}