本文整理匯總了Java中net.minecraft.item.ItemDye.field_150923_a方法的典型用法代碼示例。如果您正苦於以下問題:Java ItemDye.field_150923_a方法的具體用法?Java ItemDye.field_150923_a怎麽用?Java ItemDye.field_150923_a使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.item.ItemDye
的用法示例。
在下文中一共展示了ItemDye.field_150923_a方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: parseColorFromObject
import net.minecraft.item.ItemDye; //導入方法依賴的package包/類
public static byte parseColorFromObject(Object argument) throws Exception {
if (argument instanceof Double) {
byte color = ((Double) argument).byteValue();
if (color >= -1 && color < 16) {
return color;
}
throw new IllegalArgumentException("Color values should be greater than or equal to -1 and smaller than 16");
} else if (argument instanceof String) {
String input = (String) argument;
if (input.isEmpty()) {
return -1;
}
for (byte color = 0; color < ItemDye.field_150923_a.length; color++) {
String colorName = ItemDye.field_150923_a[color];
if (colorName.equals(input)) {
return color;
}
}
throw new IllegalArgumentException("Given String is not a color");
}
throw new IllegalArgumentException("No expected argument was given");
}
示例2: addInformation
import net.minecraft.item.ItemDye; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void addInformation (ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
if (ModBlocks.lantern.isGlass(itemStack)) {
String glassName = Blocks.stained_glass.getUnlocalizedName() + "." + ItemDye.field_150923_a[BlockColored.func_150032_b(itemStack.getItemDamage())];
list.add(StatCollector.translateToLocal(glassName + ".name"));
}
String contents = StatCollector.translateToLocal(ModBlocks.makeName("lanternSource")) + ": " + EnumChatFormatting.YELLOW;
String source = ModBlocks.lantern.getLightSource(itemStack);
ILanternSource lanternSource = (source != null) ? Api.instance.registries().lanternSources().getLanternSource(source) : null;
if (lanternSource != null)
contents += StatCollector.translateToLocal(lanternSource.getLanguageKey(itemStack.getItemDamage()));
else
contents += StatCollector.translateToLocal(ModBlocks.makeName("lanternSource.none"));
list.add(contents);
}
示例3: getUnlocalizedName
import net.minecraft.item.ItemDye; //導入方法依賴的package包/類
@Override
public String getUnlocalizedName(ItemStack itemstack) {
return getUnlocalizedName() + "."
+ ItemDye.field_150923_a[15 - itemstack.getItemDamage()];
}
示例4: getUnlocalizedName
import net.minecraft.item.ItemDye; //導入方法依賴的package包/類
@Override
public String getUnlocalizedName(ItemStack par1ItemStack)
{
return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[15-par1ItemStack.getItemDamage()];
}
示例5: getUnlocalizedName
import net.minecraft.item.ItemDye; //導入方法依賴的package包/類
@Override
public String getUnlocalizedName(ItemStack par1ItemStack)
{
return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[ToggleButton.getBlockFromDye(par1ItemStack.getItemDamage())];
}
示例6: getUnlocalizedName
import net.minecraft.item.ItemDye; //導入方法依賴的package包/類
@Override
public String getUnlocalizedName (ItemStack itemStack) {
return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[itemStack.getItemDamage() & 15];
}
示例7: getUnlocalizedName
import net.minecraft.item.ItemDye; //導入方法依賴的package包/類
@Override
public String getUnlocalizedName(ItemStack stack){
return super.getUnlocalizedName(stack) + "." + ItemDye.field_150923_a[MathHelper.clamp_int(stack.getItemDamage(), 0, 15)];
}