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


Java EntityEnderCrystal.setBeamTarget方法代码示例

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


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

示例1: resetSpikeCrystals

import net.minecraft.entity.item.EntityEnderCrystal; //导入方法依赖的package包/类
public void resetSpikeCrystals()
{
    for (WorldGenSpikes.EndSpike worldgenspikes$endspike : BiomeEndDecorator.getSpikesForWorld(this.world))
    {
        for (EntityEnderCrystal entityendercrystal : this.world.getEntitiesWithinAABB(EntityEnderCrystal.class, worldgenspikes$endspike.getTopBoundingBox()))
        {
            entityendercrystal.setEntityInvulnerable(false);
            entityendercrystal.setBeamTarget((BlockPos)null);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:DragonFightManager.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(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

示例3: 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


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