當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityOcelot類代碼示例

本文整理匯總了Java中net.minecraft.entity.passive.EntityOcelot的典型用法代碼示例。如果您正苦於以下問題:Java EntityOcelot類的具體用法?Java EntityOcelot怎麽用?Java EntityOcelot使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityOcelot類屬於net.minecraft.entity.passive包,在下文中一共展示了EntityOcelot類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onHackFinished

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
@Override
public void onHackFinished(Entity entity, EntityPlayer player) {
    EntityTameable tameable = (EntityTameable) entity;
    if (entity.world.isRemote) {
        tameable.handleStatusUpdate((byte) 7);
    } else {
        tameable.getNavigator().clearPath();
        tameable.setAttackTarget(null);
        tameable.setHealth(20.0F);
        tameable.setOwnerId(player.getUniqueID());
        entity.world.setEntityState(tameable, (byte) 7);
        tameable.setTamed(true);

        // TODO: code smell
        // Would be better to have a HackableOcelot subclass, but HackableHandler.getHackableForEntity() isn't
        // set up to prioritise getting an ocelot over a generic tameable.
        if (entity instanceof EntityOcelot) {
            ((EntityOcelot) entity).setTameSkin(1 + entity.getEntityWorld().rand.nextInt(3));
        }
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:22,代碼來源:HackableTameable.java

示例2: BiomeGenJungle

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:25,代碼來源:BiomeGenJungle.java

示例3: getEntityTexture

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return ocelotTextures;

        case 1:
            return blackOcelotTextures;

        case 2:
            return redOcelotTextures;

        case 3:
            return siameseOcelotTextures;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:22,代碼來源:RenderOcelot.java

示例4: BiomeJungle

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
public BiomeJungle(boolean isEdgeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.isEdge = isEdgeIn;

    if (isEdgeIn)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!isEdgeIn)
    {
        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:25,代碼來源:BiomeJungle.java

示例5: getEntityTexture

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return OCELOT_TEXTURES;

        case 1:
            return BLACK_OCELOT_TEXTURES;

        case 2:
            return RED_OCELOT_TEXTURES;

        case 3:
            return SIAMESE_OCELOT_TEXTURES;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:22,代碼來源:RenderOcelot.java

示例6: getEntityTexture

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot entity)
{
    switch (entity.getTameSkin())
    {
        case 0:
        default:
            return OCELOT_TEXTURES;
        case 1:
            return BLACK_OCELOT_TEXTURES;
        case 2:
            return RED_OCELOT_TEXTURES;
        case 3:
            return SIAMESE_OCELOT_TEXTURES;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:19,代碼來源:RenderOcelot.java

示例7: isOcelotBlockingChest

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
@SuppressWarnings("rawtypes")
public static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3)
{
    final Iterator var4 = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getBoundingBox(par1, par2 + 1, par3, par1 + 1, par2 + 2, par3 + 1)).iterator();
    EntityOcelot var6;

    do
    {
        if (!var4.hasNext())
        {
            return false;
        }

        final EntityOcelot var5 = (EntityOcelot) var4.next();
        var6 = var5;
    }
    while (!var6.isSitting());

    return true;
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:21,代碼來源:BlockTier2TreasureChest.java

示例8: EntityZombieDog

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
public EntityZombieDog(World world, boolean isHusk) {
    super(world);

    this.setMobType(isHusk ? EnumUndeadMobType.HUSK : EnumUndeadMobType.ZOMBIE);

    ((PathNavigateGround) this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1, false));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1));
    this.tasks.addTask(6, new EntityAIWander(this, 1));
    this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    if (ExtendedConfig.zombiePetsAttackPets) {
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityOcelot.class, false));
    }
    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntitySheep.class, false));
    }
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Extended,代碼行數:22,代碼來源:EntityZombieDog.java

示例9: EntityZombieCat

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
public EntityZombieCat(World world, boolean isHusk) {
    super(world);

    this.setMobType(isHusk ? EnumUndeadMobType.HUSK : EnumUndeadMobType.ZOMBIE);

    ((PathNavigateGround) this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1, false));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1));
    this.tasks.addTask(6, new EntityAIWander(this, 1));
    this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    if (ExtendedConfig.zombiePetsAttackPets) {
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityOcelot.class, false));
    }
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityChicken.class, false));
    }

    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Extended,代碼行數:23,代碼來源:EntityZombieCat.java

