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


Java OreDictionary.getOreName方法代码示例

本文整理汇总了Java中net.minecraftforge.oredict.OreDictionary.getOreName方法的典型用法代码示例。如果您正苦于以下问题:Java OreDictionary.getOreName方法的具体用法?Java OreDictionary.getOreName怎么用?Java OreDictionary.getOreName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.oredict.OreDictionary的用法示例。


在下文中一共展示了OreDictionary.getOreName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
/**
 * Method invoked by FML before any other mods are loaded.
 */
public static void initialize()
{
    FMLLog.info("MinecraftForge v%s Initialized", ForgeVersion.getVersion());

    OreDictionary.getOreName(0);

    UsernameCache.load();
    // Load before all the mods, so MC owns the MC fluids
    FluidRegistry.validateFluidRegistry();
    ForgeHooks.initTools();

    //For all the normal CrashReport classes to be defined. We're in MC's classloader so this should all be fine
    new CrashReport("ThisIsFake", new Exception("Not real"));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:MinecraftForge.java

示例2: 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

示例3: getDyeColor

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static Optional<EnumDyeColor> getDyeColor(ItemStack stack) {
	for (int oreId : OreDictionary.getOreIDs(stack)) {
		String name = OreDictionary.getOreName(oreId);
		if (name.startsWith("blockWool")) {
			name = name.substring(9, name.length());
			return Optional.of(EnumDyeColor.valueOf(name));
		}
	}

	return Optional.empty();
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:12,代码来源:TileCauldron.java

示例4: isOre

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
private boolean isOre(ItemStack stack) {
    int[] ids = OreDictionary.getOreIDs(stack);
    for (int id : ids) {
        String oreName = OreDictionary.getOreName(id);
        if (oreName != null && oreName.startsWith("ore")) {
            return true;
        }
    }
    return false;
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:11,代码来源:DumpOresAction.java

示例5: isBlock

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
private boolean isBlock(ItemStack stack) {
    int[] ids = OreDictionary.getOreIDs(stack);
    for (int id : ids) {
        String oreName = OreDictionary.getOreName(id);
        if (oreName != null && blocks.contains(oreName)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:11,代码来源:DumpBlocksAction.java

示例6: matches

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public boolean matches(ItemStack stack) {
    int[] ids = OreDictionary.getOreIDs(stack);
    for(int id : ids) {
        String name = OreDictionary.getOreName(id);
        if(matches(name)) {
            return true;
        }
    }
    return !stack.isEmpty() && OreDictionary.itemMatches(stack, input, false);
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:11,代码来源:RecipeMachineBase.java

示例7: convertEdibles

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
private ItemStack convertEdibles(ItemStack stack) {
	
	int[] oreIDs = OreDictionary.getOreIDs(stack);
	if (oreIDs.length == 0) return stack;

	String oreName = OreDictionary.getOreName(oreIDs[0]);
	ItemStack converted = OreDictionary.getOres(oreName).get(0);
	if (converted != null)
		return new ItemStack(converted.getItem(), stack.stackSize, converted.getItemDamage());
	
	return stack;
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:13,代码来源:ItemEdibleMetal.java

示例8: 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

示例9: getOreName

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
@Override
public String getOreName(OreDictionaryEntry entry) {
    return OreDictionary.getOreName(entry.getId());
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:5,代码来源:OreDictionaryInterface.java


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