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


Java SimpleChunkLocation类代码示例

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


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

示例1: isKingdomAt

import org.kingdoms.constants.land.SimpleChunkLocation; //导入依赖的package包/类
public Boolean isKingdomAt(Chunk chunk) {
	SimpleChunkLocation schunk = new SimpleChunkLocation(chunk);
	
	Land land = GameManagement.getLandManager().getOrLoadLand(schunk);
	
	if (land == null || land.getOwner() == null) {
		return false;
	}
	
	return true;
}
 
开发者ID:redstone,项目名称:FreshWilderness,代码行数:12,代码来源:KingdomsEngine.java

示例2: kingdomClaimNearby

import org.kingdoms.constants.land.SimpleChunkLocation; //导入依赖的package包/类
/**
 * Is there a Kingdom claim nearby?
 * @param l
 * @return True if kindom nearby, False if not.
 */
public boolean kingdomClaimNearby(Location l) {
    if (Bukkit.getServer().getPluginManager().getPlugin("Kingdoms") == null) {
        return false;
    }
    if(!RandomCoords.getPlugin().getConfig().getString("Kingdoms").equalsIgnoreCase("true")) {
        return false;
    }


    int radius = RandomCoords.getPlugin().getConfig().getInt("CheckingRadius");
    int chunkRadius = radius < 16 ? 1 : (radius - (radius % 16)) / 16;
    int x;
    int y;
    int z;
    String kingdoms;


    for (int chX = 0 - chunkRadius; chX <= chunkRadius; chX++) {
        for (int chZ = 0 - chunkRadius; chZ <= chunkRadius; chZ++) {
            x = l.getBlockX();
            y = l.getBlockY();
            z = l.getBlockZ();
            Chunk chunk = l.getWorld().getBlockAt(x + (chX * 16), y, z + (chZ * 16)).getChunk();
            kingdoms = GameManagement.getLandManager().getOrLoadLand(new SimpleChunkLocation(chunk)).getOwner();
            if (kingdoms != null) {
                return true;
            }

        }
    }

    return false;
}
 
开发者ID:jolbol1,项目名称:RandomCoordinatesV2,代码行数:39,代码来源:KingdomsClaim.java

示例3: kingdomClaimCheck

import org.kingdoms.constants.land.SimpleChunkLocation; //导入依赖的package包/类
public boolean kingdomClaimCheck(Location loc) {
    Chunk chunk = loc.getChunk();

    if (wild.getConfig().getBoolean("Kingdoms")) {
        Kingdoms.getManagers();
        if (GameManagement.getLandManager().getOrLoadLand(
                new SimpleChunkLocation(chunk)) != null && !checkSurroundingKingdoms(loc))
            return true;
        else
            return false;

    }
    return false;
}
 
开发者ID:Qballl,项目名称:WildernessTp,代码行数:15,代码来源:ClaimChecks.java

示例4: checkSurroundingKingdoms

import org.kingdoms.constants.land.SimpleChunkLocation; //导入依赖的package包/类
private boolean checkSurroundingKingdoms(Location loc) {
    int distance = range / 2;
    Vector top = new Vector(loc.getX() + distance, loc.getY(), loc.getZ() + distance);
    Vector bottom = new Vector(loc.getX() - distance, loc.getY(), loc.getZ() - distance);
    for (int z = bottom.getBlockZ(); z <= top.getBlockZ(); z++) {
        for (int x = bottom.getBlockX(); x <= top.getBlockX(); x++) {
            if (GameManagement.getLandManager().getOrLoadLand(new SimpleChunkLocation(new Location(loc.getWorld(), loc.getX() + x, loc.getY(), loc.getZ() + z).getChunk())) != null)
                return true;
        }
    }
    return false;

}
 
开发者ID:Qballl,项目名称:WildernessTp,代码行数:14,代码来源:ClaimChecks.java

示例5: KingdomsClaim

import org.kingdoms.constants.land.SimpleChunkLocation; //导入依赖的package包/类
/**
 * Checks if the player is near a Towny town, or within the checking radius.
 * @param l The location to check.
 * @return True or False, Is the location in a Town?
 */
public boolean KingdomsClaim(final Location l) {
    if (!(Bukkit.getServer().getPluginManager().getPlugin("Kingdoms") == null)) {
        if (RandomCoords.getPlugin().config.getString("Kingdoms").equals("true")) {
            final int X = l.getBlockX();
            final int Y = l.getBlockY();
            final int Z = l.getBlockZ();

            final int r = RandomCoords.getPlugin().config.getInt("CheckingRadius");

            int x = X - r;
            int y = Y - r;
            int z = Z - r;

            final int bx = x;
            final int bz = z;

            String kingdoms;


         //   for (int i = 0; i < r * 2 + 1; i++) {
                for (int j = 0; j < r * 2 + 1; j++) {
                    for (int k = 0; k < r * 2 + 1; k++) {
                        Chunk chunk = l.getChunk();
                        kingdoms = GameManagement.getLandManager().getOrLoadLand(new SimpleChunkLocation(chunk)).getOwner();


                        if (kingdoms != null) {
                            return false;
                        }


                        //x++;
                        x = x + 16;
                    }
                    z = z + 16;
                    //z++;
                    x = bx;
                }
        /*        z = bz;
                x = bx;
                y++;
            }*/
        }

        return true;
    } else {

        return true;

    }
}
 
开发者ID:jolbol1,项目名称:RandomCoordinatesV2,代码行数:57,代码来源:KingdomsClaim.java


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