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