java类net.minecraft.entity.monster.EntityPigZombie的实例源码

EntityUtils.java 文件源码 项目:ForgeHax 阅读 31 收藏 0 点赞 0 评论 0
/**
 * Checks if the mob could be possibly hostile towards us (we can't detect their attack target easily)
 * Current entities:
 *                  PigZombie: Aggressive if arms are raised, when arms are put down a internal timer is slowly ticked down from 400
 *                  Wolf: Aggressive if the owner isn't the local player and the wolf is angry
 *                  Enderman: Aggressive if making screaming sounds
 */
public static boolean isMobAggressive(Entity entity) {
    if(entity instanceof EntityPigZombie) {
        // arms raised = aggressive, angry = either game or we have set the anger cooldown
        if(((EntityPigZombie) entity).isArmsRaised() || ((EntityPigZombie) entity).isAngry()) {
            if(!((EntityPigZombie) entity).isAngry()) {
                // set pigmens anger to 400 if it hasn't been angered already
                FastReflection.Fields.EntityPigZombie_angerLevel.set((EntityPigZombie)entity, 400);
            }
            return true;
        }
    } else if(entity instanceof EntityWolf) {
        return ((EntityWolf) entity).isAngry() &&
                !MC.player.equals(((EntityWolf) entity).getOwner());
    } else if(entity instanceof EntityEnderman) {
        return ((EntityEnderman) entity).isScreaming();
    }
    return false;
}
EntityPig.java 文件源码 项目:DecompiledMinecraft 阅读 40 收藏 0 点赞 0 评论 0
/**
 * Called when a lightning bolt hits the entity.
 */
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
    if (!this.worldObj.isRemote && !this.isDead)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
        entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        entitypigzombie.setNoAI(this.isAIDisabled());

        if (this.hasCustomName())
        {
            entitypigzombie.setCustomNameTag(this.getCustomNameTag());
            entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
        }

        this.worldObj.spawnEntityInWorld(entitypigzombie);
        this.setDead();
    }
}
EntityPig.java 文件源码 项目:DecompiledMinecraft 阅读 27 收藏 0 点赞 0 评论 0
/**
 * Called when a lightning bolt hits the entity.
 */
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
    if (!this.worldObj.isRemote && !this.isDead)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
        entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        entitypigzombie.setNoAI(this.isAIDisabled());

        if (this.hasCustomName())
        {
            entitypigzombie.setCustomNameTag(this.getCustomNameTag());
            entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
        }

        this.worldObj.spawnEntityInWorld(entitypigzombie);
        this.setDead();
    }
}
EntityPig.java 文件源码 项目:BaseClient 阅读 29 收藏 0 点赞 0 评论 0
/**
 * Called when a lightning bolt hits the entity.
 */
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
    if (!this.worldObj.isRemote && !this.isDead)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
        entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        entitypigzombie.setNoAI(this.isAIDisabled());

        if (this.hasCustomName())
        {
            entitypigzombie.setCustomNameTag(this.getCustomNameTag());
            entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
        }

        this.worldObj.spawnEntityInWorld(entitypigzombie);
        this.setDead();
    }
}
EntityPig.java 文件源码 项目:BaseClient 阅读 27 收藏 0 点赞 0 评论 0
/**
 * Called when a lightning bolt hits the entity.
 */
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
    if (!this.worldObj.isRemote && !this.isDead)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
        entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        entitypigzombie.setNoAI(this.isAIDisabled());

        if (this.hasCustomName())
        {
            entitypigzombie.setCustomNameTag(this.getCustomNameTag());
            entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
        }

        this.worldObj.spawnEntityInWorld(entitypigzombie);
        this.setDead();
    }
}
EntityPig.java 文件源码 项目:Backmemed 阅读 41 收藏 0 点赞 0 评论 0
/**
 * Called when a lightning bolt hits the entity.
 */
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
    if (!this.world.isRemote && !this.isDead)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.world);
        entitypigzombie.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        entitypigzombie.setNoAI(this.isAIDisabled());

        if (this.hasCustomName())
        {
            entitypigzombie.setCustomNameTag(this.getCustomNameTag());
            entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
        }

        this.world.spawnEntityInWorld(entitypigzombie);
        this.setDead();
    }
}
BlockPortal.java 文件源码 项目:Backmemed 阅读 25 收藏 0 点赞 0 评论 0
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    super.updateTick(worldIn, pos, state, rand);

    if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getBoolean("doMobSpawning") && rand.nextInt(2000) < worldIn.getDifficulty().getDifficultyId())
    {
        int i = pos.getY();
        BlockPos blockpos;

        for (blockpos = pos; !worldIn.getBlockState(blockpos).isFullyOpaque() && blockpos.getY() > 0; blockpos = blockpos.down())
        {
            ;
        }

        if (i > 0 && !worldIn.getBlockState(blockpos.up()).isNormalCube())
        {
            Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, EntityList.func_191306_a(EntityPigZombie.class), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 1.1D, (double)blockpos.getZ() + 0.5D);

            if (entity != null)
            {
                entity.timeUntilPortal = entity.getPortalCooldown();
            }
        }
    }
}
EntityPig.java 文件源码 项目:CustomWorldGen 阅读 30 收藏 0 点赞 0 评论 0
/**
 * Called when a lightning bolt hits the entity.
 */
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
    if (!this.worldObj.isRemote && !this.isDead)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
        entitypigzombie.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        entitypigzombie.setNoAI(this.isAIDisabled());

        if (this.hasCustomName())
        {
            entitypigzombie.setCustomNameTag(this.getCustomNameTag());
            entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
        }

        this.worldObj.spawnEntityInWorld(entitypigzombie);
        this.setDead();
    }
}
BlockPortal.java 文件源码 项目:CustomWorldGen 阅读 31 收藏 0 点赞 0 评论 0
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    super.updateTick(worldIn, pos, state, rand);

    if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getBoolean("doMobSpawning") && rand.nextInt(2000) < worldIn.getDifficulty().getDifficultyId())
    {
        int i = pos.getY();
        BlockPos blockpos;

        for (blockpos = pos; !worldIn.getBlockState(blockpos).isFullyOpaque() && blockpos.getY() > 0; blockpos = blockpos.down())
        {
            ;
        }

        if (i > 0 && !worldIn.getBlockState(blockpos.up()).isNormalCube())
        {
            Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, EntityList.getEntityStringFromClass(EntityPigZombie.class), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 1.1D, (double)blockpos.getZ() + 0.5D);

            if (entity != null)
            {
                entity.timeUntilPortal = entity.getPortalCooldown();
            }
        }
    }
}
ModEntites.java 文件源码 项目:CrystalMod 阅读 37 收藏 0 点赞 0 评论 0
public static void postInit(){
    addToBiomes(EntityCrystalPigZombie.class, 50, 1, 4, EnumCreatureType.MONSTER, getBiomesThatCanSpawn(EntityPigZombie.class, EnumCreatureType.MONSTER));
    addToBiomes(EntityCrystalCow.class, 6, 1, 4, EnumCreatureType.CREATURE, getBiomesThatCanSpawn(EntityCow.class, EnumCreatureType.CREATURE));
    addToBiomes(EntityCrystalEnderman.class, 8, 1, 4, EnumCreatureType.MONSTER, getBiomesThatCanSpawn(EntityEnderman.class, EnumCreatureType.MONSTER));

    List<Biome> angelBiomeList = getBiomesThatCanSpawn(EntityEnderman.class, EnumCreatureType.MONSTER);
    Biome hell = Biome.REGISTRY.getObject(new ResourceLocation("hell"));
    Biome sky = Biome.REGISTRY.getObject(new ResourceLocation("sky"));

    if(sky !=null){
        angelBiomeList.remove(sky);
    }

    if(hell !=null){
        angelBiomeList.remove(hell);
        List<Biome> listHell = Lists.newArrayList(hell);
        addToBiomes(EntityAngel.class, 50, 4, 4, EnumCreatureType.MONSTER, listHell);
        addToBiomes(EntityDevil.class, 50, 4, 4, EnumCreatureType.MONSTER, listHell);
    }

    addToBiomes(EntityAngel.class, 8, 1, 4, EnumCreatureType.MONSTER, angelBiomeList);
    addToBiomes(EntityDevil.class, 8, 1, 4, EnumCreatureType.MONSTER, angelBiomeList);
}
MineLittlePony.java 文件源码 项目:MineLittlePony 阅读 29 收藏 0 点赞 0 评论 0
private void saveCurrentRenderers(RenderManager rm) {
    // villagers
    saveRenderer(rm, EntityVillager.class);
    saveRenderer(rm, EntityZombieVillager.class);
    // zombies
    saveRenderer(rm, EntityZombie.class);
    saveRenderer(rm, EntityHusk.class);
    // pig zombie
    saveRenderer(rm, EntityPigZombie.class);
    // skeletons
    saveRenderer(rm, EntitySkeleton.class);
    saveRenderer(rm, EntityStray.class);
    saveRenderer(rm, EntityWitherSkeleton.class);
    // illagers
    saveRenderer(rm, EntityVex.class);
    saveRenderer(rm, EntityEvoker.class);
    saveRenderer(rm, EntityVindicator.class);
    saveRenderer(rm, EntityIllusionIllager.class);
}
EntityActionEnergy.java 文件源码 项目:Minecraft-Flux 阅读 27 收藏 0 点赞 0 评论 0
@Override
public long inputEnergy(long amount, boolean simulate) {
    if (!simulate && !charged) {
        if (creature instanceof EntityPig) {
            final EntityPigZombie pigman = new EntityPigZombie(creature.world);
            pigman.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_AXE));
            pigman.setLocationAndAngles(creature.posX, creature.posY, creature.posZ, creature.rotationYaw, creature.rotationPitch);
            pigman.setNoAI(creature.isAIDisabled());
            if (creature.hasCustomName()) {
                pigman.setCustomNameTag(creature.getCustomNameTag());
                pigman.setAlwaysRenderNameTag(creature.getAlwaysRenderNameTag());
            }
            creature.world.spawnEntity(pigman);
            creature.setDead();
        } else if (creature instanceof EntityCreeper)
            creature.onStruckByLightning(null);
        charged = true;
        return 1;
    }
    return charged ? 0 : 1;
}
EntitySummon.java 文件源码 项目:Hemomancy 阅读 30 收藏 0 点赞 0 评论 0
@Override
    protected void applyEntityAI()
    {
//        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityMob.class, 1.0D, true));

        this.tasks.addTask(9, new SummonAIMoveToArea(this, 1.0));
        this.tasks.addTask(4, new SummonAIManipulateTargetBlock(this));
        this.tasks.addTask(6, new SummonAIMoveToNextTargetBlock(this, 1.0));

        this.tasks.addTask(3, new SummonAIMoveToChest(this, 1.0));
        this.tasks.addTask(4, new SummonAIDumpToChest(this));

//        this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false));
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityPigZombie.class}));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityMob.class, true));
    }
