public abstract class PressureChamberRecipe extends PneumaticCraftRecipe
| Modifier and Type | Class and Description |
|---|---|
static class |
PressureChamberRecipe.RecipeSlot
Data object for type of slot and the index of the slot.
|
static class |
PressureChamberRecipe.SlotCycle
Data object for storing a
PressureChamberRecipe.RecipeSlot and a cycle represented as a list indices for the slot. |
PneumaticCraftRecipe.DummyIInventory| Modifier | Constructor and Description |
|---|---|
protected |
PressureChamberRecipe(net.minecraft.util.ResourceLocation id) |
| Modifier and Type | Method and Description |
|---|---|
abstract net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> |
craftRecipe(net.minecraftforge.items.IItemHandler chamberHandler,
java.util.List<java.lang.Integer> ingredientSlots,
boolean simulate)
This method is called when the Pressure Chamber is ready to craft with this recipe, and will only be called when
findIngredients(IItemHandler) returns a non-empty list of slot numbers, i.e. |
abstract java.util.Collection<java.lang.Integer> |
findIngredients(net.minecraftforge.items.IItemHandler chamberHandler)
When called (by the pressure chamber TE 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 of the items currently in the
pressure chamber.
|
float |
getCraftingPressure()
Deprecated.
don't override this; override
getCraftingPressure(IItemHandler, List) instead |
float |
getCraftingPressure(net.minecraftforge.items.IItemHandler chamberHandler,
java.util.List<java.lang.Integer> ingredientSlots)
Returns the minimum pressure required to craft the recipe.
|
abstract float |
getCraftingPressureForDisplay()
Get the required crafting pressure for the items specified by
getInputsForDisplay(), for display
purposes only (e.g. |
abstract java.util.List<net.minecraft.item.crafting.Ingredient> |
getInputsForDisplay()
Get the input items for this recipe.
|
java.util.List<java.util.List<net.minecraft.item.ItemStack>> |
getResultsForDisplay()
Get the output of this recipe, without crafting it.
|
protected java.util.List<net.minecraft.item.ItemStack> |
getSingleResultsForDisplay()
Implement if no output slots display more than one stack.
|
java.util.Map<PressureChamberRecipe.RecipeSlot,java.util.List<java.lang.Integer>> |
getSyncForDisplay(PressureChamberRecipe.SlotCycle focusedSlotCycle)
Get the slots and associated cycles that are synchronized with the given focused slot and matched cycle indices.
|
protected java.util.List<java.util.Set<PressureChamberRecipe.RecipeSlot>> |
getSyncGroupsForDisplay()
Get the slots that are synchronized with each other.
|
java.lang.String |
getTooltipKey(boolean input,
int slot)
Return a translation key for a supplementary tooltip to be displayed on the ingredient or resulting item.
|
abstract boolean |
isValidInputItem(net.minecraft.item.ItemStack stack)
Check if the given item is a valid input item for this recipe.
|
assemble, canCraftInDimensions, getId, getResultItem, isSpecial, matches, writeprotected PressureChamberRecipe(net.minecraft.util.ResourceLocation id)
@Deprecated public float getCraftingPressure()
getCraftingPressure(IItemHandler, List) insteadpublic float getCraftingPressure(net.minecraftforge.items.IItemHandler chamberHandler,
java.util.List<java.lang.Integer> ingredientSlots)
chamberHandler - what's currently in the pressure chamberingredientSlots - a list of slots in chamberHandler (as returned by findIngredients(IItemHandler))
where the ingredients can be foundpublic abstract float getCraftingPressureForDisplay()
getInputsForDisplay(), for display
purposes only (e.g. for JEI)public abstract java.util.Collection<java.lang.Integer> findIngredients(@Nonnull
net.minecraftforge.items.IItemHandler chamberHandler)
getCraftingPressure(IItemHandler, List) and
craftRecipe(IItemHandler, List, boolean) by the pressure chamber.
Do not cache this list across ticks, since the chamber contents are quite likely to change in the meantime.
chamberHandler - what's currently in the pressure chamberpublic abstract java.util.List<net.minecraft.item.crafting.Ingredient> getInputsForDisplay()
protected java.util.List<net.minecraft.item.ItemStack> getSingleResultsForDisplay()
getResultsForDisplay()public java.util.List<java.util.List<net.minecraft.item.ItemStack>> getResultsForDisplay()
If overriding and no output slots display more than one stack then can override
getSingleResultsForDisplay() instead.
protected java.util.List<java.util.Set<PressureChamberRecipe.RecipeSlot>> getSyncGroupsForDisplay()
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 getSyncForDisplay(SlotCycle).
PressureChamberRecipe.RecipeSlotspublic java.util.Map<PressureChamberRecipe.RecipeSlot,java.util.List<java.lang.Integer>> getSyncForDisplay(PressureChamberRecipe.SlotCycle focusedSlotCycle)
getSyncGroupsForDisplay() unless you need special handling.
This method is called when a recipe lookup is done through JEI that has a focus.
focusedSlotCycle - Slot and indices of the slot's cycle that matches with the focuspublic abstract boolean isValidInputItem(net.minecraft.item.ItemStack stack)
stack - item stack to check@Nonnull
public abstract net.minecraft.util.NonNullList<net.minecraft.item.ItemStack> craftRecipe(@Nonnull
net.minecraftforge.items.IItemHandler chamberHandler,
java.util.List<java.lang.Integer> ingredientSlots,
boolean simulate)
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 the chamberHandler.
The implementation must also return the list of crafted items, for the Pressure Chamber to insert into its
output item handler.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 from findIngredients(IItemHandler)simulate - pass on to uses of chamberHandlerpublic java.lang.String getTooltipKey(boolean input,
int slot)
input - true if this is an input item, false if an output itemslot - the slot number