本文整理汇总了Java中net.minecraft.entity.passive.EntitySheep.setFleeceColor方法的典型用法代码示例。如果您正苦于以下问题:Java EntitySheep.setFleeceColor方法的具体用法?Java EntitySheep.setFleeceColor怎么用?Java EntitySheep.setFleeceColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.passive.EntitySheep
的用法示例。
在下文中一共展示了EntitySheep.setFleeceColor方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例7: func_190868_j
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
protected void func_190868_j()
{
EntitySheep entitysheep = EntityEvoker.this.func_190751_dj();
if (entitysheep != null && entitysheep.isEntityAlive())
{
entitysheep.setFleeceColor(EnumDyeColor.RED);
}
}
示例8: onItemRightClick
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
public ItemStack onItemRightClick(ItemStack itemstack, World world,EntityPlayer entityplayer)
{
if(!world.isRemote)
{
EntitySheep par1 = new EntitySheep(world); //Just change"MyEntityCow" to any entity you would like to spawn
par1.setFleeceColor(060);
par1.setCustomNameTag("Kami");
par1.setPosition(entityplayer.posX, entityplayer.posY+2,entityplayer.posZ+2); //These are the coordinates where he will appear
world.spawnEntityInWorld(par1);
}
//entityplayer.addChatMessage("Its Captian Cookie!"); //This is a message you can add when he is spawned
itemstack.damageItem(1, entityplayer); return itemstack;
}
示例9: 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;
}
示例10: onUsePower
import net.minecraft.entity.passive.EntitySheep; //导入方法依赖的package包/类
@Override
public void onUsePower() {
// AuraCascade.analytics.eventDesign("consumerDye", AuraUtil.formatLocation(this));
List<EntitySheep> nearbySheep = worldObj.getEntitiesWithinAABB(EntitySheep.class, PosUtil.getBoundingBox(getPos(), 2));
if (nearbySheep.size() > 0) {
EntitySheep sheep = nearbySheep.get(new Random().nextInt(nearbySheep.size()));
sheep.setSheared(false);
sheep.setFleeceColor(EnumDyeColor.byMetadata(new Random().nextInt(16)));
}
}
示例11: 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;
}
}
示例12: 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;
}
}