BiomeGenDarkLand.java 文件源码 项目:ZeroQuest 阅读 29 收藏 0 点赞 0 评论 0
public BiomeGenDarkLand(int id) {
    super(id);
    this.waterColorMultiplier = 0x666600;
    this.theBiomeDecorator.treesPerChunk = 1;
    this.theBiomeDecorator.grassPerChunk = 1;
    this.theBiomeDecorator.flowersPerChunk = -999;
    this.theBiomeDecorator.generateLakes = true;
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityDarkZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 60, 1, 5));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 20, 2, 3));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 20, 1, 2));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityKurr.class, 10, 2, 2));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
}
BiomeGenDarkLand.java 文件源码 项目:ZeroQuest 阅读 33 收藏 0 点赞 0 评论 0
public BiomeGenDarkLand(int id) {
    super(id);
    this.waterColorMultiplier = 0x666600;
    this.theBiomeDecorator.treesPerChunk = 1;
    this.theBiomeDecorator.grassPerChunk = 1;
    this.theBiomeDecorator.flowersPerChunk = -999;
    this.addFlower(ModBlocks.nileBlackFlower.getDefaultState(), 100);
    this.theBiomeDecorator.generateLakes = true;
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 60, 1, 5));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 20, 2, 3));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 20, 1, 2));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
}
EntityPig.java 文件源码 项目:ExpandedRailsMod 阅读 42 收藏 0 点赞 0 评论 0
/**
 * Called when a lightning bolt hits the entity.
 */
