当前位置: 首页>>代码示例>>Java>>正文


Java EntitySheep.getSheared方法代码示例

本文整理汇总了Java中net.minecraft.entity.passive.EntitySheep.getSheared方法的典型用法代码示例。如果您正苦于以下问题:Java EntitySheep.getSheared方法的具体用法?Java EntitySheep.getSheared怎么用?Java EntitySheep.getSheared使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.passive.EntitySheep的用法示例。


在下文中一共展示了EntitySheep.getSheared方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getSheep

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public ArrayList getSheep( final World world ) {
	final List list = world.getEntitiesWithinAABB( EntitySheep.class, fairy.boundingBox.expand( 5D, 5D, 5D ) );

	if ( list.size() < 1 ) {
		return null;
	}

	final ArrayList list2 = new ArrayList();

	for ( int i = 0; i < list.size(); i++ ) {
		final EntitySheep entity1 = (EntitySheep) list.get( i );

		final int fleeingTick = ReflectionHelper.getPrivateValue(EntityCreature.class, entity1, MCP_FLEEINGTICK);
		if ( fairy.canEntityBeSeen( entity1 ) && entity1.getHealth() > 0 && entity1.getEntityToAttack() == null
				&& fleeingTick <= 0 && entity1.getGrowingAge() >= 0 && !entity1.getSheared() ) {
			list2.add( entity1 );
		}
	}

	if ( list2.size() <= 0 ) {
		return null;
	} else {
		return list2;
	}
}
 
开发者ID:allaryin,项目名称:FairyFactions,代码行数:26,代码来源:FairyJob.java

示例5: onShearingUse

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
private boolean onShearingUse( final ItemStack stack, final World world ) {
	final ArrayList sheep = getSheep( world );
	triedShearing = true;

	if ( sheep == null ) {
		return false;
	}
	for (Object one_sheep_raw : sheep) {
		EntitySheep one_sheep = (EntitySheep) one_sheep_raw;
		if (!one_sheep.getSheared()) {
			fairy.armSwing( !fairy.didSwing );
			fairy.setTempItem( stack.getItem() );
			stack.damageItem( 1, fairy );
			fairy.attackTime = 30;

			one_sheep.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, one_sheep.getFleeceColor()), 0.0F);
			one_sheep.setSheared(true);
			break; // shear one at a time... looks better.
		}
	}

	return false;
}
 
开发者ID:allaryin,项目名称:FairyFactions,代码行数:24,代码来源:FairyJob.java

示例6: activate

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public boolean activate(EntityPlayer player, EnumFacing side) {
    if (worldObj.isRemote) return true;
    if (sheep != null) return false;
    Coord at = new Coord(this);
    AxisAlignedBB box = SpaceUtil.newBox(at.add3(-7), at.add3(+7));
    for (Entity ent : worldObj.getEntitiesWithinAABBExcludingEntity(player, box)) {
        if (ent instanceof EntitySheep) {
            EntitySheep s = (EntitySheep) ent;
            if (s.isChild()) continue;
            if (s.getSheared()) continue;
            if (powered) {
                new Notice(this, "").withStyle(Style.DRAWITEM).withItem(new ItemStack(Blocks.redstone_torch)).sendTo(player);
                return false;
            }
            if (s.getLeashedToEntity() == player) {
                sheep.clearLeashed(true, !PlayerUtil.isPlayerCreative(player));
            }
            sheep = s;
            return true;
        }
    }
    return false;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:25,代码来源:TileEntityLightningRod.java

示例7: 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

示例8: onEntityCollidedWithBlock

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
{
	if(entity instanceof EntitySheep)
	{
		EntitySheep sheep = (EntitySheep)entity;

		if(sheep.getSheared() == false && sheep.worldObj.isRemote == false)
		{ 
			//this part is the same as how EntitySheep goes
			sheep.setSheared(true);
               int i = 1 + sheep.worldObj.rand.nextInt(3);

               for (int j = 0; j < i; ++j)
               {
                   EntityItem entityitem = sheep.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, sheep.getFleeceColor().getMetadata()), 1.0F);
                   entityitem.motionY += (double)(sheep.worldObj.rand.nextFloat() * 0.05F);
                   entityitem.motionX += (double)((sheep.worldObj.rand.nextFloat() - sheep.worldObj.rand.nextFloat()) * 0.1F);
                   entityitem.motionZ += (double)((sheep.worldObj.rand.nextFloat() - sheep.worldObj.rand.nextFloat()) * 0.1F);
               }
               
               sheep.playSound("mob.sheep.shear", 1.0F, 1.0F);
		} 
	}
}
 
