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


Java WorldGenEndIsland类代码示例

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


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

示例1: findExitPortal

import net.minecraft.world.gen.feature.WorldGenEndIsland; //导入依赖的package包/类
private void findExitPortal()
{
    Vec3d vec3d = (new Vec3d((double)this.getPos().getX(), 0.0D, (double)this.getPos().getZ())).normalize();
    Vec3d vec3d1 = vec3d.scale(1024.0D);

    for (int i = 16; getChunk(this.world, vec3d1).getTopFilledSegment() > 0 && i-- > 0; vec3d1 = vec3d1.add(vec3d.scale(-16.0D)))
    {
        LOG.debug("Skipping backwards past nonempty chunk at {}", new Object[] {vec3d1});
    }

    for (int j = 16; getChunk(this.world, vec3d1).getTopFilledSegment() == 0 && j-- > 0; vec3d1 = vec3d1.add(vec3d.scale(16.0D)))
    {
        LOG.debug("Skipping forward past empty chunk at {}", new Object[] {vec3d1});
    }

    LOG.debug("Found chunk at {}", new Object[] {vec3d1});
    Chunk chunk = getChunk(this.world, vec3d1);
    this.exitPortal = findSpawnpointInChunk(chunk);

    if (this.exitPortal == null)
    {
        this.exitPortal = new BlockPos(vec3d1.xCoord + 0.5D, 75.0D, vec3d1.zCoord + 0.5D);
        LOG.debug("Failed to find suitable block, settling on {}", new Object[] {this.exitPortal});
        (new WorldGenEndIsland()).generate(this.world, new Random(this.exitPortal.toLong()), this.exitPortal);
    }
    else
    {
        LOG.debug("Found block at {}", new Object[] {this.exitPortal});
    }

    this.exitPortal = findHighestBlock(this.world, this.exitPortal, 16, true);
    LOG.debug("Creating portal at {}", new Object[] {this.exitPortal});
    this.exitPortal = this.exitPortal.up(10);
    this.createExitPortal(this.exitPortal);
    this.markDirty();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:TileEntityEndGateway.java

示例2: findExitPortal

import net.minecraft.world.gen.feature.WorldGenEndIsland; //导入依赖的package包/类
private void findExitPortal()
{
    Vec3d vec3d = (new Vec3d((double)this.getPos().getX(), 0.0D, (double)this.getPos().getZ())).normalize();
    Vec3d vec3d1 = vec3d.scale(1024.0D);

    for (int i = 16; getChunk(this.worldObj, vec3d1).getTopFilledSegment() > 0 && i-- > 0; vec3d1 = vec3d1.add(vec3d.scale(-16.0D)))
    {
        LOG.debug("Skipping backwards past nonempty chunk at {}", new Object[] {vec3d1});
    }

    for (int j = 16; getChunk(this.worldObj, vec3d1).getTopFilledSegment() == 0 && j-- > 0; vec3d1 = vec3d1.add(vec3d.scale(16.0D)))
    {
        LOG.debug("Skipping forward past empty chunk at {}", new Object[] {vec3d1});
    }

    LOG.debug("Found chunk at {}", new Object[] {vec3d1});
    Chunk chunk = getChunk(this.worldObj, vec3d1);
    this.exitPortal = findSpawnpointInChunk(chunk);

    if (this.exitPortal == null)
    {
        this.exitPortal = new BlockPos(vec3d1.xCoord + 0.5D, 75.0D, vec3d1.zCoord + 0.5D);
        LOG.debug("Failed to find suitable block, settling on {}", new Object[] {this.exitPortal});
        (new WorldGenEndIsland()).generate(this.worldObj, new Random(this.exitPortal.toLong()), this.exitPortal);
    }
    else
    {
        LOG.debug("Found block at {}", new Object[] {this.exitPortal});
    }

    this.exitPortal = findHighestBlock(this.worldObj, this.exitPortal, 16, true);
    LOG.debug("Creating portal at {}", new Object[] {this.exitPortal});
    this.exitPortal = this.exitPortal.up(10);
    this.createExitPortal(this.exitPortal);
    this.markDirty();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:37,代码来源:TileEntityEndGateway.java


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