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


Java MineTweakerMC.getItemStack方法代码示例

本文整理汇总了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));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:19,代码来源:Anvil.java

示例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));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:19,代码来源:Anvil.java

示例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));
   }
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:21,代码来源:ItemHeat.java

示例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;
		}
 
开发者ID:gigabit101,项目名称:PrimitiveCraft,代码行数:19,代码来源:MTGrinder.java

示例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);
			}
		}
	}
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:23,代码来源:CampfireTweaker.java

示例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;
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:27,代码来源:AdvancedCraftingTweaker.java

示例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));
	}
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:23,代码来源:ExtractionDataRegistry.java

示例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));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:28,代码来源:Barrel.java

示例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));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:16,代码来源:Barrel.java

示例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));
	}
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:28,代码来源:Barrel.java

示例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));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:16,代码来源:Barrel.java

示例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));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:16,代码来源:Loom.java

示例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));
   }
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:11,代码来源:Loom.java

示例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));
	}
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:33,代码来源:Knapping.java

示例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));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:14,代码来源:Quern.java


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