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


Java BlockSilverfish.canContainSilverfish方法代码示例

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


在下文中一共展示了BlockSilverfish.canContainSilverfish方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:EntitySilverfish.java

示例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();
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:EntitySilverfish.java

示例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();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:EntitySilverfish.java

示例4: 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();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:32,代码来源:EntitySilverfish.java

示例5: 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();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:32,代码来源:EntitySilverfish.java

示例6: 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();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:39,代码来源:EntitySilverfish.java


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