Class IItemCompressionSequence.EmptyItemCompressionSequence
java.lang.Object
com.petrolpark.core.recipe.compression.IItemCompressionSequence.EmptyItemCompressionSequence
- All Implemented Interfaces:
IItemCompressionSequence
- Enclosing interface:
IItemCompressionSequence
public static class IItemCompressionSequence.EmptyItemCompressionSequence
extends Object
implements IItemCompressionSequence
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.petrolpark.core.recipe.compression.IItemCompressionSequence
IItemCompressionSequence.CompressedBlock, IItemCompressionSequence.EmptyItemCompressionSequence -
Field Summary
Fields inherited from interface com.petrolpark.core.recipe.compression.IItemCompressionSequence
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAn ordered list ofIItemCompressions, with thecountsrelative to the Item before (i.e.List<net.minecraft.world.item.ItemStack> Get the ordered list of all Item (Stacks) in this sequence.Get the least-compressed Item which is a BlockItem.net.minecraft.world.item.ItemStackGet a copy of the least-compressed Item (Stack) in the sequence.org.apache.commons.lang3.math.FractiongetEquivalentBaseItems(int item) org.apache.commons.lang3.math.FractiongetEquivalentBaseItems(net.minecraft.world.item.ItemStack stack) Get the number ofbase Itemsequivalent to the given Item Stack.doublegetEquivalentBaseItems(net.minecraft.world.item.ItemStack stack, double count) Get the number ofbase Itemsa given amount of the given Item.booleanisEmpty()intsize()The number ofItemsin this sequence.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.petrolpark.core.recipe.compression.IItemCompressionSequence
getFewestStacks
-
Constructor Details
-
EmptyItemCompressionSequence
protected EmptyItemCompressionSequence()
-
-
Method Details
-
getBaseItem
public net.minecraft.world.item.ItemStack getBaseItem()Description copied from interface:IItemCompressionSequenceGet a copy of the least-compressed Item (Stack) in the sequence.- Specified by:
getBaseItemin interfaceIItemCompressionSequence- Returns:
- ItemStack of count
1
-
getAllItems
Description copied from interface:IItemCompressionSequenceGet the ordered list of all Item (Stacks) in this sequence.- Specified by:
getAllItemsin interfaceIItemCompressionSequence- Returns:
- Non-
nulllist of ItemStacks of count1
-
size
public int size()Description copied from interface:IItemCompressionSequenceThe number ofItemsin this sequence.- Specified by:
sizein interfaceIItemCompressionSequence- Returns:
- Positive number
-
getAllCompressions
Description copied from interface:IItemCompressionSequenceAn ordered list ofIItemCompressions, with thecountsrelative to the Item before (i.e. not relative to thebase Item, except for the first compression).- Specified by:
getAllCompressionsin interfaceIItemCompressionSequence- Returns:
- Non-
nulllist ofIItemCompressions
-
getEquivalentBaseItems
public org.apache.commons.lang3.math.Fraction getEquivalentBaseItems(net.minecraft.world.item.ItemStack stack) Description copied from interface:IItemCompressionSequenceGet the number ofbase Itemsequivalent to the given Item Stack.- Specified by:
getEquivalentBaseItemsin interfaceIItemCompressionSequence- Parameters:
stack- The count of the Stack is considered- Returns:
nullif the Item (considering its Components) are not part of this sequence- See Also:
-
getEquivalentBaseItems
public double getEquivalentBaseItems(net.minecraft.world.item.ItemStack stack, double count) Description copied from interface:IItemCompressionSequenceGet the number ofbase Itemsa given amount of the given Item.- Specified by:
getEquivalentBaseItemsin interfaceIItemCompressionSequence- Parameters:
stack- The count of this Stack is ignoredcount-- Returns:
0if the Item (considering its Components) are not part of this sequence
-
getEquivalentBaseItems
public org.apache.commons.lang3.math.Fraction getEquivalentBaseItems(int item) Description copied from interface:IItemCompressionSequence- Specified by:
getEquivalentBaseItemsin interfaceIItemCompressionSequence- Parameters:
item-- Returns:
nullifitemis outside the bounds of the number of Items in this sequence.- See Also:
-
getBaseBlock
Description copied from interface:IItemCompressionSequenceGet the least-compressed Item which is a BlockItem.- Specified by:
getBaseBlockin interfaceIItemCompressionSequence- Returns:
- Empty Optional if there are no BlockItems in this sequence, or an Optional containing a
IItemCompressionSequence.CompressedBlockcontaining the Block and the ItemStack pertaining to it (which is guaranteed to beinthis sequence)
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceIItemCompressionSequence
-