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


Java EntityPigZombie类代码示例

本文整理汇总了Java中net.minecraft.entity.monster.EntityPigZombie的典型用法代码示例。如果您正苦于以下问题:Java EntityPigZombie类的具体用法?Java EntityPigZombie怎么用?Java EntityPigZombie使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EntityPigZombie类属于net.minecraft.entity.monster包,在下文中一共展示了EntityPigZombie类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isMobAggressive

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:26,代码来源:EntityUtils.java

示例2: onStruckByLightning

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:EntityPig.java

示例3: onStruckByLightning

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:EntityPig.java

示例4: updateTick

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
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();
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:BlockPortal.java

示例5: onStruckByLightning

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:23,代码来源:EntityPig.java

示例6: updateTick

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
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();
            }
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:BlockPortal.java

示例7: postInit

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
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);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:24,代码来源:ModEntites.java

示例8: saveCurrentRenderers

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
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);
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:20,代码来源:MineLittlePony.java

示例9: inputEnergy

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
@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;
}
 
开发者ID:Szewek,项目名称:Minecraft-Flux,代码行数:22,代码来源:EntityActionEnergy.java

示例10: applyEntityAI

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
@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));
    }
 
开发者ID:WayofTime,项目名称:Hemomancy,代码行数:17,代码来源:EntitySummon.java

示例11: BiomeGenDarkLand

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
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));
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:20,代码来源:BiomeGenDarkLand.java

示例12: BiomeGenDarkLand

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
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));
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:18,代码来源:BiomeGenDarkLand.java

示例13: attackEntity

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
@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;
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:18,代码来源:TileEntityProtecto.java

示例14: attackEntity

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
@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;
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:18,代码来源:TileEntityProtecto.java

示例15: attackEntity

import net.minecraft.entity.monster.EntityPigZombie; //导入依赖的package包/类
@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;
}
 
开发者ID:Geforce132,项目名称:SecurityCraft,代码行数:18,代码来源:TileEntityProtecto.java


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