本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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()); */
}
示例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");
}