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


Java World.getChunkFromChunkCoords方法代码示例

本文整理汇总了Java中net.minecraft.world.World.getChunkFromChunkCoords方法的典型用法代码示例。如果您正苦于以下问题:Java World.getChunkFromChunkCoords方法的具体用法?Java World.getChunkFromChunkCoords怎么用?Java World.getChunkFromChunkCoords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


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

示例1: affectChunk

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void affectChunk(World world) {
	
	Chunk chunk = world.getChunkFromChunkCoords(chunkPos.x, chunkPos.z);
	
	for (int i = 0; i < chunk.getEntityLists().length; i++) {
		if (chunk.getEntityLists()[i] != null) {
			for (EntityAnimal e : chunk.getEntityLists()[i].getByClass(EntityAnimal.class)) {
				if (world.rand.nextInt(3) == 0) {
					e.addTag(TAG);
				}
			}
		}
	}

}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:17,代码来源:InfertilityEvent.java

示例2: isChunkAdjacentToTerritory

import net.minecraft.world.World; //导入方法依赖的package包/类
public static boolean isChunkAdjacentToTerritory(World world, UUID factionID, Chunk chunk) 
{
	if (factionID == null) { return false; }
	if (chunk == null) { return false; }
	
	_FactionSaveData faction = saveData.getFactionMap().get(factionID);
	
	if (faction == null) { return false; }	// No faction with that ID exists.
	
	// Once round
	Chunk tempChunk = world.getChunkFromChunkCoords(chunk.xPosition + 1, chunk.zPosition);
	if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; }	// Checks out.
	
	tempChunk = world.getChunkFromChunkCoords(chunk.xPosition - 1, chunk.zPosition);
	if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; }	// Checks out.
	
	tempChunk = world.getChunkFromChunkCoords(chunk.xPosition, chunk.zPosition + 1);
	if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; }	// Checks out.
	
	tempChunk = world.getChunkFromChunkCoords(chunk.xPosition, chunk.zPosition - 1);
	if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; }	// Checks out.
	
	return false;
}
 
开发者ID:Domochevsky,项目名称:minecraft-territorialdealings,代码行数:25,代码来源:TerritoryHandler.java

示例3: getChunkFromBlockCoords

import net.minecraft.world.World; //导入方法依赖的package包/类
public static Chunk getChunkFromBlockCoords(World world, int x, int z) {
    return world.getChunkFromChunkCoords(x >> 4, z >> 4);
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:4,代码来源:ZWrapper.java

示例4: getChunk

import net.minecraft.world.World; //导入方法依赖的package包/类
private static Chunk getChunk(World worldIn, Vec3d vec3)
{
    return worldIn.getChunkFromChunkCoords(MathHelper.floor(vec3.xCoord / 16.0D), MathHelper.floor(vec3.zCoord / 16.0D));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:TileEntityEndGateway.java

示例5: getChunk

import net.minecraft.world.World; //导入方法依赖的package包/类
private static Chunk getChunk(World worldIn, Vec3d vec3)
{
    return worldIn.getChunkFromChunkCoords(MathHelper.floor_double(vec3.xCoord / 16.0D), MathHelper.floor_double(vec3.zCoord / 16.0D));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:TileEntityEndGateway.java


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