开发者ID:PrinceOfAmber,项目名称:SamsPowerups,代码行数:26,代码来源:BlockShearWool.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)
        {
            entitysheep.setFleeceColor(i);
            --p_111207_1_.stackSize;
        }

        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:21,代码来源:ItemDye.java

示例10: 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

示例11: doRenderLayer

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void doRenderLayer(EntitySheep 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.getSheared() && !entitylivingbaseIn.isInvisible())
    {
        this.sheepRenderer.bindTexture(TEXTURE);

        if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag()))
        {
            int i1 = 25;
            int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId();
            int j = EnumDyeColor.values().length;
            int k = i % j;
            int l = (i + 1) % j;
            float f = ((float)(entitylivingbaseIn.ticksExisted % 25) + partialTicks) / 25.0F;
            float[] afloat1 = EntitySheep.func_175513_a(EnumDyeColor.byMetadata(k));
            float[] afloat2 = EntitySheep.func_175513_a(EnumDyeColor.byMetadata(l));
            GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f);
        }
        else
        {
            float[] afloat = EntitySheep.func_175513_a(entitylivingbaseIn.getFleeceColor());
            GlStateManager.color(afloat[0], afloat[1], afloat[2]);
        }

        this.sheepModel.setModelAttributes(this.sheepRenderer.getMainModel());
        this.sheepModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks);
        this.sheepModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:30,代码来源:LayerSheepWool.java

示例12: doRenderLayer

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public void doRenderLayer(EntitySheep entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (!entitylivingbaseIn.getSheared() && !entitylivingbaseIn.isInvisible())
    {
        this.sheepRenderer.bindTexture(TEXTURE);

        if (entitylivingbaseIn.hasCustomName() && "jeb_".equals(entitylivingbaseIn.getCustomNameTag()))
        {
            int i1 = 25;
            int i = entitylivingbaseIn.ticksExisted / 25 + entitylivingbaseIn.getEntityId();
            int j = EnumDyeColor.values().length;
            int k = i % j;
            int l = (i + 1) % j;
            float f = ((float)(entitylivingbaseIn.ticksExisted % 25) + partialTicks) / 25.0F;
            float[] afloat1 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(k));
            float[] afloat2 = EntitySheep.getDyeRgb(EnumDyeColor.byMetadata(l));
            GlStateManager.color(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f);
        }
        else
        {
            float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getFleeceColor());
            GlStateManager.color(afloat[0], afloat[1], afloat[2]);
        }

        this.sheepModel.setModelAttributes(this.sheepRenderer.getMainModel());
        this.sheepModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
        this.sheepModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:LayerSheepWool.java

示例13: 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

示例14: shouldRenderPass

import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
/**
 * Queries whether should render the specified pass or not.
 */
protected int shouldRenderPass(EntitySheep shoop, int pass, float yeah)
{
    if (pass == 0 && !shoop.getSheared())
    {
        this.bindTexture(woolTexture);

        return 1;
    }
    else
    {
        return -1;
    }
}
 
开发者ID:SpitefulFox,项目名称:RidiculousWorld,代码行数:17,代码来源:RenderCandySheep.java

示例15: 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


注:本文中的net.minecraft.entity.passive.EntitySheep.getSheared方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。