本文整理汇总了Java中WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb类的典型用法代码示例。如果您正苦于以下问题:Java IBloodOrb类的具体用法?Java IBloodOrb怎么用?Java IBloodOrb使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBloodOrb类属于WayofTime.alchemicalWizardry.api.items.interfaces包,在下文中一共展示了IBloodOrb类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResult
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
public static ItemStack getResult(ItemStack[] recipe, ItemStack bloodOrb)
{
if (bloodOrb == null)
{
return null;
}
if (!(bloodOrb.getItem() instanceof IBloodOrb))
{
return null;
}
int bloodOrbLevel = ((IBloodOrb) bloodOrb.getItem()).getOrbLevel();
for (AlchemyRecipe ar : recipes)
{
if (ar.doesRecipeMatch(recipe, bloodOrbLevel))
{
return (ar.getResult());
}
}
return null;
}
示例2: getAmountNeeded
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
public static int getAmountNeeded(ItemStack[] recipe, ItemStack bloodOrb)
{
if (bloodOrb == null)
{
return 0;
}
if (!(bloodOrb.getItem() instanceof IBloodOrb))
{
return 0;
}
int bloodOrbLevel = ((IBloodOrb) bloodOrb.getItem()).getOrbLevel();
for (AlchemyRecipe ar : recipes)
{
if (ar.doesRecipeMatch(recipe, bloodOrbLevel))
{
return (ar.getAmountNeeded());
}
}
return 0;
}
示例3: ShapelessBloodOrbRecipe
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe) {
output = result.copy();
for (Object in : recipe) {
if (in instanceof ItemStack) {
input.add(((ItemStack) in).copy());
} else if (in instanceof IBloodOrb) { //If the item is an instanceof IBloodOrb then save the level of the orb
input.add((Integer)(((IBloodOrb)in).getOrbLevel()));
} else if (in instanceof Item) {
input.add(new ItemStack((Item) in));
} else if (in instanceof Block) {
input.add(new ItemStack((Block) in));
} else if (in instanceof String) {
input.add(OreDictionary.getOres((String) in));
} else {
String ret = "Invalid shapeless ore recipe: ";
for (Object tmp : recipe) {
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
}
示例4: ShapelessBloodOrbRecipe
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe)
{
output = result.copy();
for (Object in : recipe)
{
if (in instanceof ItemStack)
{
input.add(((ItemStack) in).copy());
} else if (in instanceof IBloodOrb)
{ //If the item is an instanceof IBloodOrb then save the level of the orb
input.add((Integer) (((IBloodOrb) in).getOrbLevel()));
} else if (in instanceof Item)
{
input.add(new ItemStack((Item) in));
} else if (in instanceof Block)
{
input.add(new ItemStack((Block) in));
} else if (in instanceof String)
{
input.add(OreDictionary.getOres((String) in));
} else
{
String ret = "Invalid shapeless ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
}
示例5: ShapelessBloodOrbRecipe
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe)
{
output = result.copy();
for (Object in : recipe)
{
if (in instanceof IBloodOrb)
{ //If the item is an instanceof IBloodOrb then save the level of the orb
input.add((Integer) (((IBloodOrb) in).getOrbLevel()));
}
else if (in instanceof ItemStack)
{
if (((ItemStack)in).getItem() instanceof IBloodOrb)
{
input.add((Integer) (((IBloodOrb) ((ItemStack)in).getItem()).getOrbLevel()));
}
else input.add(((ItemStack) in).copy());
} else if (in instanceof Item)
{
input.add(new ItemStack((Item) in));
} else if (in instanceof Block)
{
input.add(new ItemStack((Block) in));
} else if (in instanceof String)
{
input.add(OreDictionary.getOres((String) in));
} else
{
String ret = "Invalid shapeless ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
}
示例6: ShapelessBloodOrbRecipe
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
public ShapelessBloodOrbRecipe(ItemStack result, Object... recipe)
{
output = result.copy();
for (Object in : recipe)
{
if (in instanceof IBloodOrb)
{ //If the item is an instanceof IBloodOrb then save the level of the orb
input.add(((IBloodOrb) in).getOrbLevel());
}
else if (in instanceof ItemStack)
{
if (((ItemStack)in).getItem() instanceof IBloodOrb)
{
input.add(((IBloodOrb) ((ItemStack)in).getItem()).getOrbLevel());
}
else input.add(((ItemStack) in).copy());
} else if (in instanceof Item)
{
input.add(new ItemStack((Item) in));
} else if (in instanceof Block)
{
input.add(new ItemStack((Block) in));
} else if (in instanceof String)
{
input.add(OreDictionary.getOres((String) in));
} else
{
String ret = "Invalid shapeless ore recipe: ";
for (Object tmp : recipe)
{
ret += tmp + ", ";
}
ret += output;
throw new RuntimeException(ret);
}
}
}
示例7: matches
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean matches(InventoryCrafting var1, World world)
{
ArrayList<Object> required = new ArrayList<Object>(input);
for (int x = 0; x < var1.getSizeInventory(); x++)
{
ItemStack slot = var1.getStackInSlot(x);
if (slot != null)
{
boolean inRecipe = false;
Iterator<Object> req = required.iterator();
while (req.hasNext())
{
boolean match = false;
Object next = req.next();
//If target is integer, then we should be check the blood orb value of the item instead
if (next instanceof Integer)
{
if (slot != null && slot.getItem() instanceof IBloodOrb)
{
IBloodOrb orb = (IBloodOrb) slot.getItem();
if (orb.getOrbLevel() < (Integer) next)
{
return false;
}
} else return false;
} else if (next instanceof ItemStack)
{
match = OreDictionary.itemMatches((ItemStack) next, slot, false);
} else if (next instanceof ArrayList)
{
Iterator<ItemStack> itr = ((ArrayList<ItemStack>) next).iterator();
while (itr.hasNext() && !match)
{
match = OreDictionary.itemMatches(itr.next(), slot, false);
}
}
if (match)
{
inRecipe = true;
required.remove(next);
break;
}
}
if (!inRecipe)
{
return false;
}
}
}
return required.isEmpty();
}
示例8: checkMatch
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror)
{
for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++)
{
for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++)
{
int subX = x - startX;
int subY = y - startY;
Object target = null;
if (subX >= 0 && subY >= 0 && subX < width && subY < height)
{
if (mirror)
{
target = input[width - subX - 1 + subY * width];
} else
{
target = input[subX + subY * width];
}
}
ItemStack slot = inv.getStackInRowAndColumn(x, y);
//If target is integer, then we should be check the blood orb value of the item instead
if (target instanceof Integer)
{
if (slot != null && slot.getItem() instanceof IBloodOrb)
{
IBloodOrb orb = (IBloodOrb) slot.getItem();
if (orb.getOrbLevel() < (Integer) target)
{
return false;
}
} else return false;
} else if (target instanceof ItemStack)
{
if (!OreDictionary.itemMatches((ItemStack) target, slot, false))
{
return false;
}
} else if (target instanceof ArrayList)
{
boolean matched = false;
Iterator<ItemStack> itr = ((ArrayList<ItemStack>) target).iterator();
while (itr.hasNext() && !matched)
{
matched = OreDictionary.itemMatches(itr.next(), slot, false);
}
if (!matched)
{
return false;
}
} else if (target == null && slot != null)
{
return false;
}
}
}
return true;
}
示例9: matches
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean matches(InventoryCrafting var1, World world) {
ArrayList<Object> required = new ArrayList<Object>(input);
for (int x = 0; x < var1.getSizeInventory(); x++) {
ItemStack slot = var1.getStackInSlot(x);
if (slot != null) {
boolean inRecipe = false;
Iterator<Object> req = required.iterator();
while (req.hasNext()) {
boolean match = false;
Object next = req.next();
//If target is integer, then we should be check the blood orb value of the item instead
if(next instanceof Integer) {
if(slot != null && slot.getItem() instanceof IBloodOrb) {
IBloodOrb orb = (IBloodOrb) slot.getItem();
if(orb.getOrbLevel() < (Integer)next) {
return false;
}
} else return false;
} else if (next instanceof ItemStack) {
match = OreDictionary.itemMatches((ItemStack) next, slot, false);
} else if (next instanceof ArrayList) {
Iterator<ItemStack> itr = ((ArrayList<ItemStack>) next).iterator();
while (itr.hasNext() && !match) {
match = OreDictionary.itemMatches(itr.next(), slot, false);
}
}
if (match) {
inRecipe = true;
required.remove(next);
break;
}
}
if (!inRecipe) {
return false;
}
}
}
return required.isEmpty();
}
示例10: checkMatch
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private boolean checkMatch(InventoryCrafting inv, int startX, int startY, boolean mirror) {
for (int x = 0; x < MAX_CRAFT_GRID_WIDTH; x++) {
for (int y = 0; y < MAX_CRAFT_GRID_HEIGHT; y++) {
int subX = x - startX;
int subY = y - startY;
Object target = null;
if (subX >= 0 && subY >= 0 && subX < width && subY < height) {
if (mirror) {
target = input[width - subX - 1 + subY * width];
} else {
target = input[subX + subY * width];
}
}
ItemStack slot = inv.getStackInRowAndColumn(x, y);
//If target is integer, then we should be check the blood orb value of the item instead
if(target instanceof Integer) {
if(slot != null && slot.getItem() instanceof IBloodOrb) {
IBloodOrb orb = (IBloodOrb) slot.getItem();
if(orb.getOrbLevel() < (Integer)target) {
return false;
}
} else return false;
} else if (target instanceof ItemStack) {
if (!OreDictionary.itemMatches((ItemStack) target, slot, false)) {
return false;
}
} else if (target instanceof ArrayList) {
boolean matched = false;
Iterator<ItemStack> itr = ((ArrayList<ItemStack>) target).iterator();
while (itr.hasNext() && !matched) {
matched = OreDictionary.itemMatches(itr.next(), slot, false);
}
if (!matched) {
return false;
}
} else if (target == null && slot != null) {
return false;
}
}
}
return true;
}
示例11: matches
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public boolean matches(InventoryCrafting var1, World world)
{
ArrayList<Object> required = new ArrayList<Object>(input);
for (int x = 0; x < var1.getSizeInventory(); x++)
{
ItemStack slot = var1.getStackInSlot(x);
if (slot != null)
{
boolean inRecipe = false;
Iterator<Object> req = required.iterator();
while (req.hasNext())
{
boolean match = false;
Object next = req.next();
//If target is integer, then we should be check the blood orb value of the item instead
if (next instanceof Integer)
{
if (slot != null && slot.getItem() instanceof IBloodOrb)
{
IBloodOrb orb = (IBloodOrb) slot.getItem();
if (orb.getOrbLevel() < (Integer) next)
{
return false;
}
} else return false;
match = true;
} else if (next instanceof ItemStack)
{
match = OreDictionary.itemMatches((ItemStack) next, slot, false);
} else if (next instanceof ArrayList)
{
Iterator<ItemStack> itr = ((ArrayList<ItemStack>) next).iterator();
while (itr.hasNext() && !match)
{
match = OreDictionary.itemMatches(itr.next(), slot, false);
}
}
if (match)
{
inRecipe = true;
required.remove(next);
break;
}
}
if (!inRecipe)
{
return false;
}
}
}
return required.isEmpty();
}