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


Java MineTweakerMC类代码示例

本文整理汇总了Java中minetweaker.api.minecraft.MineTweakerMC的典型用法代码示例。如果您正苦于以下问题:Java MineTweakerMC类的具体用法?Java MineTweakerMC怎么用?Java MineTweakerMC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MineTweakerMC类属于minetweaker.api.minecraft包,在下文中一共展示了MineTweakerMC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ageFluid

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的package包/类
@ZenMethod
public static void ageFluid(ILiquidStack outputFS, ILiquidStack inputFS, int minTechLevel, boolean sealed, int sealtime)
{		
	FluidStack inputFluid = MineTweakerMC.getLiquidStack(inputFS);
	FluidStack outputFluid = MineTweakerMC.getLiquidStack(outputFS);
	
	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
		MineTweakerAPI.apply(new addAgedFluidAction(inputFluid, outputFluid, sealtime, sealed, minTechLevel));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:18,代码来源:Barrel.java

示例2: addFluidCombination

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的package包/类
@ZenMethod
public static void addFluidCombination(ILiquidStack outputFluid, ILiquidStack fluidInBarrel, ILiquidStack inputFluid)
{
	FluidStack barrelContents = MineTweakerMC.getLiquidStack(fluidInBarrel);
	FluidStack inputfluid = MineTweakerMC.getLiquidStack(inputFluid);
	FluidStack outputfluid = MineTweakerMC.getLiquidStack(outputFluid);
	
	if(barrelContents == null || barrelContents.getFluid() == null)
		MineTweakerAPI.logError("Missing Barrel Contents");
	else if(barrelContents.amount <= 0)
		MineTweakerAPI.logError("Barrel Contents must contain more than 0 mb of fluid");
	else if(inputfluid == null || inputfluid.getFluid() == null)
		MineTweakerAPI.logError("Missing Input Fluid");
	else if(inputfluid.amount <= 0)
		MineTweakerAPI.logError("Input Fluid must contain more than 0 mb of fluid");
	else if(outputfluid == null || outputfluid.getFluid() == null)
		MineTweakerAPI.logError("Missing Input Fluid");
	else if(outputfluid.amount <= 0)
		MineTweakerAPI.logError("Output Fluid must contain more than 0 mb of fluid");
	else		
		MineTweakerAPI.apply(new addFluidCombinationAction(barrelContents, inputfluid, outputfluid));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:23,代码来源:Barrel.java

示例3: removeFluidCombination

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的package包/类
@ZenMethod
public static void removeFluidCombination(ILiquidStack outputFluid, ILiquidStack fluidInBarrel, ILiquidStack inputFluid)
{
	FluidStack barrelContents = MineTweakerMC.getLiquidStack(fluidInBarrel);
	FluidStack inputfluid = MineTweakerMC.getLiquidStack(inputFluid);
	FluidStack outputfluid = MineTweakerMC.getLiquidStack(outputFluid);
	
	if(barrelContents == null || barrelContents.getFluid() == null)
		MineTweakerAPI.logError("Missing Barrel Contents");
	else if(barrelContents.amount <= 0)
		MineTweakerAPI.logError("Barrel Contents must contain more than 0 mb of fluid");
	else if(inputfluid == null || inputfluid.getFluid() == null)
		MineTweakerAPI.logError("Missing Input Fluid");
	else if(inputfluid.amount <= 0)
		MineTweakerAPI.logError("Input Fluid must contain more than 0 mb of fluid");
	else if(outputfluid == null || outputfluid.getFluid() == null)
		MineTweakerAPI.logError("Missing Input Fluid");
	else if(outputfluid.amount <= 0)
		MineTweakerAPI.logError("Output Fluid must contain more than 0 mb of fluid");
	else	
		MineTweakerAPI.apply(new removeFluidCombinationAction(barrelContents, inputfluid, outputfluid));
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:23,代码来源:Barrel.java

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: set

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的package包/类
@ZenMethod
public static void set(final IItemStack stack, final int compostValue, final int scrapValue, final boolean ignoreRecipe, final boolean scrubFromOutput, final boolean blockFromScrapping) {
	
	if(!MineTweakerUtil.checkNotNull(stack, "stack cannot be null"))
		return;
	
	if(!MineTweakerUtil.checkArgument(compostValue >=0 && compostValue < 3, "compostValue must be in range 0-2"))
		return;
	
	if(!MineTweakerUtil.checkArgument(scrapValue >= 0 && scrapValue < 4, "scrapValue must be in range 0-3"))
		return;
	
	final CompostIngredient cv = CompostIngredient.values()[compostValue];
	final ScrapValue sv = ScrapValue.values()[scrapValue];
	final ItemStack item = MineTweakerMC.getItemStack(stack);
	final ItemData data = ItemRegistry.get(item);
	data.value = sv;
	data.compostValue = cv;
	data.ignoreRecipe = ignoreRecipe;
	data.scrubFromOutput = scrubFromOutput;
	data.isBlockedFromScrapping = blockFromScrapping;
	ItemRegistry.set(data);
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:24,代码来源:ItemDataRegistry.java

示例9: add

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的package包/类
@ZenMethod
public static void add(final IItemStack item, final int min, final int max, final int weight) {
	
	if (!MineTweakerUtil.checkNotNull(item, "item cannot be null"))
		return;

	if (!MineTweakerUtil.checkArgument(min >= 0, "min value must be greater than 0"))
		return;

	if (!MineTweakerUtil.checkArgument(max >= min, "max value must be greater or equal to min value"))
		return;

	if (!MineTweakerUtil.checkArgument(weight > 0, "weight value must be greater than 0"))
		return;

	final ItemStack stack = MineTweakerMC.getItemStack(item);
	PileOfRubble.addRubbleDrop(stack, min, max, weight);
}
 
开发者ID:OreCruncher,项目名称:ThermalRecycling,代码行数:19,代码来源:RubblePileDataRegistry.java

示例10: 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

示例11: addArgument

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的package包/类
private void addArgument(Object recipeArg) {
    if (recipeArg instanceof ILiquidStack) {
        extendBySingle(MineTweakerMC.getLiquidStack((ILiquidStack) recipeArg), recipesData);
    } else if (recipeArg instanceof ILiquidStack[]) {
        extendBySingle(MineTweakerMC.getLiquidStacks((ILiquidStack[]) recipeArg), recipesData);
    } else if (recipeArg instanceof IItemStack) {
        extendBySingle(MineTweakerMC.getItemStack((IItemStack) recipeArg), recipesData);
    } else if (recipeArg instanceof IItemStack[]) {
        extendBySingle(MineTweakerMC.getItemStacks((IItemStack[]) recipeArg), recipesData);
    } else if (recipeArg instanceof IIngredient) {
        extendByMultiple(getItemStacks((IIngredient) recipeArg), recipesData);
    } else if (recipeArg instanceof IIngredient[]) {
        extendByMultiple(getItemStackArrays((IIngredient[]) recipeArg), recipesData);
    } else {
        extendBySingle(recipeArg, recipesData);
    }
}
 
开发者ID:GTNewHorizons,项目名称:Minetweaker-Gregtech-5-Addon,代码行数:18,代码来源:AddMultipleRecipeAction.java

示例12: getItemStacks

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的package包/类
private List<ItemStack> getItemStacks(IIngredient ingredientArg) {
    List<IItemStack> items = ingredientArg.getItems();
    if (items == null) {
        throw new AnyIngredientException();
    }
    if (items.size() == 0) {
        throw new EmptyIngredientException(ingredientArg);
    }
    List<ItemStack> itemStackList = Arrays.asList(MineTweakerMC.getItemStacks(items));
    int amount = ingredientArg.getAmount();
    if (amount < 0) {
        throw new RuntimeException("Negative amount for ingredient " + ingredientArg);
    }
    for (ItemStack stack : itemStackList) {
        if (amount > stack.getMaxStackSize()) {
            throw new OutOfStackSizeException(ingredientArg, amount);
        }
        stack.stackSize = amount;
    }
    return itemStackList;
}
 
开发者ID:GTNewHorizons,项目名称:Minetweaker-Gregtech-5-Addon,代码行数:22,代码来源:AddMultipleRecipeAction.java

示例13: 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

示例14: convertIngredients

import minetweaker.api.minecraft.MineTweakerMC; //导入依赖的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;
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:26,代码来源:AdvancedCraftingTweaker.java

示例15: 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


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