ComponentTiamatCenter.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:AntiMatterMod 作者:
@Override
public boolean addComponentParts(World world, Random random, StructureBoundingBox boundingBox) {
    this.fillWithAir(world, boundingBox, 0, 0, 0, 15, 150, 15);
    world.setBlock(0, 0, 0, AntiMatterModRegistry.explosionTestBlock);

    int X = 0, Y = 2 << 4, Z = 0, R = 5 << 4;

    Y:for (int y = Y - R; y <= Y; y++) {
        for (int x = X - R; x <= X + R; x++) {
            for (int z = Z - R; z <= Z + R; z++) {
                if (y <= 0) break Y;
                double dis = ((X - x) * (X - x) + ((Z - z) * (Z - z)) + ((Y - y) * (Y - y)));

                if (dis < R * R && y > 0) {
                    world.setBlock(x, y, z, Blocks.air, 0, 2);
                }
            }
        }
    }
    return true;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号