當前位置: 首頁>>代碼示例>>Java>>正文


Java OreDictionary.getOreIDs方法代碼示例

本文整理匯總了Java中net.minecraftforge.oredict.OreDictionary.getOreIDs方法的典型用法代碼示例。如果您正苦於以下問題:Java OreDictionary.getOreIDs方法的具體用法?Java OreDictionary.getOreIDs怎麽用?Java OreDictionary.getOreIDs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.oredict.OreDictionary的用法示例。


在下文中一共展示了OreDictionary.getOreIDs方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isItemValid

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
@Override
public boolean isItemValid(ItemStack stack) {
	if(!stack.isEmpty())
	{
		boolean flag = false;
       	int[] ids = OreDictionary.getOreIDs(stack);
       	for(int id: ids)
       		if(OreDictionary.getOreName(id).contains("food")){
       			flag = true;
       			break;
       		}
		if(stack.getItem() instanceof ItemFood || flag)
		{
			if(!FurnaceRecipes.instance().getSmeltingResult(stack).isEmpty())
			{
				return true;
			}
		}
	}
	return false;
}
 
開發者ID:ArtixAllMighty,項目名稱:ExSartagine,代碼行數:22,代碼來源:SlotPanInput.java

示例2: matchStack

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
private boolean matchStack(ItemStack stack, Set<Integer> ores, ItemStack s) {
    if (ItemStackTools.isValid(s)) {
        if (s.getItem() == stack.getItem()) {
            return true;
        }
        if (!ores.isEmpty()) {
            int[] iDs = OreDictionary.getOreIDs(s);
            for (int d : iDs) {
                if (ores.contains(d)) {
                    return true;
                }
            }
        }
    }
    return false;
}
 
開發者ID:McJty,項目名稱:interactionwheel,代碼行數:17,代碼來源:DumpSimilarInventoryAction.java

示例3: isItemValid

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
/**
 * Check if the stack is a valid item for this slot. Always true beside for
 * the armor slots.
 */
