本文整理汇总了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"));
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
}
}
}
示例9: getOreName
import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
@Override
public String getOreName(OreDictionaryEntry entry) {
return OreDictionary.getOreName(entry.getId());
}