本文整理汇总了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)];
}