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


Java EntityEnderCrystal.setLocationAndAngles方法代码示例

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


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

示例1: generate

import net.minecraft.entity.item.EntityEnderCrystal; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (this.spike == null)
    {
        throw new IllegalStateException("Decoration requires priming with a spike");
    }
    else
    {
        int i = this.spike.getRadius();

        for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(new BlockPos(position.getX() - i, 0, position.getZ() - i), new BlockPos(position.getX() + i, this.spike.getHeight() + 10, position.getZ() + i)))
        {
            if (blockpos$mutableblockpos.distanceSq((double)position.getX(), (double)blockpos$mutableblockpos.getY(), (double)position.getZ()) <= (double)(i * i + 1) && blockpos$mutableblockpos.getY() < this.spike.getHeight())
            {
                this.setBlockAndNotifyAdequately(worldIn, blockpos$mutableblockpos, Blocks.OBSIDIAN.getDefaultState());
            }
            else if (blockpos$mutableblockpos.getY() > 65)
            {
                this.setBlockAndNotifyAdequately(worldIn, blockpos$mutableblockpos, Blocks.AIR.getDefaultState());
            }
        }

        if (this.spike.isGuarded())
        {
            for (int j = -2; j <= 2; ++j)
            {
                for (int k = -2; k <= 2; ++k)
                {
                    if (MathHelper.abs(j) == 2 || MathHelper.abs(k) == 2)
                    {
                        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight(), position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight() + 1, position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight() + 2, position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                    }

                    this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight() + 3, position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                }
            }
        }

        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(worldIn);
        entityendercrystal.setBeamTarget(this.beamTarget);
        entityendercrystal.setEntityInvulnerable(this.crystalInvulnerable);
        entityendercrystal.setLocationAndAngles((double)((float)position.getX() + 0.5F), (double)(this.spike.getHeight() + 1), (double)((float)position.getZ() + 0.5F), rand.nextFloat() * 360.0F, 0.0F);
        worldIn.spawnEntityInWorld(entityendercrystal);
        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX(), this.spike.getHeight(), position.getZ()), Blocks.BEDROCK.getDefaultState());
        return true;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:50,代码来源:WorldGenSpikes.java

示例2: generate

import net.minecraft.entity.item.EntityEnderCrystal; //导入方法依赖的package包/类
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (this.spike == null)
    {
        throw new IllegalStateException("Decoration requires priming with a spike");
    }
    else
    {
        int i = this.spike.getRadius();

        for (BlockPos.MutableBlockPos blockpos$mutableblockpos : BlockPos.getAllInBoxMutable(new BlockPos(position.getX() - i, 0, position.getZ() - i), new BlockPos(position.getX() + i, this.spike.getHeight() + 10, position.getZ() + i)))
        {
            if (blockpos$mutableblockpos.distanceSq((double)position.getX(), (double)blockpos$mutableblockpos.getY(), (double)position.getZ()) <= (double)(i * i + 1) && blockpos$mutableblockpos.getY() < this.spike.getHeight())
            {
                this.setBlockAndNotifyAdequately(worldIn, blockpos$mutableblockpos, Blocks.OBSIDIAN.getDefaultState());
            }
            else if (blockpos$mutableblockpos.getY() > 65)
            {
                this.setBlockAndNotifyAdequately(worldIn, blockpos$mutableblockpos, Blocks.AIR.getDefaultState());
            }
        }

        if (this.spike.isGuarded())
        {
            for (int j = -2; j <= 2; ++j)
            {
                for (int k = -2; k <= 2; ++k)
                {
                    if (MathHelper.abs_int(j) == 2 || MathHelper.abs_int(k) == 2)
                    {
                        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight(), position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight() + 1, position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight() + 2, position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                    }

                    this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX() + j, this.spike.getHeight() + 3, position.getZ() + k), Blocks.IRON_BARS.getDefaultState());
                }
            }
        }

        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(worldIn);
        entityendercrystal.setBeamTarget(this.beamTarget);
        entityendercrystal.setEntityInvulnerable(this.crystalInvulnerable);
        entityendercrystal.setLocationAndAngles((double)((float)position.getX() + 0.5F), (double)(this.spike.getHeight() + 1), (double)((float)position.getZ() + 0.5F), rand.nextFloat() * 360.0F, 0.0F);
        worldIn.spawnEntityInWorld(entityendercrystal);
        this.setBlockAndNotifyAdequately(worldIn, new BlockPos(position.getX(), this.spike.getHeight(), position.getZ()), Blocks.BEDROCK.getDefaultState());
        return true;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:50,代码来源:WorldGenSpikes.java