示例10: getCorpse

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
public static List<ItemStack> getCorpse(Entity entity, EnumCorpse type) {
    NBTTagCompound nbtTag = new NBTTagCompound();
    switch (type) {
        case VILLAGER:
            VillagerCorpseHelper.setNbt((EntityVillager) entity, nbtTag);
            break;
        case HORSE:
            HorseCorpseHelper.setNbt((AbstractHorse) entity, nbtTag);
            break;
        case DOG:
            DogCorpseHelper.setNbt((EntityWolf) entity, nbtTag);
            break;
        case CAT:
            CatCorpseHelper.setNbt((EntityOcelot) entity, nbtTag);
            break;
    }

    List<ItemStack> corpse = new ArrayList<>();
    ItemStack stack = new ItemStack(GSBlock.CORPSE, 1, type.ordinal());
    stack.setTagCompound(nbtTag);
    corpse.add(stack);
    return corpse;
}
 
開發者ID:NightKosh,項目名稱:Gravestone-mod-Extended,代碼行數:24,代碼來源:CorpseHelper.java

示例11: getEntityTexture

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityOcelot par1EntityOcelot)
{
    switch (par1EntityOcelot.getTameSkin())
    {
        case 0:
        default:
            return ocelotTextures;

        case 1:
            return blackOcelotTextures;

        case 2:
            return redOcelotTextures;

        case 3:
            return siameseOcelotTextures;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:22,代碼來源:RenderOcelot.java

示例12: func_149953_o

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
private static boolean func_149953_o(World p_149953_0_, int p_149953_1_, int p_149953_2_, int p_149953_3_) {
	Iterator iterator = p_149953_0_.getEntitiesWithinAABB(EntityOcelot.class,
			AxisAlignedBB.getBoundingBox(p_149953_1_, p_149953_2_ + 1, p_149953_3_, p_149953_1_ + 1, p_149953_2_ + 2, p_149953_3_ + 1)).iterator();
	EntityOcelot entityocelot1;

	do {
		if (!iterator.hasNext()) {
			return false;
		}

		EntityOcelot entityocelot = (EntityOcelot) iterator.next();
		entityocelot1 = entityocelot;
	} while (!entityocelot1.isSitting());

	return true;
}
 
開發者ID:mookie1097,項目名稱:NightfallMod,代碼行數:17,代碼來源:BlockNFChest.java

示例13: onEntityCollidedWithBlock

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
/**
  * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
  */
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity){
 	if(par1World.isRemote){
 		return;
 	}else{
 	
 		if(par5Entity instanceof EntityCreeper || par5Entity instanceof EntityOcelot || par5Entity instanceof EntityEnderman || par5Entity instanceof EntityItem){
 			return;
 		}else{
 			this.explode(par1World, par2, par3, par4);
 		}
 		
 	}
 
 	
 }
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:19,代碼來源:BlockFullMineBase.java

示例14: onEntityCollidedWithBlock

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
/**
  * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
  */
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
 	if(par1World.isRemote){
 		return;
 	}else{
 	
 		if(par5Entity instanceof EntityCreeper || par5Entity instanceof EntityOcelot || par5Entity instanceof EntityEnderman || par5Entity instanceof EntityItem){
 			return;
 		}else{
 			this.explode(par1World, par2, par3, par4);
 		}
 		
 	}
 
 	
}
 
開發者ID:Geforce132,項目名稱:SecurityCraft,代碼行數:20,代碼來源:BlockMine.java

示例15: canMateWith

import net.minecraft.entity.passive.EntityOcelot; //導入依賴的package包/類
/**
    * Returns true if the mob is currently able to mate with the specified mob.
    */
   @Override
public boolean canMateWith(EntityAnimal par1EntityAnimal)
   {
       if (par1EntityAnimal == this)
       {
           return false;
       }
       else if (!this.isTamed())
       {
           return false;
       }
       else if (!(par1EntityAnimal instanceof EntityOcelot))
       {
           return false;
       }
       else
       {
           EntityOcelot entityocelot = (EntityOcelot)par1EntityAnimal;
           return !entityocelot.isTamed() ? false : this.isInLove() && entityocelot.isInLove();
       }
   }
 
開發者ID:mookie1097,項目名稱:NausicaaMod,代碼行數:25,代碼來源:EntityFoxSquirrel.java


注:本文中的net.minecraft.entity.passive.EntityOcelot類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。