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


Java EntitySheep.getFleeceColor方法代碼示例

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


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

示例1: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的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 EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)target;
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor)
        {
            entitysheep.setFleeceColor(enumdyecolor);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:ItemDye.java

示例2: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的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 EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)target;
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor)
        {
            entitysheep.setFleeceColor(enumdyecolor);
            stack.func_190918_g(1);
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:ItemDye.java

示例3: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的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 EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)target;
        EnumDyeColor enumdyecolor = EnumDyeColor.byDyeDamage(stack.getMetadata());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != enumdyecolor)
        {
            entitysheep.setFleeceColor(enumdyecolor);
            --stack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:24,代碼來源:ItemDye.java

示例4: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的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 EntitySheep)
    {
        EntitySheep var4 = (EntitySheep)par3EntityLivingBase;
        int var5 = BlockColored.func_150032_b(par1ItemStack.getItemDamage());

        if (!var4.getSheared() && var4.getFleeceColor() != var5)
        {
            var4.setFleeceColor(var5);
            --par1ItemStack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:24,代碼來源:ItemDye.java

示例5: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_)
{
    if (p_111207_3_ instanceof EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)p_111207_3_;
        int i = BlockColored.func_150032_b(p_111207_1_.getItemDamage());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != i)
        {
            entitysheep.setFleeceColor(i);
            --p_111207_1_.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:21,代碼來源:ItemDye.java

示例6: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的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 EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)par3EntityLivingBase;
        int i = BlockColored.getBlockFromDye(par1ItemStack.getItemDamage());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != i)
        {
            entitysheep.setFleeceColor(i);
            --par1ItemStack.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:24,代碼來源:ItemDye.java

示例7: shouldRenderPass

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
/**
 * Queries whether should render the specified pass or not.
 */
protected int shouldRenderPass(EntitySheep par1EntitySheep, int par2, float par3)
{
    if (par2 == 0 && !par1EntitySheep.getSheared())
    {
        this.bindTexture(sheepTextures);
        int var4 = par1EntitySheep.getFleeceColor();
        GL11.glColor3f(EntitySheep.fleeceColorTable[var4][0], EntitySheep.fleeceColorTable[var4][1], EntitySheep.fleeceColorTable[var4][2]);
        return 1;
    }
    else
    {
        return -1;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:18,代碼來源:RenderSheep.java

示例8: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) {

	if (entity instanceof EntitySheep) {
		EntitySheep sheep = (EntitySheep) entity;
		if (!sheep.getSheared() && sheep.getFleeceColor() != 10) {
			sheep.setFleeceColor(10);
			--stack.stackSize;
		}
		return true;
	}
	return false;
}
 
開發者ID:Quetzi,項目名稱:BluePower,代碼行數:14,代碼來源:ItemIndigoDye.java

示例9: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_)
{
    if (p_111207_3_ instanceof EntitySheep)
    {
        EntitySheep entitysheep = (EntitySheep)p_111207_3_;
        int i = BlockColored.func_150032_b(p_111207_1_.getItemDamage());

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != i)
        {
            // CraftBukkit start
            byte bColor = (byte) i;
            SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByData(bColor));
            entitysheep.worldObj.getServer().getPluginManager().callEvent(event);

            if (event.isCancelled())
            {
                return false;
            }

            i = (byte) event.getColor().getWoolData();
            // CraftBukkit end
            entitysheep.setFleeceColor(i);
            --p_111207_1_.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:33,代碼來源:ItemDye.java

示例10: shouldRenderPass

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
protected int shouldRenderPass(EntitySheep p_77032_1_, int p_77032_2_, float p_77032_3_)
{
    if (p_77032_2_ == 0 && !p_77032_1_.getSheared())
    {
        this.bindTexture(sheepTextures);

        if (p_77032_1_.hasCustomNameTag() && "jeb_".equals(p_77032_1_.getCustomNameTag()))
        {
            boolean flag = true;
            int k = p_77032_1_.ticksExisted / 25 + p_77032_1_.getEntityId();
            int l = k % EntitySheep.fleeceColorTable.length;
            int i1 = (k + 1) % EntitySheep.fleeceColorTable.length;
            float f1 = ((float)(p_77032_1_.ticksExisted % 25) + p_77032_3_) / 25.0F;
            GL11.glColor3f(EntitySheep.fleeceColorTable[l][0] * (1.0F - f1) + EntitySheep.fleeceColorTable[i1][0] * f1, EntitySheep.fleeceColorTable[l][1] * (1.0F - f1) + EntitySheep.fleeceColorTable[i1][1] * f1, EntitySheep.fleeceColorTable[l][2] * (1.0F - f1) + EntitySheep.fleeceColorTable[i1][2] * f1);
        }
        else
        {
            int j = p_77032_1_.getFleeceColor();
            GL11.glColor3f(EntitySheep.fleeceColorTable[j][0], EntitySheep.fleeceColorTable[j][1], EntitySheep.fleeceColorTable[j][2]);
        }

        return 1;
    }
    else
    {
        return -1;
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:29,代碼來源:RenderSheep.java

示例11: itemInteractionForEntity

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase yEntityLivingBase) {
    if (yEntityLivingBase instanceof EntitySheep && stack.getItemDamage() == 1) {
        EntitySheep entitysheep = (EntitySheep) yEntityLivingBase;

        if (!entitysheep.getSheared() && entitysheep.getFleeceColor() != 15) {
            entitysheep.setFleeceColor(15);
            --stack.stackSize;
        }

        return true;
    } else {
        return false;
    }
}
 
開發者ID:SpitefulFox,項目名稱:ForbiddenMagic,代碼行數:16,代碼來源:ItemResource.java

示例12: setWoolColorAndRender

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
protected int setWoolColorAndRender(EntitySheep par1EntitySheep, int par2, float par3)
{
    if (par2 == 0 && !par1EntitySheep.getSheared())
    {
        this.bindTexture(sheepTextures);
        float f1 = 1.0F;
        int j = par1EntitySheep.getFleeceColor();
        GL11.glColor3f(f1 * EntitySheep.fleeceColorTable[j][0], f1 * EntitySheep.fleeceColorTable[j][1], f1 * EntitySheep.fleeceColorTable[j][2]);
        return 1;
    }
    else
    {
        return -1;
    }
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:16,代碼來源:RenderSheep.java

示例13: apply

import net.minecraft.entity.passive.EntitySheep; //導入方法依賴的package包/類
public boolean apply(EntitySheep p_apply_1_)
{
    return p_apply_1_.getFleeceColor() == EnumDyeColor.BLUE;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:5,代碼來源:EntityEvoker.java


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