示例3: generate

import net.minecraft.entity.item.EntityEnderCrystal; //导入方法依赖的package包/类
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
    if (par1World.isAirBlock(par3, par4, par5) && par1World.getBlock(par3, par4 - 1, par5) == this.field_150520_a)
    {
        int var6 = par2Random.nextInt(32) + 6;
        int var7 = par2Random.nextInt(4) + 1;
        int var8;
        int var9;
        int var10;
        int var11;

        for (var8 = par3 - var7; var8 <= par3 + var7; ++var8)
        {
            for (var9 = par5 - var7; var9 <= par5 + var7; ++var9)
            {
                var10 = var8 - par3;
                var11 = var9 - par5;

                if (var10 * var10 + var11 * var11 <= var7 * var7 + 1 && par1World.getBlock(var8, par4 - 1, var9) != this.field_150520_a)
                {
                    return false;
                }
            }
        }

        for (var8 = par4; var8 < par4 + var6 && var8 < 256; ++var8)
        {
            for (var9 = par3 - var7; var9 <= par3 + var7; ++var9)
            {
                for (var10 = par5 - var7; var10 <= par5 + var7; ++var10)
                {
                    var11 = var9 - par3;
                    int var12 = var10 - par5;

                    if (var11 * var11 + var12 * var12 <= var7 * var7 + 1)
                    {
                        par1World.setBlock(var9, var8, var10, Blocks.obsidian, 0, 2);
                    }
                }
            }
        }

        EntityEnderCrystal var13 = new EntityEnderCrystal(par1World);
        var13.setLocationAndAngles((double)((float)par3 + 0.5F), (double)(par4 + var6), (double)((float)par5 + 0.5F), par2Random.nextFloat() * 360.0F, 0.0F);
        par1World.spawnEntityInWorld(var13);
        par1World.setBlock(par3, par4 + var6, par5, Blocks.bedrock, 0, 2);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:54,代码来源:WorldGenSpikes.java

示例4: generate

import net.minecraft.entity.item.EntityEnderCrystal; //导入方法依赖的package包/类
public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_)
{
    if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) == this.field_150520_a)
    {
        int l = p_76484_2_.nextInt(32) + 6;
        int i1 = p_76484_2_.nextInt(4) + 1;
        int j1;
        int k1;
        int l1;
        int i2;

        for (j1 = p_76484_3_ - i1; j1 <= p_76484_3_ + i1; ++j1)
        {
            for (k1 = p_76484_5_ - i1; k1 <= p_76484_5_ + i1; ++k1)
            {
                l1 = j1 - p_76484_3_;
                i2 = k1 - p_76484_5_;

                if (l1 * l1 + i2 * i2 <= i1 * i1 + 1 && p_76484_1_.getBlock(j1, p_76484_4_ - 1, k1) != this.field_150520_a)
                {
                    return false;
                }
            }
        }

        for (j1 = p_76484_4_; j1 < p_76484_4_ + l && j1 < 256; ++j1)
        {
            for (k1 = p_76484_3_ - i1; k1 <= p_76484_3_ + i1; ++k1)
            {
                for (l1 = p_76484_5_ - i1; l1 <= p_76484_5_ + i1; ++l1)
                {
                    i2 = k1 - p_76484_3_;
                    int j2 = l1 - p_76484_5_;

                    if (i2 * i2 + j2 * j2 <= i1 * i1 + 1)
                    {
                        p_76484_1_.setBlock(k1, j1, l1, TDEBlocks.dead_grass, 0, 2);
                    }
                }
            }
        }

        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(p_76484_1_);
        entityendercrystal.setLocationAndAngles((double)((float)p_76484_3_ + 0.5F), (double)(p_76484_4_ + l), (double)((float)p_76484_5_ + 0.5F), p_76484_2_.nextFloat() * 360.0F, 0.0F);
        p_76484_1_.spawnEntityInWorld(entityendercrystal);
        p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + l, p_76484_5_, TDEBlocks.dead_grass, 0, 2);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:54,代码来源:WorldGenDarkStoneSpikes.java

