本文整理汇总了Java中net.minecraft.block.BlockSilverfish类的典型用法代码示例。如果您正苦于以下问题:Java BlockSilverfish类的具体用法?Java BlockSilverfish怎么用?Java BlockSilverfish使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockSilverfish类属于net.minecraft.block包,在下文中一共展示了BlockSilverfish类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startExecuting
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public void startExecuting()
{
if (!this.field_179484_c)
{
super.startExecuting();
}
else
{
World world = this.field_179485_a.worldObj;
BlockPos blockpos = (new BlockPos(this.field_179485_a.posX, this.field_179485_a.posY + 0.5D, this.field_179485_a.posZ)).offset(this.facing);
IBlockState iblockstate = world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
world.setBlockState(blockpos, Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3);
this.field_179485_a.spawnExplosionParticle();
this.field_179485_a.setDead();
}
}
}
示例2: startExecuting
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public void startExecuting()
{
if (!this.doMerge)
{
super.startExecuting();
}
else
{
World world = this.entity.world;
BlockPos blockpos = (new BlockPos(this.entity.posX, this.entity.posY + 0.5D, this.entity.posZ)).offset(this.facing);
IBlockState iblockstate = world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
world.setBlockState(blockpos, Blocks.MONSTER_EGG.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3);
this.entity.spawnExplosionParticle();
this.entity.setDead();
}
}
}
示例3: startExecuting
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
if (!this.doMerge)
{
super.startExecuting();
}
else
{
World world = this.silverfish.worldObj;
BlockPos blockpos = (new BlockPos(this.silverfish.posX, this.silverfish.posY + 0.5D, this.silverfish.posZ)).offset(this.facing);
IBlockState iblockstate = world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
world.setBlockState(blockpos, Blocks.MONSTER_EGG.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.forModelBlock(iblockstate)), 3);
this.silverfish.spawnExplosionParticle();
this.silverfish.setDead();
}
}
}
示例4: BiomeGenNileMountains
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public BiomeGenNileMountains(int p_i45373_1_, boolean p_i45373_2_)
{
super(p_i45373_1_);
this.theWorldGenerator = new WorldGenMinable(Blocks.monster_egg.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE), 9);
this.field_150634_aD = new WorldGenTaiga2(false);
this.field_150635_aE = 0;
this.field_150636_aF = 1;
this.field_150637_aG = 2;
this.field_150638_aH = this.field_150635_aE;
if (p_i45373_2_)
{
this.theBiomeDecorator.treesPerChunk = 3;
this.field_150638_aH = this.field_150636_aF;
}
}
示例5: onHackFinished
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
@Override
public void onHackFinished(World world, BlockPos pos, EntityPlayer player) {
IBlockState state = world.getBlockState(pos);
IBlockState newState;
switch (state.getValue(BlockSilverfish.VARIANT)) {
case COBBLESTONE:
newState = Blocks.COBBLESTONE.getDefaultState();
break;
case STONEBRICK:
newState = Blocks.STONEBRICK.getDefaultState();
break;
case MOSSY_STONEBRICK:
newState = Blocks.STONEBRICK.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.MOSSY);
break;
case CRACKED_STONEBRICK:
newState = Blocks.STONEBRICK.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.CRACKED);
break;
case CHISELED_STONEBRICK:
newState = Blocks.STONEBRICK.getDefaultState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.CHISELED);
break;
default:
newState = Blocks.STONE.getDefaultState();
break;
}
world.setBlockState(pos, newState);
}
示例6: selectBlocks
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_)
{
if (p_75062_5_)
{
float f = rand.nextFloat();
if (f < 0.2F)
{
this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.CRACKED_META);
}
else if (f < 0.5F)
{
this.blockstate = Blocks.stonebrick.getStateFromMeta(BlockStoneBrick.MOSSY_META);
}
else if (f < 0.55F)
{
this.blockstate = Blocks.monster_egg.getStateFromMeta(BlockSilverfish.EnumType.STONEBRICK.getMetadata());
}
else
{
this.blockstate = Blocks.stonebrick.getDefaultState();
}
}
else
{
this.blockstate = Blocks.air.getDefaultState();
}
}
示例7: shouldExecute
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public boolean shouldExecute()
{
if (this.field_179485_a.getAttackTarget() != null)
{
return false;
}
else if (!this.field_179485_a.getNavigator().noPath())
{
return false;
}
else
{
Random random = this.field_179485_a.getRNG();
if (random.nextInt(10) == 0)
{
this.facing = EnumFacing.random(random);
BlockPos blockpos = (new BlockPos(this.field_179485_a.posX, this.field_179485_a.posY + 0.5D, this.field_179485_a.posZ)).offset(this.facing);
IBlockState iblockstate = this.field_179485_a.worldObj.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
this.field_179484_c = true;
return true;
}
}
this.field_179484_c = false;
return super.shouldExecute();
}
}
示例8: updateTask
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public void updateTask()
{
--this.field_179463_b;
if (this.field_179463_b <= 0)
{
World world = this.silverfish.worldObj;
Random random = this.silverfish.getRNG();
BlockPos blockpos = new BlockPos(this.silverfish);
for (int i = 0; i <= 5 && i >= -5; i = i <= 0 ? 1 - i : 0 - i)
{
for (int j = 0; j <= 10 && j >= -10; j = j <= 0 ? 1 - j : 0 - j)
{
for (int k = 0; k <= 10 && k >= -10; k = k <= 0 ? 1 - k : 0 - k)
{
BlockPos blockpos1 = blockpos.add(j, i, k);
IBlockState iblockstate = world.getBlockState(blockpos1);
if (iblockstate.getBlock() == Blocks.monster_egg)
{
if (world.getGameRules().getBoolean("mobGriefing"))
{
world.destroyBlock(blockpos1, true);
}
else
{
world.setBlockState(blockpos1, ((BlockSilverfish.EnumType)iblockstate.getValue(BlockSilverfish.VARIANT)).getModelBlock(), 3);
}
if (random.nextBoolean())
{
return;
}
}
}
}
}
}
}
示例9: selectBlocks
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_)
{
if (p_75062_5_)
{
float f = rand.nextFloat();
if (f < 0.2F)
{
this.blockstate = Blocks.STONEBRICK.getStateFromMeta(BlockStoneBrick.CRACKED_META);
}
else if (f < 0.5F)
{
this.blockstate = Blocks.STONEBRICK.getStateFromMeta(BlockStoneBrick.MOSSY_META);
}
else if (f < 0.55F)
{
this.blockstate = Blocks.MONSTER_EGG.getStateFromMeta(BlockSilverfish.EnumType.STONEBRICK.getMetadata());
}
else
{
this.blockstate = Blocks.STONEBRICK.getDefaultState();
}
}
else
{
this.blockstate = Blocks.AIR.getDefaultState();
}
}
示例10: shouldExecute
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public boolean shouldExecute()
{
if (this.entity.getAttackTarget() != null)
{
return false;
}
else if (!this.entity.getNavigator().noPath())
{
return false;
}
else
{
Random random = this.entity.getRNG();
if (this.entity.world.getGameRules().getBoolean("mobGriefing") && random.nextInt(10) == 0)
{
this.facing = EnumFacing.random(random);
BlockPos blockpos = (new BlockPos(this.entity.posX, this.entity.posY + 0.5D, this.entity.posZ)).offset(this.facing);
IBlockState iblockstate = this.entity.world.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
this.doMerge = true;
return true;
}
}
this.doMerge = false;
return super.shouldExecute();
}
}
示例11: updateTask
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
public void updateTask()
{
--this.lookForFriends;
if (this.lookForFriends <= 0)
{
World world = this.silverfish.world;
Random random = this.silverfish.getRNG();
BlockPos blockpos = new BlockPos(this.silverfish);
for (int i = 0; i <= 5 && i >= -5; i = (i <= 0 ? 1 : 0) - i)
{
for (int j = 0; j <= 10 && j >= -10; j = (j <= 0 ? 1 : 0) - j)
{
for (int k = 0; k <= 10 && k >= -10; k = (k <= 0 ? 1 : 0) - k)
{
BlockPos blockpos1 = blockpos.add(j, i, k);
IBlockState iblockstate = world.getBlockState(blockpos1);
if (iblockstate.getBlock() == Blocks.MONSTER_EGG)
{
if (world.getGameRules().getBoolean("mobGriefing"))
{
world.destroyBlock(blockpos1, true);
}
else
{
world.setBlockState(blockpos1, ((BlockSilverfish.EnumType)iblockstate.getValue(BlockSilverfish.VARIANT)).getModelBlock(), 3);
}
if (random.nextBoolean())
{
return;
}
}
}
}
}
}
}
示例12: selectBlocks
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
/**
* picks Block Ids and Metadata (Silverfish)
*/
public void selectBlocks(Random rand, int x, int y, int z, boolean p_75062_5_)
{
if (p_75062_5_)
{
float f = rand.nextFloat();
if (f < 0.2F)
{
this.blockstate = Blocks.STONEBRICK.getStateFromMeta(BlockStoneBrick.CRACKED_META);
}
else if (f < 0.5F)
{
this.blockstate = Blocks.STONEBRICK.getStateFromMeta(BlockStoneBrick.MOSSY_META);
}
else if (f < 0.55F)
{
this.blockstate = Blocks.MONSTER_EGG.getStateFromMeta(BlockSilverfish.EnumType.STONEBRICK.getMetadata());
}
else
{
this.blockstate = Blocks.STONEBRICK.getDefaultState();
}
}
else
{
this.blockstate = Blocks.AIR.getDefaultState();
}
}
示例13: shouldExecute
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.silverfish.worldObj.getGameRules().getBoolean("mobGriefing"))
{
return false;
}
else if (this.silverfish.getAttackTarget() != null)
{
return false;
}
else if (!this.silverfish.getNavigator().noPath())
{
return false;
}
else
{
Random random = this.silverfish.getRNG();
if (random.nextInt(10) == 0)
{
this.facing = EnumFacing.random(random);
BlockPos blockpos = (new BlockPos(this.silverfish.posX, this.silverfish.posY + 0.5D, this.silverfish.posZ)).offset(this.facing);
IBlockState iblockstate = this.silverfish.worldObj.getBlockState(blockpos);
if (BlockSilverfish.canContainSilverfish(iblockstate))
{
this.doMerge = true;
return true;
}
}
this.doMerge = false;
return super.shouldExecute();
}
}
示例14: updateTask
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
/**
* Updates the task
*/
public void updateTask()
{
--this.lookForFriends;
if (this.lookForFriends <= 0)
{
World world = this.silverfish.worldObj;
Random random = this.silverfish.getRNG();
BlockPos blockpos = new BlockPos(this.silverfish);
for (int i = 0; i <= 5 && i >= -5; i = i <= 0 ? 1 - i : 0 - i)
{
for (int j = 0; j <= 10 && j >= -10; j = j <= 0 ? 1 - j : 0 - j)
{
for (int k = 0; k <= 10 && k >= -10; k = k <= 0 ? 1 - k : 0 - k)
{
BlockPos blockpos1 = blockpos.add(j, i, k);
IBlockState iblockstate = world.getBlockState(blockpos1);
if (iblockstate.getBlock() == Blocks.MONSTER_EGG)
{
if (world.getGameRules().getBoolean("mobGriefing"))
{
world.destroyBlock(blockpos1, true);
}
else
{
world.setBlockState(blockpos1, ((BlockSilverfish.EnumType)iblockstate.getValue(BlockSilverfish.VARIANT)).getModelBlock(), 3);
}
if (random.nextBoolean())
{
return;
}
}
}
}
}
}
}
示例15: updateEntityActionState
import net.minecraft.block.BlockSilverfish; //导入依赖的package包/类
protected void updateEntityActionState()
{
super.updateEntityActionState();
if (!this.worldObj.isClient)
{
int var1;
int var2;
int var3;
int var6;
if (this.allySummonCooldown > 0)
{
--this.allySummonCooldown;
if (this.allySummonCooldown == 0)
{
var1 = MathHelper.floor_double(this.posX);
var2 = MathHelper.floor_double(this.posY);
var3 = MathHelper.floor_double(this.posZ);
boolean var4 = false;
for (int var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0 ? 1 - var5 : 0 - var5)
{
for (var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0 ? 1 - var6 : 0 - var6)
{
for (int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0 ? 1 - var7 : 0 - var7)
{
if (this.worldObj.getBlock(var1 + var6, var2 + var5, var3 + var7) == Blocks.monster_egg)
{
if (!this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"))
{
int var8 = this.worldObj.getBlockMetadata(var1 + var6, var2 + var5, var3 + var7);
ImmutablePair var9 = BlockSilverfish.func_150197_b(var8);
this.worldObj.setBlock(var1 + var6, var2 + var5, var3 + var7, (Block)var9.getLeft(), ((Integer)var9.getRight()).intValue(), 3);
}
else
{
this.worldObj.func_147480_a(var1 + var6, var2 + var5, var3 + var7, false);
}
Blocks.monster_egg.onBlockDestroyedByPlayer(this.worldObj, var1 + var6, var2 + var5, var3 + var7, 0);
if (this.rand.nextBoolean())
{
var4 = true;
break;
}
}
}
}
}
}
}
if (this.entityToAttack == null && !this.hasPath())
{
var1 = MathHelper.floor_double(this.posX);
var2 = MathHelper.floor_double(this.posY + 0.5D);
var3 = MathHelper.floor_double(this.posZ);
int var10 = this.rand.nextInt(6);
Block var11 = this.worldObj.getBlock(var1 + Facing.offsetsXForSide[var10], var2 + Facing.offsetsYForSide[var10], var3 + Facing.offsetsZForSide[var10]);
var6 = this.worldObj.getBlockMetadata(var1 + Facing.offsetsXForSide[var10], var2 + Facing.offsetsYForSide[var10], var3 + Facing.offsetsZForSide[var10]);
if (BlockSilverfish.func_150196_a(var11))
{
this.worldObj.setBlock(var1 + Facing.offsetsXForSide[var10], var2 + Facing.offsetsYForSide[var10], var3 + Facing.offsetsZForSide[var10], Blocks.monster_egg, BlockSilverfish.func_150195_a(var11, var6), 3);
this.spawnExplosionParticle();
this.setDead();
}
else
{
this.updateWanderPath();
}
}
else if (this.entityToAttack != null && !this.hasPath())
{
this.entityToAttack = null;
}
}
}