本文整理了Java中net.minecraft.world.chunk.Chunk.getHeightValue()
方法的一些代码示例,展示了Chunk.getHeightValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Chunk.getHeightValue()
方法的具体详情如下:
包路径:net.minecraft.world.chunk.Chunk
类名称:Chunk
方法名:getHeightValue
暂无
代码示例来源:origin: MCTCP/TerrainControl
@Override
public int getHighestBlockYAt(int x, int z)
{
Chunk chunk = this.getChunk(x, 0, z);
if (chunk == null)
{
return -1;
}
return chunk.getHeightValue(x & 0xf, z & 0xf);
}
代码示例来源:origin: lawremi/CustomOreGen
private int findSurfaceHeight(Chunk chunk, int x, int z) {
int surfh = chunk.getHeightValue(x, z);
while (surfh > 0 && !isSurfaceBlock(chunk.getBlockState(x, surfh, z)))
{
surfh--;
}
return surfh;
}
代码示例来源:origin: jabelar/ExampleMod-1.12
/**
* Finds the topmost block position at an X, Z position in the world.
*
* @param parWorld
* the par world
* @param parX
* the par X
* @param parZ
* the par Z
* @return the height value
*/
public static double getHeightValue(World parWorld, double parX, double parZ)
{
int intX = MathHelper.floor(parX);
int intZ = MathHelper.floor(parZ);
int chunkX = intX >> 4;
int chunkZ = intZ >> 4;
double height = parWorld.getChunkFromChunkCoords(chunkX, chunkZ)
.getHeightValue(intX & 15, intZ & 15);
return height;
}
代码示例来源:origin: AntiqueAtlasTeam/AntiqueAtlas
int biomeID = chunkBiomes[x << 4 | z];
if (doScanPonds) {
int y = chunk.getHeightValue(x, z);
if (y > 0) {
Block topBlock = chunk.getBlockState(x, y-1, z).getBlock();
if(chunk.getHeightValue(x, z) < chunk.getWorld().provider.getAverageGroundLevel() - ravineMinDepth) {
ravineOccurences += priorityRavine;
代码示例来源:origin: AntiqueAtlasTeam/AntiqueAtlas
if (biomeID == endID) {
int top = chunk.getHeightValue(x, z);
Block topBlock = chunk.getBlockState(x, top-1, z).getBlock();
代码示例来源:origin: gegy1000/Terrarium
private void teleport(Entity entity, Coordinate coordinate) {
int blockX = MathHelper.floor(coordinate.getBlockX());
int blockZ = MathHelper.floor(coordinate.getBlockZ());
Chunk chunk = entity.world.getChunk(blockX >> 4, blockZ >> 4);
int height = chunk.getHeightValue(blockX & 15, blockZ & 15);
entity.dismountRidingEntity();
if (entity instanceof EntityPlayerMP) {
NetHandlerPlayServer connection = ((EntityPlayerMP) entity).connection;
connection.setPlayerLocation(coordinate.getBlockX(), height + 0.5, coordinate.getBlockZ(), 180.0F, 0.0F);
}
entity.motionY = 0.0;
entity.onGround = true;
entity.sendMessage(DeferredTranslator.translate(entity, new TextComponentTranslation("commands.earth.geotp.success", coordinate.getX(), coordinate.getZ())));
}
内容来源于网络,如有侵权,请联系作者删除!