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


Java ItemDye.field_150923_a方法代码示例

本文整理汇总了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");
    }
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:24,代码来源:TileSortron.java

示例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);
}
 
开发者ID:jaquadro,项目名称:GardenCollection,代码行数:21,代码来源:ItemLantern.java

示例3: getUnlocalizedName

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
public String getUnlocalizedName(ItemStack itemstack) {
	return getUnlocalizedName() + "."
			+ ItemDye.field_150923_a[15 - itemstack.getItemDamage()];
}
 
开发者ID:tyrope,项目名称:fencing,代码行数:6,代码来源:PaintedFenceBlockItem.java

示例4: getUnlocalizedName

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
public String getUnlocalizedName(ItemStack par1ItemStack)
{
    return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[15-par1ItemStack.getItemDamage()];
}
 
开发者ID:Quetzi,项目名称:BluePower,代码行数:6,代码来源:ItemCanvasBag.java

示例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())];
}
 
开发者ID:jaquadro,项目名称:ForgeMods,代码行数:6,代码来源:ItemToggleButton.java

示例6: getUnlocalizedName

import net.minecraft.item.ItemDye; //导入方法依赖的package包/类
@Override
public String getUnlocalizedName (ItemStack itemStack) {
    return super.getUnlocalizedName() + "." + ItemDye.field_150923_a[itemStack.getItemDamage() & 15];
}
 
开发者ID:jaquadro,项目名称:ForgeMods,代码行数:5,代码来源:ItemLargePotColored.java

示例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)];
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:5,代码来源:ItemProgrammingPuzzle.java


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