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


Java EntityPig.getSaddled方法代碼示例

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


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

示例1: itemInteractionForEntity

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
/**
 * 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;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:ItemSaddle.java

示例2: itemInteractionForEntity

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
/**
 * 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;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:ItemSaddle.java

示例3: itemInteractionForEntity

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
/**
 * 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;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:24,代碼來源:ItemSaddle.java

示例4: itemInteractionForEntity

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
/**
 * 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;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:24,代碼來源:ItemSaddle.java

示例5: itemInteractionForEntity

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:21,代碼來源:ItemSaddle.java

示例6: itemInteractionForEntity

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
/**
 * 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;
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:23,代碼來源:ItemSaddle.java

示例7: doRenderLayer

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
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);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:10,代碼來源:LayerSaddle.java

示例8: doRenderLayer

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
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);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:10,代碼來源:LayerSaddle.java

示例9: shouldRenderPass

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
/**
 * 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;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:16,代碼來源:RenderPig.java

示例10: shouldRenderPass

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:13,代碼來源:RenderPig.java

示例11: renderSaddledPig

import net.minecraft.entity.passive.EntityPig; //導入方法依賴的package包/類
protected int renderSaddledPig(EntityPig par1EntityPig, int par2, float par3)
{
    if (par2 == 0 && par1EntityPig.getSaddled())
    {
        this.bindTexture(saddledPigTextures);
        return 1;
    }
    else
    {
        return -1;
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:13,代碼來源:RenderPig.java


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