當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。