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


Java OreDictionary.getOreID方法代码示例

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


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

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

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

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

示例4: postInit

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
@EventHandler
  public void postInit(FMLPostInitializationEvent event) {
String[] dyes =
		{
				"Black",
				"Red",
				"Green",
				"Brown",
				"Blue",
				"Purple",
				"Cyan",
				"LightGray",
				"Gray",
				"Pink",
				"Lime",
				"Yellow",
				"LightBlue",
				"Magenta",
				"Orange",
				"White"
		};

for (int i = 0; i < 16; i++) {
	dyeOreIds[i] = OreDictionary.getOreID("dye" + dyes[15 - i]);
}

/* GameRegistry.addShapedRecipe(new ItemStack(sock), "w w", "w w", 'w', Blocks.wool);
GameRegistry.addRecipe(new RecipeSockColor()); */
  }
 
开发者ID:asiekierka,项目名称:PonySocks2,代码行数:30,代码来源:PonySocks.java

示例5: SlotItemSpecific

import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
SlotItemSpecific(IItemHandler handler, String oreDictKeyAllowed, int index, int x, int y) {
    super(handler, index, x, y);
    oreDictEntry = OreDictionary.getOreID(oreDictKeyAllowed);
    dye = oreDictKeyAllowed.equals("dye");
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:SlotItemSpecific.java


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