mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-26 23:03:12 +00:00
52 lines
1.4 KiB
Java
52 lines
1.4 KiB
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
package minetweaker.mc1102.recipes;
|
|
|
|
import minetweaker.api.recipes.ShapelessRecipe;
|
|
import net.minecraft.inventory.InventoryCrafting;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.item.crafting.IRecipe;
|
|
import net.minecraft.world.World;
|
|
|
|
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
|
|
|
|
/**
|
|
* @author Stan
|
|
*/
|
|
public class ShapelessRecipeAdvanced implements IRecipe{
|
|
private final ShapelessRecipe recipe;
|
|
|
|
public ShapelessRecipeAdvanced(ShapelessRecipe recipe){
|
|
this.recipe = recipe;
|
|
}
|
|
|
|
@Override
|
|
public boolean matches(InventoryCrafting inventory, World world){
|
|
return recipe.matches(MCCraftingInventory.get(inventory));
|
|
}
|
|
|
|
@Override
|
|
public ItemStack getCraftingResult(InventoryCrafting inventory){
|
|
return getItemStack(recipe.getCraftingResult(MCCraftingInventory.get(inventory))).copy();
|
|
}
|
|
|
|
@Override
|
|
public int getRecipeSize(){
|
|
return recipe.getSize();
|
|
}
|
|
|
|
@Override
|
|
public ItemStack getRecipeOutput(){
|
|
return getItemStack(recipe.getOutput());
|
|
}
|
|
|
|
@Override
|
|
public ItemStack[] getRemainingItems(InventoryCrafting inv){
|
|
return new ItemStack[]{};
|
|
}
|
|
}
|