Java Code Examples for net.minecraft.init.Blocks.monster_egg()

The following are Jave code examples for showing how to use monster_egg() of the net.minecraft.init.Blocks class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: EntitySilverfish.java   View Source Code Vote up 5 votes
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;
                        }
                    }
                }
            }
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: EntitySilverfish.java   View Source Code Vote up 5 votes
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;
                        }
                    }
                }
            }
        }
    }
}
 
Example 3
Project: BaseClient   File: EntitySilverfish.java   View Source Code Vote up 5 votes
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;
                        }
                    }
                }
            }
        }
    }
}
 
Example 4
Project: BaseClient   File: EntitySilverfish.java   View Source Code Vote up 5 votes
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;
                        }
                    }
                }
            }
        }
    }
}