Java Code Examples for net.minecraft.entity.passive.EntityPig.getSaddled()

The following are Jave code examples for showing how to use getSaddled() of the net.minecraft.entity.passive.EntityPig class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target)
{
    if (target instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)target;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 2
Project: DecompiledMinecraft   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target)
{
    if (target instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)target;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 3
Project: BaseClient   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target)
{
    if (target instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)target;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 4
Project: BaseClient   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target)
{
    if (target instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)target;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 5
Project: Backmemed   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target, EnumHand hand)
{
    if (target instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)target;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.world.playSound(playerIn, entitypig.posX, entitypig.posY, entitypig.posZ, SoundEvents.ENTITY_PIG_SADDLE, SoundCategory.NEUTRAL, 0.5F, 1.0F);
            stack.func_190918_g(1);
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 6
Project: CustomWorldGen   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target, EnumHand hand)
{
    if (target instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)target;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSound(playerIn, entitypig.posX, entitypig.posY, entitypig.posZ, SoundEvents.ENTITY_PIG_SADDLE, SoundCategory.NEUTRAL, 0.5F, 1.0F);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 7
Project: Resilience-Client-Source   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase)
{
    if (par3EntityLivingBase instanceof EntityPig)
    {
        EntityPig var4 = (EntityPig)par3EntityLivingBase;

        if (!var4.getSaddled() && !var4.isChild())
        {
            var4.setSaddled(true);
            var4.worldObj.playSoundAtEntity(var4, "mob.horse.leather", 0.5F, 1.0F);
            --par1ItemStack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 8
Project: ExpandedRailsMod   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer playerIn, EntityLivingBase target, EnumHand hand)
{
    if (target instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)target;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSound(playerIn, entitypig.posX, entitypig.posY, entitypig.posZ, SoundEvents.ENTITY_PIG_SADDLE, SoundCategory.NEUTRAL, 0.5F, 1.0F);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 9
Project: Cauldron   File: ItemSaddle.java   View Source Code Vote up 6 votes
public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_)
{
    if (p_111207_3_ instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)p_111207_3_;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F);
            --p_111207_1_.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 10
Project: Cauldron   File: ItemSaddle.java   View Source Code Vote up 6 votes
public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_)
{
    if (p_111207_3_ instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)p_111207_3_;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            entitypig.worldObj.playSoundAtEntity(entitypig, "mob.horse.leather", 0.5F, 1.0F);
            --p_111207_1_.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 11
Project: RuneCraftery   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase)
{
    if (par3EntityLivingBase instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)par3EntityLivingBase;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            --par1ItemStack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 12
Project: BetterNutritionMod   File: ItemSaddle.java   View Source Code Vote up 6 votes
/**
 * Returns true if the item can be used on the given entity, e.g. shears on sheep.
 */
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase)
{
    if (par3EntityLivingBase instanceof EntityPig)
    {
        EntityPig entitypig = (EntityPig)par3EntityLivingBase;

        if (!entitypig.getSaddled() && !entitypig.isChild())
        {
            entitypig.setSaddled(true);
            --par1ItemStack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
Example 13
Project: DecompiledMinecraft   File: LayerSaddle.java   View Source Code Vote up 5 votes
public void doRenderLayer(EntityPig entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.getSaddled())
    {
        this.pigRenderer.bindTexture(TEXTURE);
        this.pigModel.setModelAttributes(this.pigRenderer.getMainModel());
        this.pigModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    }
}
 
Example 14
Project: BaseClient   File: LayerSaddle.java   View Source Code Vote up 5 votes
public void doRenderLayer(EntityPig entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.getSaddled())
    {
        this.pigRenderer.bindTexture(TEXTURE);
        this.pigModel.setModelAttributes(this.pigRenderer.getMainModel());
        this.pigModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    }
}
 
Example 15
Project: BaseClient   File: LayerSaddle.java   View Source Code Vote up 5 votes
public void doRenderLayer(EntityPig entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.getSaddled())
    {
        this.pigRenderer.bindTexture(TEXTURE);
        this.pigModel.setModelAttributes(this.pigRenderer.getMainModel());
        this.pigModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    }
}
 
Example 16
Project: Backmemed   File: LayerSaddle.java   View Source Code Vote up 5 votes
public void doRenderLayer(EntityPig entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.getSaddled())
    {
        this.pigRenderer.bindTexture(TEXTURE);
        this.pigModel.setModelAttributes(this.pigRenderer.getMainModel());
        this.pigModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
 
Example 17
Project: CustomWorldGen   File: LayerSaddle.java   View Source Code Vote up 5 votes
public void doRenderLayer(EntityPig entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.getSaddled())
    {
        this.pigRenderer.bindTexture(TEXTURE);
        this.pigModel.setModelAttributes(this.pigRenderer.getMainModel());
        this.pigModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
 
Example 18
Project: Resilience-Client-Source   File: RenderPig.java   View Source Code Vote up 5 votes
/**
 * Queries whether should render the specified pass or not.
 */
protected int shouldRenderPass(EntityPig par1EntityPig, int par2, float par3)
{
    if (par2 == 0 && par1EntityPig.getSaddled())
    {
        this.bindTexture(saddledPigTextures);
        return 1;
    }
    else
    {
        return -1;
    }
}
 
Example 19
Project: ExpandedRailsMod   File: LayerSaddle.java   View Source Code Vote up 5 votes
public void doRenderLayer(EntityPig entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.getSaddled())
    {
        this.pigRenderer.bindTexture(TEXTURE);
        this.pigModel.setModelAttributes(this.pigRenderer.getMainModel());
        this.pigModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
 
Example 20
Project: Cauldron   File: RenderPig.java   View Source Code Vote up 5 votes
protected int shouldRenderPass(EntityPig p_77032_1_, int p_77032_2_, float p_77032_3_)
{
    if (p_77032_2_ == 0 && p_77032_1_.getSaddled())
    {
        this.bindTexture(saddledPigTextures);
        return 1;
    }
    else
    {
        return -1;
    }
}
 
Example 21
Project: Cauldron   File: RenderPig.java   View Source Code Vote up 5 votes
protected int shouldRenderPass(EntityPig p_77032_1_, int p_77032_2_, float p_77032_3_)
{
    if (p_77032_2_ == 0 && p_77032_1_.getSaddled())
    {
        this.bindTexture(saddledPigTextures);
        return 1;
    }
    else
    {
        return -1;
    }
}
 
Example 22
Project: RuneCraftery   File: RenderPig.java   View Source Code Vote up 5 votes
protected int renderSaddledPig(EntityPig par1EntityPig, int par2, float par3)
{
    if (par2 == 0 && par1EntityPig.getSaddled())
    {
        this.bindTexture(saddledPigTextures);
        return 1;
    }
    else
    {
        return -1;
    }
}
 
Example 23
Project: BetterNutritionMod   File: RenderPig.java   View Source Code Vote up 5 votes
protected int renderSaddledPig(EntityPig par1EntityPig, int par2, float par3)
{
    if (par2 == 0 && par1EntityPig.getSaddled())
    {
        this.bindTexture(saddledPigTextures);
        return 1;
    }
    else
    {
        return -1;
    }
}