當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。