Class ExplosionCraftingRecipeImpl
java.lang.Object
me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
me.desht.pneumaticcraft.api.crafting.recipe.ExplosionCraftingRecipe
me.desht.pneumaticcraft.common.recipes.machine.ExplosionCraftingRecipeImpl
- All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<PneumaticCraftRecipe.DummyIInventory>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
PneumaticCraftRecipe.DummyIInventory -
Constructor Summary
ConstructorsConstructorDescriptionExplosionCraftingRecipeImpl(net.minecraft.resources.ResourceLocation id, net.minecraft.world.item.crafting.Ingredient input, int lossRate, net.minecraft.world.item.ItemStack... outputs) -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of items which will be taken from the input to create the output item.getGroup()net.minecraft.world.item.crafting.IngredientgetInput()Get the input ingredient for this recipe.intGet the recipe loss rate, as a percentage.List<net.minecraft.world.item.ItemStack>Get a list of the output item(s).net.minecraft.world.item.crafting.RecipeSerializer<?>net.minecraft.world.item.ItemStacknet.minecraft.world.item.crafting.RecipeType<?>getType()booleanmatches(net.minecraft.world.item.ItemStack stack) Check if the given itemstack matches this recipe.static net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>tryToCraft(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack) voidwrite(net.minecraft.network.FriendlyByteBuf buffer) Writes this recipe to a PacketBuffer.Methods inherited from class me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
assemble, canCraftInDimensions, getId, getResultItem, isSpecial, matchesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.item.crafting.Recipe
getIngredients, getRemainingItems, isIncomplete
-
Constructor Details
-
ExplosionCraftingRecipeImpl
public ExplosionCraftingRecipeImpl(net.minecraft.resources.ResourceLocation id, net.minecraft.world.item.crafting.Ingredient input, int lossRate, net.minecraft.world.item.ItemStack... outputs)
-
-
Method Details
-
getInput
public net.minecraft.world.item.crafting.Ingredient getInput()Description copied from class:ExplosionCraftingRecipeGet the input ingredient for this recipe.- Specified by:
getInputin classExplosionCraftingRecipe- Returns:
- the input ingredient
-
getAmount
public int getAmount()Description copied from class:ExplosionCraftingRecipeGet the number of items which will be taken from the input to create the output item.This should be the number of items in any itemstack returned from
getInput().getMatchedStacks(); for basicIngredientingredients, this will always be 1, but custom ingredient subclasses could return a large number.- Specified by:
getAmountin classExplosionCraftingRecipe- Returns:
- the number of items
-
getOutputs
Description copied from class:ExplosionCraftingRecipeGet a list of the output item(s).- Specified by:
getOutputsin classExplosionCraftingRecipe- Returns:
- the outputs
-
getLossRate
public int getLossRate()Description copied from class:ExplosionCraftingRecipeGet the recipe loss rate, as a percentage.- Specified by:
getLossRatein classExplosionCraftingRecipe- Returns:
- the loss rate
-
matches
public boolean matches(net.minecraft.world.item.ItemStack stack) Description copied from class:ExplosionCraftingRecipeCheck if the given itemstack matches this recipe. The stack's item should match, and additionally there should be at leastExplosionCraftingRecipe.getAmount()items in the stack.- Specified by:
matchesin classExplosionCraftingRecipe- Parameters:
stack- the itemstack to check- Returns:
- true if this itemstack matches this recipe, false otherwise
-
tryToCraft
public static net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> tryToCraft(net.minecraft.world.level.Level world, net.minecraft.world.item.ItemStack stack) -
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) Description copied from class:PneumaticCraftRecipeWrites this recipe to a PacketBuffer.- Specified by:
writein classPneumaticCraftRecipe- Parameters:
buffer- The buffer to write to.
-
getSerializer
public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer() -
getType
public net.minecraft.world.item.crafting.RecipeType<?> getType() -
getGroup
-
getToastSymbol
public net.minecraft.world.item.ItemStack getToastSymbol()
-