本文整理汇总了Java中minetweaker.api.minecraft.MineTweakerMC.getItemStack方法的典型用法代码示例。如果您正苦于以下问题:Java MineTweakerMC.getItemStack方法的具体用法?Java MineTweakerMC.getItemStack怎么用?Java MineTweakerMC.getItemStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类minetweaker.api.minecraft.MineTweakerMC
的用法示例。
在下文中一共展示了MineTweakerMC.getItemStack方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addWeldRecipe
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void addWeldRecipe(IItemStack Output, IItemStack Input1, IItemStack Input2, int AnvilReq)
{
ItemStack result = MineTweakerMC.getItemStack(Output);
ItemStack input1 = MineTweakerMC.getItemStack(Input1);
ItemStack input2 = MineTweakerMC.getItemStack(Input2);
if(input1 == null || input1.getItem() == null)
MineTweakerAPI.logError("Missing first InputStack");
else if(input1 == null || input1.getItem() == null)
MineTweakerAPI.logError("Missing second InputStack");
else if(result == null || result.getItem() == null)
MineTweakerAPI.logError("Missing OutputStack");
else if(AnvilReq < 0 || AnvilReq > 7)
MineTweakerAPI.logError("Anvil type must be between 0 and 7, inclusive");
else
MineTweakerAPI.apply(new addWeldRecipeAction(result, input1, input2, AnvilReq));
}
示例2: removeWeldRecipe
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void removeWeldRecipe(IItemStack Output, IItemStack Input1, IItemStack Input2, int AnvilReq)
{
ItemStack result = MineTweakerMC.getItemStack(Output);
ItemStack input1 = MineTweakerMC.getItemStack(Input1);
ItemStack input2 = MineTweakerMC.getItemStack(Input2);
if(input1 == null || input1.getItem() == null)
MineTweakerAPI.logError("Missing first InputStack");
else if(input1 == null || input1.getItem() == null)
MineTweakerAPI.logError("Missing second InputStack");
else if(result == null || result.getItem() == null)
MineTweakerAPI.logError("Missing OutputStack");
else if(AnvilReq < 0 || AnvilReq > 6)
MineTweakerAPI.logError("Anvil type must be between 0 and 6, inclusive");
else
MineTweakerAPI.apply(new removeWeldRecipeAction(result, input1, input2, AnvilReq));
}
示例3: addRecipe
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, double heat, double specHeat)
{
ItemStack inputStack = MineTweakerMC.getItemStack(input);
ItemStack outputStack = MineTweakerMC.getItemStack(output);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else if(inputStack.getItem() instanceof ISmeltable &&
((ISmeltable)inputStack.getItem()).getMetalType(inputStack) == null)
MineTweakerAPI.logError(inputStack.getDisplayName() + " is invalid when melted.");
else if(outputStack == null || outputStack.getItem() == null)
MineTweakerAPI.logError("Missing OutputStack");
else if(heat < 0)
MineTweakerAPI.logError("Item melting point cannot be less than 0");
else if(specHeat < 0)
MineTweakerAPI.logError("Item specific heat cannot be less than 0");
else
MineTweakerAPI.apply(new addHeatingAction(outputStack, inputStack, heat, specHeat));
}
示例4: AddRecipeAction
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
public AddRecipeAction(Object input, ItemStack output1, ItemStack output2)
{
if (input instanceof IItemStack)
input = MineTweakerMC.getItemStack((IItemStack) input);
//TODO
// if (input instanceof IOreDictEntry)
if (input instanceof ILiquidStack)
{
MineTweakerAPI.logError("A liquid was passed into a grinder recipe, grinder do not use liquids when crafting, aborting!");
input = output1 = output2 = null;
}
this.input = input;
this.output1 = output1;
this.output2 = output2;
}
示例5: apply
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@Override
public void apply()
{
ItemStack inputAsStack = MineTweakerMC.getItemStack(input);
for (Iterator<OreRecipeElement> recipeIter = isPanRecipe ? CampfirePanRecipes.getSmeltingList().keySet().iterator()
: CampfireRecipes.getSmeltingList().keySet().iterator(); recipeIter.hasNext();)
{
removedORE = recipeIter.next();
if(removedORE.matches(inputAsStack))
{
recipeIter.remove();
if(isPanRecipe)
{
CampfirePanRecipes.getXPList().remove(output);
}
else
{
CampfireRecipes.getXPList().remove(output);
}
}
}
}
示例6: convertCatalysts
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的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;
}
示例7: add
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void add(IItemStack input, IItemStack output, int weight) {
if (!MineTweakerUtil.checkNotNull(input, "input cannot be null"))
return;
if (!MineTweakerUtil.checkArgument(weight > 0, "weight must be greater than 0"))
return;
final ItemStack theInput = MineTweakerMC.getItemStack(input);
final ItemStack theOutput = MineTweakerMC.getItemStack(output);
final ExtractionData data = ItemRegistry.getExtractionData(theInput);
if (data.isDefault()) {
final ItemStackWeightTable table = new ItemStackWeightTable();
table.add(new ItemStackItem(theOutput, weight));
ItemRegistry.setBlockedFromExtraction(theInput, false);
RecipeHelper.put(theInput, table);
} else {
data.getOutput().add(new ItemStackItem(theOutput, weight));
}
}
示例8: addItemFluidConversion
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void addItemFluidConversion(IItemStack outputIS, ILiquidStack outputFS, IItemStack inputIS, ILiquidStack inputFS, int minTechLevel, boolean sealed, int sealtime, boolean removesLiquid, boolean allowAnyStack)
{
ItemStack inputStack = MineTweakerMC.getItemStack(inputIS);
FluidStack inputFluid = MineTweakerMC.getLiquidStack(inputFS);
ItemStack outputStack = MineTweakerMC.getItemStack(outputIS);
FluidStack outputFluid = MineTweakerMC.getLiquidStack(outputFS);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else if(inputFluid == null || inputFluid.getFluid() == null)
MineTweakerAPI.logError("Missing InputFluid");
else if(inputFluid.amount <= 0)
MineTweakerAPI.logError("InputFluid must contain more than 0 mb of fluid");
else if(outputFluid == null || outputFluid.getFluid() == null)
MineTweakerAPI.logError("Missing OutputFluid");
else if(outputFluid.amount <= 0)
MineTweakerAPI.logError("OutputFluid must contain more than 0 mb of fluid");
else if(sealed == false && sealtime > 0)
MineTweakerAPI.logError("Sealed time must be 0 if barrel is unsealed");
else if(minTechLevel < 0)
MineTweakerAPI.logError("Tech level must be at least 0");
else if(sealtime < 0)
MineTweakerAPI.logError("Sealed time must be at least 0");
else
MineTweakerAPI.apply(new addFluidConversionAction(inputStack, inputFluid, outputStack, outputFluid, sealtime, removesLiquid, sealed, minTechLevel, allowAnyStack));
}
示例9: removeItemFluidConversion
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void removeItemFluidConversion(IItemStack inputIS, ILiquidStack inputFS)
{
ItemStack inputStack = MineTweakerMC.getItemStack(inputIS);
FluidStack inputFluid = MineTweakerMC.getLiquidStack(inputFS);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else if(inputFluid == null || inputFluid.getFluid() == null)
MineTweakerAPI.logError("Missing InputFluid");
else if(inputFluid.amount <= 0)
MineTweakerAPI.logError("InputFluid must contain more than 0 mb of fluid");
else
MineTweakerAPI.apply(new removeItemFluidConversionAction(inputStack, inputFluid));
}
示例10: addItemConversion
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void addItemConversion(IItemStack outputIS, IItemStack inputIS, ILiquidStack inputFS, int minTechLevel, boolean sealed, int sealedTime, boolean allowAnyStack)
{
ItemStack inputStack = MineTweakerMC.getItemStack(inputIS);
ItemStack outputStack = MineTweakerMC.getItemStack(outputIS);
FluidStack inputFluid = MineTweakerMC.getLiquidStack(inputFS);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else if(inputStack.stackSize < 1)
MineTweakerAPI.logError("InputStack must be at least 1 item");
else if(inputFluid == null || inputFluid.getFluid() == null)
MineTweakerAPI.logError("Missing InputFluid");
else if(inputFluid.amount <= 0)
MineTweakerAPI.logError("InputFluid must contain more than 0 mb of fluid");
else if(outputStack == null || outputStack.getItem() == null)
MineTweakerAPI.logError("Missing OutputStack");
else if(minTechLevel < 0)
MineTweakerAPI.logError("Tech level must be at least 0");
else if(sealedTime < 0)
MineTweakerAPI.logError("Sealed time must be at least 0");
else
{
inputFluid.amount = inputFluid.amount/inputStack.stackSize;
MineTweakerAPI.apply(new addItemConversionAction(inputStack, inputFluid, outputStack, sealed, sealedTime, minTechLevel, allowAnyStack));
}
}
示例11: removeItemConversion
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void removeItemConversion(IItemStack inputIS, ILiquidStack inputFS)
{
ItemStack inputStack = MineTweakerMC.getItemStack(inputIS);
FluidStack inputFluid = MineTweakerMC.getLiquidStack(inputFS);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else if(inputFluid == null || inputFluid.getFluid() == null)
MineTweakerAPI.logError("Missing InputFluid");
else if(inputFluid.amount <= 0)
MineTweakerAPI.logError("InputFluid must contain more than 0 mb of fluid");
else
MineTweakerAPI.apply(new removeItemFluidConversionAction(inputStack, inputFluid));
}
示例12: addRecipe
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack input, String resource)
{
ItemStack inputStack = MineTweakerMC.getItemStack(input);
ItemStack outputStack = MineTweakerMC.getItemStack(output);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else if(outputStack == null || outputStack.getItem() == null)
MineTweakerAPI.logError("Missing OutputStack");
else if(resource != null && resource.length() == 0)
MineTweakerAPI.logError("Missing Resource Location");
else
MineTweakerAPI.apply(new addLoomAction(outputStack, inputStack, resource));
}
示例13: removeRecipe
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void removeRecipe(IItemStack input)
{
ItemStack inputStack = MineTweakerMC.getItemStack(input);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else
MineTweakerAPI.apply(new removeLoomAction(inputStack));
}
示例14: processInputs
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
private static void processInputs(IItemStack output, String topRow, String secondRow, String thirdRow, String fourthRow, String bottomRow, int type, boolean addRecipe)
{
ItemStack outputStack = MineTweakerMC.getItemStack(output);
String[] pattern = new String[5];
if(outputStack == null || outputStack.getItem() == null)
MineTweakerAPI.logError("Missing OutputStack");
else if(topRow.length() < 2)
MineTweakerAPI.logError("Incorrect pattern for the top row");
else if(secondRow.length() < 2)
MineTweakerAPI.logError("Incorrect pattern for the second row");
else if(thirdRow.length() < 2)
MineTweakerAPI.logError("Incorrect pattern for the third row");
else if(fourthRow.length() < 2)
MineTweakerAPI.logError("Incorrect pattern for the fourth row");
else if(bottomRow.length() < 2)
MineTweakerAPI.logError("Incorrect pattern for the bottom row");
else
{
pattern[0] = topRow;
pattern[1] = secondRow;
pattern[2] = thirdRow;
pattern[3] = fourthRow;
pattern[4] = bottomRow;
if(addRecipe)
MineTweakerAPI.apply(new addKnappingAction(outputStack, pattern, type));
else
MineTweakerAPI.apply(new removeKnappingAction(outputStack, pattern, type));
}
}
示例15: addRecipe
import minetweaker.api.minecraft.MineTweakerMC; //导入方法依赖的package包/类
@ZenMethod
public static void addRecipe(IItemStack output, IItemStack input)
{
ItemStack inputStack = MineTweakerMC.getItemStack(input);
ItemStack outputStack = MineTweakerMC.getItemStack(output);
if(inputStack == null || inputStack.getItem() == null)
MineTweakerAPI.logError("Missing InputStack");
else if(outputStack == null || outputStack.getItem() == null)
MineTweakerAPI.logError("Missing OutputStack");
else
MineTweakerAPI.apply(new addQuernAction(outputStack, inputStack));
}