本文整理匯總了Java中net.minecraft.block.BlockColored.getBlockFromDye方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockColored.getBlockFromDye方法的具體用法?Java BlockColored.getBlockFromDye怎麽用?Java BlockColored.getBlockFromDye使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.block.BlockColored
的用法示例。
在下文中一共展示了BlockColored.getBlockFromDye方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: itemInteractionForEntity
import net.minecraft.block.BlockColored; //導入方法依賴的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;
}
}
示例2: getUnlocalizedName
import net.minecraft.block.BlockColored; //導入方法依賴的package包/類
public String getUnlocalizedName(ItemStack itemstack) {
return getUnlocalizedName().substring(5)
+ " "
+ ItemDye.dyeColorNames[BlockColored.getBlockFromDye(itemstack
.getItemDamage())];
}
示例3: getUnlocalizedName
import net.minecraft.block.BlockColored; //導入方法依賴的package包/類
/**
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
* different names based on their damage or NBT.
*/
public String getUnlocalizedName(ItemStack par1ItemStack)
{
return super.getUnlocalizedName() + "." + ItemDye.dyeColorNames[BlockColored.getBlockFromDye(par1ItemStack.getItemDamage())];
}