本文整理汇总了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);
}
}
}
示例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;
}
}
示例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;
}
}