Class PressureDisenchantingRecipe
java.lang.Object
me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
me.desht.pneumaticcraft.api.crafting.recipe.PressureChamberRecipe
me.desht.pneumaticcraft.common.recipes.machine.PressureChamberRecipeImpl
me.desht.pneumaticcraft.common.recipes.machine.PressureDisenchantingRecipe
- All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<PneumaticCraftRecipe.DummyIInventory>
-
Nested Class Summary
Nested classes/interfaces inherited from class me.desht.pneumaticcraft.common.recipes.machine.PressureChamberRecipeImpl
PressureChamberRecipeImpl.Serializer<T extends PressureChamberRecipe>Nested classes/interfaces inherited from class me.desht.pneumaticcraft.api.crafting.recipe.PressureChamberRecipe
PressureChamberRecipe.RecipeSlot, PressureChamberRecipe.SlotCycleNested classes/interfaces inherited from class me.desht.pneumaticcraft.api.crafting.recipe.PneumaticCraftRecipe
PneumaticCraftRecipe.DummyIInventory -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack>craftRecipe(net.minecraftforge.items.IItemHandler chamberHandler, it.unimi.dsi.fastutil.ints.IntList ingredientSlots, boolean simulate) This method is called when the Pressure Chamber is ready to craft with this recipe, and will only be called whenPressureChamberRecipe.findIngredients(IItemHandler)returns a non-empty list of slot numbers, i.e.it.unimi.dsi.fastutil.ints.IntCollectionfindIngredients(net.minecraftforge.items.IItemHandler chamberHandler) When called (by the pressure chamber BE when it detects a change in the chamber contents), try to find the ingredients for this recipe in the given item handler, which represents all the items currently in the pressure chamber.List<net.minecraft.world.item.crafting.Ingredient>Get the input items for this recipe.Get the output of this recipe, without crafting it.net.minecraft.world.item.crafting.RecipeSerializer<?>Get the slots that are synchronized with each other.getTooltipKey(boolean input, String slotName) Return a translation key for a supplementary tooltip to be displayed on the ingredient or resulting item.booleanisValidInputItem(net.minecraft.world.item.ItemStack stack) Check if the given item is a valid input item for this recipe.voidwrite(net.minecraft.network.FriendlyByteBuf buffer) Writes this recipe to a PacketBuffer.Methods inherited from class me.desht.pneumaticcraft.common.recipes.machine.PressureChamberRecipeImpl
getCraftingPressure, getCraftingPressureForDisplay, getGroup, getSingleResultsForDisplay, getToastSymbol, getTypeMethods inherited from class me.desht.pneumaticcraft.api.crafting.recipe.PressureChamberRecipe
getSyncForDisplayMethods 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
-
Field Details
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
PressureDisenchantingRecipe
public PressureDisenchantingRecipe(net.minecraft.resources.ResourceLocation id)
-
-
Method Details
-
findIngredients
public it.unimi.dsi.fastutil.ints.IntCollection findIngredients(@Nonnull net.minecraftforge.items.IItemHandler chamberHandler) Description copied from class:PressureChamberRecipeWhen called (by the pressure chamber BE when it detects a change in the chamber contents), try to find the ingredients for this recipe in the given item handler, which represents all the items currently in the pressure chamber. You must return a collection of slot indices into the item handler which contain the matching ingredients; those indices will be passed promptly toPressureChamberRecipe.getCraftingPressure(IItemHandler, IntList)andPressureChamberRecipe.craftRecipe(IItemHandler, IntList, boolean)by the pressure chamber.Do not cache this list across ticks, since the chamber contents are quite likely to change in the meantime.
- Overrides:
findIngredientsin classPressureChamberRecipeImpl- Parameters:
chamberHandler- what's currently in the pressure chamber- Returns:
- if this recipe is valid, a list of slots in the item handler where the ingredients can be found; otherwise, an empty list
-
craftRecipe
public net.minecraft.core.NonNullList<net.minecraft.world.item.ItemStack> craftRecipe(@Nonnull net.minecraftforge.items.IItemHandler chamberHandler, it.unimi.dsi.fastutil.ints.IntList ingredientSlots, boolean simulate) Description copied from class:PressureChamberRecipeThis method is called when the Pressure Chamber is ready to craft with this recipe, and will only be called whenPressureChamberRecipe.findIngredients(IItemHandler)returns a non-empty list of slot numbers, i.e. the necessary items are definitely in the chamber. The implementation is responsible for removing the items that have been used from thechamberHandler. The implementation must also return the list of crafted items, for the Pressure Chamber to insert into its output item handler.- Overrides:
craftRecipein classPressureChamberRecipeImpl- Parameters:
chamberHandler- items in the pressure chamber; should be modified to remove recipe input items.ingredientSlots- slots in the chamber handler where the ingredients can be found, as returned fromPressureChamberRecipe.findIngredients(IItemHandler)simulate- pass on to uses ofchamberHandler- Returns:
- the resulting items; these do not have to be copies, since the Pressure Chamber itself will insert copies of these items
-
getInputsForDisplay
Description copied from class:PressureChamberRecipeGet the input items for this recipe. This is primarily intended for recipe display purposes by JEI or any other recipe display mod.- Overrides:
getInputsForDisplayin classPressureChamberRecipeImpl
-
getResultsForDisplay
Description copied from class:PressureChamberRecipeGet the output of this recipe, without crafting it. This is intended for recipe display purposes by JEI, Patchouli, or any other recipe display mod.If overriding and no output slots display more than one stack then can override
PressureChamberRecipe.getSingleResultsForDisplay()instead.- Overrides:
getResultsForDisplayin classPressureChamberRecipe
-
getSyncGroupsForDisplay
Description copied from class:PressureChamberRecipeGet the slots that are synchronized with each other. They must have the same cycle length and not intersect.A sync group (represented by a set of
PressureChamberRecipe.RecipeSlots) will have all its member's cycles synchronized should one of the members be the focus for a recipe lookup.If you need more functionality, see
PressureChamberRecipe.getSyncForDisplay(SlotCycle).- Overrides:
getSyncGroupsForDisplayin classPressureChamberRecipe- Returns:
- List of sync groups represented by a set of
PressureChamberRecipe.RecipeSlots
-
isValidInputItem
public boolean isValidInputItem(net.minecraft.world.item.ItemStack stack) Description copied from class:PressureChamberRecipeCheck if the given item is a valid input item for this recipe. This should also be true even if the number of items in the given item stack is smaller than the number required by the recipe; this is testing for item type, not item count.- Overrides:
isValidInputItemin classPressureChamberRecipeImpl- Parameters:
stack- item stack to check- Returns:
- true if this is a valid item, false otherwise
-
getTooltipKey
Description copied from class:PressureChamberRecipeReturn a translation key for a supplementary tooltip to be displayed on the ingredient or resulting item. For use in recipe display systems such as JEI (PNC's JEI integration names slots as "in{N}" and "out{N}" where n >= 0)- Overrides:
getTooltipKeyin classPressureChamberRecipe- Parameters:
input- true if this is an input item, false if an output itemslotName- a unique slot name- Returns:
- a tooltip translation key, or "" for no tooltip
-
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) Description copied from class:PneumaticCraftRecipeWrites this recipe to a PacketBuffer.- Overrides:
writein classPressureChamberRecipeImpl- Parameters:
buffer- The buffer to write to.
-
getSerializer
public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()- Specified by:
getSerializerin interfacenet.minecraft.world.item.crafting.Recipe<PneumaticCraftRecipe.DummyIInventory>- Overrides:
getSerializerin classPressureChamberRecipeImpl
-