@Override
public boolean isItemValid(@Nonnull ItemStack stack) {
    if (itemAllowed != null) {
        Item item = stack.isEmpty() ? null : stack.getItem();
        return item == itemAllowed;
    } else {
        int[] ids = OreDictionary.getOreIDs(stack);
        for (int id : ids) {
            if (id == oreDictEntry) return true;
            if (dye && TileEntityPlasticMixer.getDyeIndex(stack) >= 0) return true;
        }
        return false;
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:19,代碼來源:SlotItemSpecific.java

示例4: getOreNames

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public static List<String> getOreNames(ItemStack stack)
{
	List<String> res = new ArrayList<>();
	for (int id : OreDictionary.getOreIDs(stack))
	{
		res.add(OreDictionary.getOreName(id));
	}
	return res;
}
 
開發者ID:einsteinsci,項目名稱:BetterBeginningsReborn,代碼行數:10,代碼來源:RegistryUtil.java

示例5: getDyeIndex

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public static int getDyeIndex(ItemStack stack) {
    int[] ids = OreDictionary.getOreIDs(stack);
    for (int id : ids) {
        String name = OreDictionary.getOreName(id);
        for (int i = 0; i < DYES.length; i++) {
            if (DYES[i].equals(name)) return i;
        }
    }
    return -1;
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:11,代碼來源:TileEntityPlasticMixer.java

示例6: matchesOreDict

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public static boolean matchesOreDict(ItemStack stack, String oreDictName)
{
    if(stack.isEmpty()) return false;
    int checkid = OreDictionary.getOreID(oreDictName);
    for (int id:OreDictionary.getOreIDs(stack)) {
        if(id == checkid) return true;
    }
    return false;
}
 
開發者ID:DaedalusGame,項目名稱:Soot,代碼行數:10,代碼來源:ItemUtil.java

示例7: isStackOreDict

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public static boolean isStackOreDict(ItemStack stack, String string) {
    if (stack.isEmpty()) return false;
    int id = OreDictionary.getOreID(string);
    for (int i : OreDictionary.getOreIDs(stack)) {
        if (i == id) return true;
    }
    return false;
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:9,代碼來源:ItemStackUtils.java

示例8: isOre

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public static boolean isOre(ItemStack stack) {
    if (stack.isEmpty()) return false;
    for (int i : OreDictionary.getOreIDs(stack)) {
        if (OreDictionary.getOreName(i).startsWith("ore")) return true;
    }
    return false;
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:8,代碼來源:ItemStackUtils.java

示例9: matches

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
@Override
public boolean matches(ItemStack stackGiven) 
{
	for(int id : OreDictionary.getOreIDs(stackGiven))
	{
		if(oreDictionaryEntry.equals(OreDictionary.getOreName(id))) return true;
	}
	return false;
}
 
開發者ID:einsteinsci,項目名稱:BetterBeginningsReborn,代碼行數:10,代碼來源:OreRecipeElement.java

示例10: isBlockOreDict

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public static boolean isBlockOreDict(World world, BlockPos pos, String ore) {
    IBlockState state = world.getBlockState(pos);
    Item item = Item.getItemFromBlock(state.getBlock());
    if (!item.equals(Items.AIR)) {
        ItemStack stack = new ItemStack(item);
        int id = OreDictionary.getOreID(ore);
        for (int i : OreDictionary.getOreIDs(stack)) {
            if (i == id) return true;
        }
    }
    return false;
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:13,代碼來源:BlockUtils.java

示例11: hasColor

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
@Override
protected boolean hasColor(ItemStack stack) {
	int[] ids = OreDictionary.getOreIDs(stack);
	for (int id : ids) {
		if (ArrayUtils.contains(PonySocks.dyeOreIds, id)) {
			return true;
		}
	}

	return false;
}
 
開發者ID:asiekierka,項目名稱:PonySocks2,代碼行數:12,代碼來源:RecipeSockPaint.java

示例12: getOreEntries

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
@Override
public List<OreDictionaryEntry> getOreEntries(ItemStack itemStack) {
    int[] ids = OreDictionary.getOreIDs(CraftItemStack.asNMSCopy(itemStack));

    ImmutableList.Builder<OreDictionaryEntry> builder = ImmutableList.builder();
    for (int id : ids) {
        builder.add(OreDictionaryEntry.valueOf(id));
    }

    return builder.build();
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:12,代碼來源:OreDictionaryInterface.java

示例13: cacheOre

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
private static void cacheOre(Block b, int meta) {
	List key = Arrays.asList(b, meta);
	if (!name_cache.containsKey(key) && b != Blocks.stone && b != Blocks.air && b != Blocks.dirt && b != Blocks.grass && b != Blocks.gravel) {
		String name = null;
		float value = 1f;
		int[] ids = OreDictionary.getOreIDs(new ItemStack(b, 1, meta));

		if (ids.length > 0) {
			String dict_name = OreDictionary.getOreName(ids[0]);

			if (dict_name.length() > 3 && dict_name.substring(0, 3).equals("ore")) {
				dict_name = dict_name.substring(3);
				if (dict_name.length() > 4 && dict_name.substring(0, 4).equals("Poor")) {
					dict_name = dict_name.substring(4);
					value = (1f/9f);
				}
			} else if (dict_name.length() > 8 && dict_name.substring(0, 8).equals("denseore")) {
				dict_name = dict_name.substring(8);
				value = 3f;
			}

			String norm = normalizeName(dict_name);

			if (hasNugget(norm)) {
				Prospecting.logger.info("Parsed name: " + norm);
				Prospecting.logger.info("Amount: " + value);
				name_cache.put(key, norm);
				value_cache.put(key, value);
			}
		}
	}
}
 
開發者ID:azacock,項目名稱:Prospecting,代碼行數:33,代碼來源:OreDictCache.java

示例14: getColor

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
@Override
protected int getColor(ItemStack stack) {
	int[] ids = OreDictionary.getOreIDs(stack);
	for (int id : ids) {
		for (int i = 0; i < 16; i++) {
			if (id == PonySocks.dyeOreIds[i]) {
				return fromFloats(EntitySheep.getDyeRgb(EnumDyeColor.byDyeDamage(i)));
			}
		}
	}

	throw new RuntimeException("Shouldn't happen!");
}
 
開發者ID:asiekierka,項目名稱:PonySocks2,代碼行數:14,代碼來源:RecipeSockPaint.java

示例15: findFromOreDict

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public List<MaterialDefinition> findFromOreDict(World world, ItemStack stack) {
    List<String> names = new ArrayList<>();
    for(int index : OreDictionary.getOreIDs(stack)) {
        names.add(OreDictionary.getOreName(index));
    }

    return RandoresWorldData.getAll(RandoresWorldData.getId(world)).stream().filter(def -> !names.contains(def.getMaterial().getType().getDictName() + def.getName())).collect(Collectors.toList());
}
 
開發者ID:Randores,項目名稱:Randores2,代碼行數:9,代碼來源:RandoresFromOreDictConvert.java


注:本文中的net.minecraftforge.oredict.OreDictionary.getOreIDs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。