public void onStruckByLightning(EntityLightningBolt lightningBolt)
{
    if (!this.worldObj.isRemote && !this.isDead)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);
        entitypigzombie.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.GOLDEN_SWORD));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        entitypigzombie.setNoAI(this.isAIDisabled());

        if (this.hasCustomName())
        {
            entitypigzombie.setCustomNameTag(this.getCustomNameTag());
            entitypigzombie.setAlwaysRenderNameTag(this.getAlwaysRenderNameTag());
        }

        this.worldObj.spawnEntityInWorld(entitypigzombie);
        this.setDead();
    }
}
BlockPortal.java 文件源码 项目:ExpandedRailsMod 阅读 33 收藏 0 点赞 0 评论 0
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    super.updateTick(worldIn, pos, state, rand);

    if (worldIn.provider.isSurfaceWorld() && worldIn.getGameRules().getBoolean("doMobSpawning") && rand.nextInt(2000) < worldIn.getDifficulty().getDifficultyId())
    {
        int i = pos.getY();
        BlockPos blockpos;

        for (blockpos = pos; !worldIn.getBlockState(blockpos).isFullyOpaque() && blockpos.getY() > 0; blockpos = blockpos.down())
        {
            ;
        }

        if (i > 0 && !worldIn.getBlockState(blockpos.up()).isNormalCube())
        {
            Entity entity = ItemMonsterPlacer.spawnCreature(worldIn, EntityList.getEntityStringFromClass(EntityPigZombie.class), (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 1.1D, (double)blockpos.getZ() + 0.5D);

            if (entity != null)
            {
                entity.timeUntilPortal = entity.getPortalCooldown();
            }
        }
    }
}
TileEntityProtecto.java 文件源码 项目:SecurityCraft 阅读 27 收藏 0 点赞 0 评论 0
@Override
public boolean attackEntity(Entity entity){
    if (entity instanceof EntityLivingBase) {
        if ((entity instanceof EntityPlayer && (getOwner().isOwner((EntityPlayer) entity) || (hasModule(EnumCustomModules.WHITELIST) && ModuleUtils.getPlayersFromModule(worldObj, pos, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) entity).getName().toLowerCase())))) ||
                entity instanceof EntityPigZombie ||
                (entity instanceof EntityCreeper && ((EntityCreeper) entity).getPowered()))
            return false;

        EntityLightningBolt lightning = new EntityLightningBolt(worldObj, entity.posX, entity.posY, entity.posZ, true);
        worldObj.addWeatherEffect(lightning);

        BlockUtils.setBlockProperty(worldObj, pos, BlockProtecto.ACTIVATED, false);
        return true;
    }

    return false;
}
TileEntityProtecto.java 文件源码 项目:SecurityCraft 阅读 28 收藏 0 点赞 0 评论 0
@Override
public boolean attackEntity(Entity entity){
    if (entity instanceof EntityLivingBase) {
        if ((entity instanceof EntityPlayer && (getOwner().isOwner((EntityPlayer) entity) || (hasModule(EnumCustomModules.WHITELIST) && ModuleUtils.getPlayersFromModule(world, pos, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) entity).getName().toLowerCase())))) ||
                entity instanceof EntityPigZombie ||
                (entity instanceof EntityCreeper && ((EntityCreeper) entity).getPowered()))
            return false;

        EntityLightningBolt lightning = new EntityLightningBolt(world, entity.posX, entity.posY, entity.posZ, true);
        world.addWeatherEffect(lightning);

        BlockUtils.setBlockProperty(world, pos, BlockProtecto.ACTIVATED, false);
        return true;
    }

    return false;
}
TileEntityProtecto.java 文件源码 项目:SecurityCraft 阅读 28 收藏 0 点赞 0 评论 0
@Override
public boolean attackEntity(Entity entity){
    if (entity instanceof EntityLivingBase) {
        if ((entity instanceof EntityPlayer && (getOwner().isOwner((EntityPlayer) entity) || (hasModule(EnumCustomModules.WHITELIST) && ModuleUtils.getPlayersFromModule(worldObj, pos, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) entity).getCommandSenderName().toLowerCase())))) ||
                entity instanceof EntityPigZombie ||
                (entity instanceof EntityCreeper && ((EntityCreeper) entity).getPowered()))
            return false;

        EntityLightningBolt lightning = new EntityLightningBolt(worldObj, entity.posX, entity.posY, entity.posZ);
        worldObj.addWeatherEffect(lightning);

        BlockUtils.setBlockProperty(worldObj, pos, BlockProtecto.ACTIVATED, false);
        return true;
    }

    return false;
}
TileEntityProtecto.java 文件源码 项目:SecurityCraft 阅读 34 收藏 0 点赞 0 评论 0
@Override
public boolean attackEntity(Entity entity){
    if (entity instanceof EntityLivingBase) {
        if ((entity instanceof EntityPlayer && (getOwner().isOwner((EntityPlayer) entity) || (hasModule(EnumCustomModules.WHITELIST) && ModuleUtils.getPlayersFromModule(worldObj, pos, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) entity).getName().toLowerCase())))) ||
                entity instanceof EntityPigZombie ||
                (entity instanceof EntityCreeper && ((EntityCreeper) entity).getPowered()))
            return false;

        EntityLightningBolt lightning = new EntityLightningBolt(worldObj, entity.posX, entity.posY, entity.posZ);
        worldObj.addWeatherEffect(lightning);

        BlockUtils.setBlockProperty(worldObj, pos, BlockProtecto.ACTIVATED, false);
        return true;
    }

    return false;
}
TileEntityProtecto.java 文件源码 项目:SecurityCraft 阅读 25 收藏 0 点赞 0 评论 0
@Override
public boolean attackEntity(Entity entity){
    if (entity instanceof EntityLivingBase) {
        if ((entity instanceof EntityPlayer && (getOwner().isOwner((EntityPlayer) entity) || (hasModule(EnumCustomModules.WHITELIST) && ModuleUtils.getPlayersFromModule(world, pos, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) entity).getName().toLowerCase())))) ||
                entity instanceof EntityPigZombie ||
                (entity instanceof EntityCreeper && ((EntityCreeper) entity).getPowered()))
            return false;

        EntityLightningBolt lightning = new EntityLightningBolt(world, entity.posX, entity.posY, entity.posZ, true);
        world.addWeatherEffect(lightning);

        BlockUtils.setBlockProperty(world, pos, BlockProtecto.ACTIVATED, false);
        return true;
    }

    return false;
}
BiomeHellAnomaly.java 文件源码 项目:Quantum-Anomalies 阅读 33 收藏 0 点赞 0 评论 0
public BiomeHellAnomaly(int id) {
    super(id);
    this.setBiomeName("Hell Anomaly");

    this.rootHeight = -1F;
    this.heightVariation = 3.5F;

    this.setColor(16711680);
    this.setDisableRain();

    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableWaterCreatureList.clear();
    this.spawnableCaveCreatureList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGhast.class, 50, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 1, 4, 4));
    this.topBlock = Blocks.netherrack;
    this.fillerBlock = Blocks.netherrack;
    this.theBiomeDecorator = new BiomeAnomalyDecorator();
}
EntityPig.java 文件源码 项目:Cauldron 阅读 29 收藏 0 点赞 0 评论 0
public void onStruckByLightning(EntityLightningBolt p_70077_1_)
{
    if (!this.worldObj.isRemote)
    {
        EntityPigZombie entitypigzombie = new EntityPigZombie(this.worldObj);

        // Cauldron start
        if (p_70077_1_ != null)
        {
            // CraftBukkit start
            if (CraftEventFactory.callPigZapEvent(this, p_70077_1_, entitypigzombie).isCancelled())
            {
                return;
            }

            // CraftBukkit end
        }
        // Cauldron end
        entitypigzombie.setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword));
        entitypigzombie.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
        // CraftBukkit - added a reason for spawning this creature
        this.worldObj.addEntity(entitypigzombie, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
        this.setDead();
    }
}
MobEquipmentHandler.java 文件源码 项目:Rubedo 阅读 31 收藏 0 点赞 0 评论 0
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event) {
    ContentAI contentAI = Singleton.getInstance(ContentAI.class);
    if (contentAI.pigmenDropSilver
            && event.entity instanceof EntityPigZombie) {
        for (EntityItem drop : event.drops) {
            if (drop.getEntityItem().getItem() == Items.gold_ingot)
                drop.setEntityItemStack(new ItemStack(
                        ContentWorld.metalItems,
                        drop.getEntityItem().stackSize,
                        ContentWorld.metalItems
                                .getTextureIndex("silver_ingot")));
            if (drop.getEntityItem().getItem() == Items.gold_nugget)
                drop.setEntityItemStack(new ItemStack(
                        ContentWorld.metalItems,
                        drop.getEntityItem().stackSize,
                        ContentWorld.metalItems
                                .getTextureIndex("silver_nugget")));

            if (drop.getEntityItem().getItem() == Singleton.getInstance(
                    ContentTools.class).getItem(ToolSword.class)) {
                drop.getEntityItem().setItemDamage(0);
            }
        }
    }
}
ZSSItemEvents.java 文件源码 项目:ZeldaSwordSkills 阅读 33 收藏 0 点赞 0 评论 0
private static void init() {
    addDrop(EntityCreeper.class, SkillBase.armorBreak);
    addDrop(EntityIronGolem.class, SkillBase.armorBreak);
    addDrop(EntitySilverfish.class, SkillBase.dash);
    addDrop(EntityHorse.class, SkillBase.dash);
    addDrop(EntityEnderman.class, SkillBase.dodge);
    addDrop(EntityKeese.class, SkillBase.dodge);
    addDrop(EntitySpider.class, SkillBase.endingBlow);
    addDrop(EntityCaveSpider.class, SkillBase.leapingBlow);
    addDrop(EntityMagmaCube.class, SkillBase.leapingBlow);
    addDrop(EntityPigZombie.class, SkillBase.parry);
    addDrop(EntityOcelot.class, SkillBase.parry);
    addDrop(EntityOctorok.class, SkillBase.risingCut);
    addDrop(EntityBlaze.class, SkillBase.spinAttack);
    addDrop(EntityDarknut.class, SkillBase.spinAttack);
    addDrop(EntityZombie.class, SkillBase.swordBasic);
    addDrop(EntitySkeleton.class, SkillBase.swordBasic);
    addDrop(EntityGhast.class, SkillBase.swordBeam);
    addDrop(EntityWitch.class, SkillBase.swordBeam);
    addDrop(EntityWizzrobe.class, SkillBase.swordBreak);
}
EntDec.java 文件源码 项目:CountryGamer_PlantsVsZombies 阅读 37 收藏 0 点赞 0 评论 0
public static boolean entityUndeadCheck(MovingObjectPosition movObjPos) {
    boolean result = false;
    if ((movObjPos.entityHit instanceof EntityZombie)) {
        result = true;
    }
    if ((movObjPos.entityHit instanceof EntitySkeleton)) {
        result = true;
    }
    if ((movObjPos.entityHit instanceof EntityPigZombie)) {
        result = true;
    }
    if ((!(movObjPos.entityHit instanceof EntityBlaze))
            || ((!(movObjPos.entityHit instanceof EntityWitherSkull)) || ((!(movObjPos.entityHit instanceof EntityWither)) || ((movObjPos.entityHit instanceof EntityGhast)))))
        ;
    return result;
}
EntitySoullessKnight.java 文件源码 项目:harshencastle 阅读 27 收藏 0 点赞 0 评论 0
public EntitySoullessKnight(World worldIn) {
    super(worldIn);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(0, new EntityAIAttackMelee(this, 1d, true));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEnderman.class, 50f, 1d, 2d));
    this.tasks.addTask(0, new AIEntityWanderNoWater(this, 1d, 0));
    this.tasks.addTask(0, new EntityAIMoveTowardsTarget(this, 1d, 100));

    this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
       this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityPigZombie.class}));

    this.experienceValue = 50;
}
ZombiPendant.java 文件源码 项目:harshencastle 阅读 37 收藏 0 点赞 0 评论 0
@HarshenEvent
public void onLivingHurt(LivingHurtEvent event)
{
    if(event.getSource() instanceof EntityDamageSource && ((EntityDamageSource)event.getSource()).getTrueSource() instanceof EntityZombie &&
            !(((EntityDamageSource)event.getSource()).getTrueSource() instanceof EntityPigZombie))
        event.setAmount(1);
}
EntityPigMage.java 文件源码 项目:Infernum 阅读 26 收藏 0 点赞 0 评论 0
@Override
public void initEntityAI() {
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityPigZombieMage.class, 8.0F, 0.8D, 0.8D));
    this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityPigZombie.class, 8.0F, 0.6D, 0.6D));
    this.tasks.addTask(2, new EntityAIMoveIndoors(this));
    this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
    this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
    this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
    this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
    this.applyEntityAI();
}


问题


面经


文章

微信
公众号

扫码关注公众号