当前位置: 首页>>代码示例>>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;未经允许,请勿转载。