本文整理汇总了Java中minetweaker.api.oredict.IOreDictEntry类的典型用法代码示例。如果您正苦于以下问题:Java IOreDictEntry类的具体用法?Java IOreDictEntry怎么用?Java IOreDictEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOreDictEntry类属于minetweaker.api.oredict包,在下文中一共展示了IOreDictEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGreggedItem
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@ZenGetter("greggedItem")
public static IItemStack getGreggedItem(IOreDictEntry oreDictEntry) {
List<IItemStack> matchedItems = new ArrayList<IItemStack>();
for (IItemStack item : oreDictEntry.getItems()) {
//TODO: how to determine GT's items better?
if (item.getDefinition().getId().startsWith(MOD_ID)) {
matchedItems.add(item);
}
}
if (matchedItems.size() > 1) {
MineTweakerAPI.logError("An ore dictionary <ore:" + oreDictEntry.getName() + "> has multiple items owned by GregTech");
} else if (matchedItems.size() == 0) {
MineTweakerAPI.logError("An ore dictionary <ore:" + oreDictEntry.getName() + "> has not items owned by GregTech");
return null;
}
return matchedItems.get(0); //there can be only one
}
示例2: convertIngredients
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[][] convertIngredients(IIngredient[][] inputs)
{
OreRecipeElement[][] convertedIngredients = new OreRecipeElement[3][3];
for(int row = 0; row < 3; row++)
{
for(int col = 0; col < 3; col++)
{
IIngredient ingredient = inputs[row][col];
if(ingredient instanceof IOreDictEntry)
{
convertedIngredients[row][col] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), ingredient.getAmount());
}
else if(ingredient instanceof IngredientOreDict)
{
convertedIngredients[row][col] = new OreRecipeElement((String) ingredient.getInternal(), ingredient.getAmount());
}
else if(ingredient instanceof IItemStack)
{
convertedIngredients[row][col] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
}
}
}
return convertedIngredients;
}
示例3: convertCatalysts
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[] convertCatalysts(IIngredient[] catalysts)
{
OreRecipeElement[] convertedCatalysts = new OreRecipeElement[catalysts.length];
for(int i = 0; i < catalysts.length; i++)
{
IIngredient ingredient = catalysts[i];
if(ingredient instanceof IOreDictEntry)
{
convertedCatalysts[i] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), ingredient.getAmount());
}
else if(ingredient instanceof IItemStack)
{
convertedCatalysts[i] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
}
else if (ingredient instanceof IngredientStack)
{
ItemStack[] validItems = MineTweakerMC.getItemStacks(ingredient.getItems());
for(ItemStack stack : validItems)
{
stack.stackSize = ingredient.getAmount();
}
convertedCatalysts[i] = new OreRecipeElement(validItems, ingredient.getAmount());
}
}
return convertedCatalysts;
}
示例4: convertShapedIngredients
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[][] convertShapedIngredients(IIngredient[][] inputs)
{
OreRecipeElement[][] convertedIngredients = new OreRecipeElement[3][3];
for(int row = 0; row < 3; row++)
{
for(int col = 0; col < 3; col++)
{
IIngredient ingredient = inputs[row][col];
if(ingredient instanceof IOreDictEntry)
{
convertedIngredients[row][col] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), 1);
}
else if(ingredient instanceof IItemStack)
{
convertedIngredients[row][col] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
}
}
}
return convertedIngredients;
}
示例5: convertShapelessIngredients
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[] convertShapelessIngredients(IIngredient[] inputs)
{
OreRecipeElement[] convertedIngredients = new OreRecipeElement[inputs.length];
for(int i = 0; i < inputs.length; i++)
{
IIngredient ingredient = inputs[i];
if(ingredient instanceof IOreDictEntry)
{
convertedIngredients[i] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), 1);
}
else if(ingredient instanceof IItemStack)
{
convertedIngredients[i] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
}
}
return convertedIngredients;
}
示例6: apply
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public void apply()
{
if(input instanceof IOreDictEntry)
{
inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
KilnRecipes.getSmeltingList().put(inputAsORE, output);
KilnRecipes.getXPList().put(output, xp);
}
else
{
inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
KilnRecipes.getSmeltingList().put(inputAsORE, output);
KilnRecipes.getXPList().put(output, xp);
}
}
示例7: undo
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public void undo()
{
if(input instanceof IOreDictEntry)
{
inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
KilnRecipes.getSmeltingList().put(inputAsORE, output);
KilnRecipes.getXPList().put(output, xp);
}
else
{
inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
KilnRecipes.getSmeltingList().put(inputAsORE, output);
KilnRecipes.getXPList().put(output, xp);
}
}
示例8: toObject
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
public static Object toObject(IIngredient iStack) {
if (iStack == null)
return null;
else {
if (iStack instanceof IOreDictEntry) {
return toString((IOreDictEntry) iStack);
} else if (iStack instanceof IItemStack) {
return toStack((IItemStack) iStack);
} else if (iStack instanceof MatchTypeEntry) {
return (MatchType) iStack.getInternal();
} else if (iStack instanceof MaterialEntry) {
return (MaterialInfo) iStack.getInternal();
} else
return null;
}
}
示例9: addRecipe
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@ZenMethod
public static void addRecipe(IItemStack output, IOreDictEntry oredictentry, double heat, double specHeat)
{
if (oredictentry != null && oredictentry.getAmount() > 0)
{
List<IItemStack> oreEntries = oredictentry.getItems();
for(int i = 0; i < oreEntries.size(); i++)
{
addRecipe(output, oreEntries.get(i), heat, specHeat);
}
}
}
示例10: toObject
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
public static Object toObject(IIngredient iStack, boolean trim) {
if (iStack == null) return null;
else {
if (iStack instanceof IOreDictEntry) {
return toString((IOreDictEntry) iStack);
} else if (iStack instanceof IItemStack) {
return toStack((IItemStack) iStack, trim);
} else return null;
}
}
示例11: toObject
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
public static Object toObject(IIngredient iStack) {
if (iStack == null)
return null;
if (iStack instanceof IOreDictEntry)
return ((IOreDictEntry) iStack).getName();
if (iStack instanceof IItemStack)
return toStack((IItemStack) iStack);
if (iStack instanceof IngredientStack) {
IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
return toObject(ingr);
}
return null;
}
示例12: describe
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public String describe()
{
String inputIDString = (input instanceof IOreDictEntry) ? ((IOreDictEntry) input).getName() : MineTweakerMC.getItemStack(input).getDisplayName();
return "Adding recipe " + inputIDString
+ " -> " + output.getDisplayName() + " * " + output.stackSize + " to Smelter";
}
示例13: describeUndo
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public String describeUndo()
{
String inputIDString = (input instanceof IOreDictEntry) ? ((IOreDictEntry) input).getName() : MineTweakerMC.getItemStack(input).getDisplayName();
return "Removing recipe " + inputIDString
+ " -> " + output.getDisplayName() + " * " + output.stackSize + " from Smelter";
}
示例14: apply
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public void apply()
{
if(isPanRecipe)
{
if(input instanceof IOreDictEntry)
{
inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
CampfirePanRecipes.getSmeltingList().put(inputAsORE, output);
CampfirePanRecipes.getXPList().put(output, xp);
}
else if(input instanceof IIngredient)
{
inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
CampfirePanRecipes.getSmeltingList().put(inputAsORE, output);
CampfirePanRecipes.getXPList().put(output, xp);
}
}
else
{
if(input instanceof IOreDictEntry)
{
inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
CampfireRecipes.getSmeltingList().put(inputAsORE, output);
CampfireRecipes.getXPList().put(output, xp);
}
else if(input instanceof IIngredient)
{
inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
CampfireRecipes.getSmeltingList().put(inputAsORE, output);
CampfireRecipes.getXPList().put(output, xp);
}
}
}
示例15: describe
import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public String describe()
{
String inputIDString = (input instanceof IOreDictEntry) ? ((IOreDictEntry) input).getName() : MineTweakerMC.getItemStack(input).getDisplayName();
return "Adding recipe " + inputIDString
+ " -> " + output.getDisplayName() + " * " + output.stackSize + " to Campfire";
}