示例5: generate

import net.minecraft.entity.item.EntityEnderCrystal; //导入方法依赖的package包/类
public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_)
{
    if (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_1_.getBlock(p_76484_3_, p_76484_4_ - 1, p_76484_5_) == this.field_150520_a)
    {
        int l = p_76484_2_.nextInt(32) + 6;
        int i1 = p_76484_2_.nextInt(4) + 1;
        int j1;
        int k1;
        int l1;
        int i2;

        for (j1 = p_76484_3_ - i1; j1 <= p_76484_3_ + i1; ++j1)
        {
            for (k1 = p_76484_5_ - i1; k1 <= p_76484_5_ + i1; ++k1)
            {
                l1 = j1 - p_76484_3_;
                i2 = k1 - p_76484_5_;

                if (l1 * l1 + i2 * i2 <= i1 * i1 + 1 && p_76484_1_.getBlock(j1, p_76484_4_ - 1, k1) != this.field_150520_a)
                {
                    return false;
                }
            }
        }

        for (j1 = p_76484_4_; j1 < p_76484_4_ + l && j1 < 256; ++j1)
        {
            for (k1 = p_76484_3_ - i1; k1 <= p_76484_3_ + i1; ++k1)
            {
                for (l1 = p_76484_5_ - i1; l1 <= p_76484_5_ + i1; ++l1)
                {
                    i2 = k1 - p_76484_3_;
                    int j2 = l1 - p_76484_5_;

                    if (i2 * i2 + j2 * j2 <= i1 * i1 + 1)
                    {
                        p_76484_1_.setBlock(k1, j1, l1, Blocks.obsidian, 0, 2);
                    }
                }
            }
        }

        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(p_76484_1_);
        entityendercrystal.setLocationAndAngles((double)((float)p_76484_3_ + 0.5F), (double)(p_76484_4_ + l), (double)((float)p_76484_5_ + 0.5F), p_76484_2_.nextFloat() * 360.0F, 0.0F);
        p_76484_1_.spawnEntityInWorld(entityendercrystal);
        p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + l, p_76484_5_, Blocks.bedrock, 0, 2);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:54,代码来源:WorldGenSpikes.java

示例6: generate

import net.minecraft.entity.item.EntityEnderCrystal; //导入方法依赖的package包/类
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
    if (par1World.isAirBlock(par3, par4, par5) && par1World.getBlockId(par3, par4 - 1, par5) == this.replaceID)
    {
        int l = par2Random.nextInt(32) + 6;
        int i1 = par2Random.nextInt(4) + 1;
        int j1;
        int k1;
        int l1;
        int i2;

        for (j1 = par3 - i1; j1 <= par3 + i1; ++j1)
        {
            for (k1 = par5 - i1; k1 <= par5 + i1; ++k1)
            {
                l1 = j1 - par3;
                i2 = k1 - par5;

                if (l1 * l1 + i2 * i2 <= i1 * i1 + 1 && par1World.getBlockId(j1, par4 - 1, k1) != this.replaceID)
                {
                    return false;
                }
            }
        }

        for (j1 = par4; j1 < par4 + l && j1 < 128; ++j1)
        {
            for (k1 = par3 - i1; k1 <= par3 + i1; ++k1)
            {
                for (l1 = par5 - i1; l1 <= par5 + i1; ++l1)
                {
                    i2 = k1 - par3;
                    int j2 = l1 - par5;

                    if (i2 * i2 + j2 * j2 <= i1 * i1 + 1)
                    {
                        par1World.setBlock(k1, j1, l1, Block.obsidian.blockID, 0, 2);
                    }
                }
            }
        }

        EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(par1World);
        entityendercrystal.setLocationAndAngles((double)((float)par3 + 0.5F), (double)(par4 + l), (double)((float)par5 + 0.5F), par2Random.nextFloat() * 360.0F, 0.0F);
        par1World.spawnEntityInWorld(entityendercrystal);
        par1World.setBlock(par3, par4 + l, par5, Block.bedrock.blockID, 0, 2);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:54,代码来源:WorldGenSpikes.java


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