Class IngredientMatcherFluidStack
java.lang.Object
org.cyclops.commoncapabilities.ingredient.IngredientMatcherFluidStack
- All Implemented Interfaces:
Comparator<net.neoforged.neoforge.fluids.FluidStack>,IIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer>
public class IngredientMatcherFluidStack
extends Object
implements IIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer>
Matcher for FluidStacks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(net.neoforged.neoforge.fluids.FluidStack o1, net.neoforged.neoforge.fluids.FluidStack o2) intconditionCompare(Integer a, Integer b) Compare two conditions with each other.net.neoforged.neoforge.fluids.FluidStackcopy(net.neoforged.neoforge.fluids.FluidStack instance) Create a deep copy of the given instance.net.minecraft.network.chat.MutableComponentgetDisplayName(net.neoforged.neoforge.fluids.FluidStack instance) Return the display name of the given instance.net.neoforged.neoforge.fluids.FluidStacklonglonggetQuantity(net.neoforged.neoforge.fluids.FluidStack instance) Get the quantity in the given instance.booleanhasCondition(Integer matchCondition, Integer searchCondition) Check if the given match condition contains at least the given condition.inthash(net.neoforged.neoforge.fluids.FluidStack instance) Hash the given instance.booleanisInstance(Object object) If the given object is an instance of the ingredient type.localize(net.neoforged.neoforge.fluids.FluidStack instance) Return the localized name of the given instance.booleanmatches(net.neoforged.neoforge.fluids.FluidStack a, net.neoforged.neoforge.fluids.FluidStack b, Integer matchCondition) Check if the two given instances match based on the given match conditions.toString(net.neoforged.neoforge.fluids.FluidStack instance) Return a stringified version of the given instance.withCondition(Integer matchCondition, Integer with) Create a new match condition based on the given condition that includes the second condition.withoutCondition(Integer matchCondition, Integer without) Create a new match condition based on the given condition that excludes the second condition.net.neoforged.neoforge.fluids.FluidStackwithQuantity(net.neoforged.neoforge.fluids.FluidStack instance, long quantity) Create a copy of the given instance with the given quantity.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface org.cyclops.commoncapabilities.api.ingredient.IIngredientMatcher
isEmpty, matchesExactly
-
Constructor Details
-
IngredientMatcherFluidStack
public IngredientMatcherFluidStack()
-
-
Method Details
-
isInstance
Description copied from interface:IIngredientMatcherIf the given object is an instance of the ingredient type.- Specified by:
isInstancein interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
object- An object.- Returns:
- If the object is a valid instance of the ingredient component type.
-
getAnyMatchCondition
- Specified by:
getAnyMatchConditionin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Returns:
- The match condition that is used to match any instance based on a prototype.
-
getExactMatchCondition
- Specified by:
getExactMatchConditionin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Returns:
- The match condition that is used to match instances exactly based on a prototype.
-
getExactMatchNoQuantityCondition
- Specified by:
getExactMatchNoQuantityConditionin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Returns:
- The match condition that is used to match instances exactly based on a prototype, excluding the quantity.
-
withCondition
Description copied from interface:IIngredientMatcherCreate a new match condition based on the given condition that includes the second condition.- Specified by:
withConditionin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
matchCondition- The match condition to start from.with- The match condition to include.- Returns:
- A new match condition that is the combination of both.
-
withoutCondition
Description copied from interface:IIngredientMatcherCreate a new match condition based on the given condition that excludes the second condition.- Specified by:
withoutConditionin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
matchCondition- The match condition to start from.without- A match condition to exclude.- Returns:
- A new match condition that is the first one without the second one.
-
hasCondition
Description copied from interface:IIngredientMatcherCheck if the given match condition contains at least the given condition.- Specified by:
hasConditionin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
matchCondition- The match condition to start from.searchCondition- A match condition to search for.- Returns:
- If the first condition contains at least the second condition.
-
matches
public boolean matches(net.neoforged.neoforge.fluids.FluidStack a, net.neoforged.neoforge.fluids.FluidStack b, Integer matchCondition) Description copied from interface:IIngredientMatcherCheck if the two given instances match based on the given match conditions.- Specified by:
matchesin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
a- A first instance.b- A second instance.matchCondition- A condition under which the matching should be done.- Returns:
- If the two given instances match under the given conditions.
-
getEmptyInstance
public net.neoforged.neoforge.fluids.FluidStack getEmptyInstance()- Specified by:
getEmptyInstancein interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Returns:
- The instance that acts as an 'empty' instance. For ItemStacks, this would be ItemStack.EMPTY.
-
hash
public int hash(net.neoforged.neoforge.fluids.FluidStack instance) Description copied from interface:IIngredientMatcherHash the given instance. This must be calculated quickly.- Specified by:
hashin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.- Returns:
- A hashcode for the given instance.
-
copy
public net.neoforged.neoforge.fluids.FluidStack copy(net.neoforged.neoforge.fluids.FluidStack instance) Description copied from interface:IIngredientMatcherCreate a deep copy of the given instance.- Specified by:
copyin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.- Returns:
- A copy of the given instance.
-
getQuantity
public long getQuantity(net.neoforged.neoforge.fluids.FluidStack instance) Description copied from interface:IIngredientMatcherGet the quantity in the given instance.- Specified by:
getQuantityin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.- Returns:
- The instance quantity.
-
withQuantity
public net.neoforged.neoforge.fluids.FluidStack withQuantity(net.neoforged.neoforge.fluids.FluidStack instance, long quantity) Description copied from interface:IIngredientMatcherCreate a copy of the given instance with the given quantity.- Specified by:
withQuantityin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.quantity- The new instance quantity.- Returns:
- The copied instance with the new quantity.
-
getMaximumQuantity
public long getMaximumQuantity()- Specified by:
getMaximumQuantityin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Returns:
- The maximum allowed quantity for instances.
-
conditionCompare
Description copied from interface:IIngredientMatcherCompare two conditions with each other.- Specified by:
conditionComparein interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
a- A first condition.b- A second condition.- Returns:
- The comparison result.
-
localize
Description copied from interface:IIngredientMatcherReturn the localized name of the given instance. This should not include the instance quantity. Should only be called client-side!- Specified by:
localizein interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.- Returns:
- The localized name of the given instance.
-
getDisplayName
public net.minecraft.network.chat.MutableComponent getDisplayName(net.neoforged.neoforge.fluids.FluidStack instance) Description copied from interface:IIngredientMatcherReturn the display name of the given instance. This should not include the instance quantity.- Specified by:
getDisplayNamein interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.- Returns:
- The display name of the given instance.
-
toString
Description copied from interface:IIngredientMatcherReturn a stringified version of the given instance. These strings are mainly used for development purposes.- Specified by:
toStringin interfaceIIngredientMatcher<net.neoforged.neoforge.fluids.FluidStack,Integer> - Parameters:
instance- An instance.- Returns:
- The string version of the given instance.
-
compare
public int compare(net.neoforged.neoforge.fluids.FluidStack o1, net.neoforged.neoforge.fluids.FluidStack o2) - Specified by:
comparein interfaceComparator<net.neoforged.neoforge.fluids.FluidStack>
-