Package petrolpark.mc.library.core.flags
Interface IFlagPole<OBJECT,OBJECT_STACK>
- All Known Implementing Classes:
AbstractFlagPole,ComponentHolderFlagPole,FluidFlagPole,GenericFlagPole,ItemFlagPole,UnflaggableFlagPole
public interface IFlagPole<OBJECT,OBJECT_STACK>
A specific instance of a flaggable object, storing the specific Flags that object posseses.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanRemove all extrinsic Flags.booleanbooleanAdd several Flags, anddoublegetType()booleanbooleanbooleanbooleanisIntrinsic(net.minecraft.core.Holder<Flag> flagHolder) static voidperpetuate(Stream<net.minecraft.world.item.ItemStack> itemInputs, Stream<net.neoforged.neoforge.fluids.FluidStack> fluidInputs, double fluidWeight, Stream<net.minecraft.world.item.ItemStack> itemOutputs, Stream<net.neoforged.neoforge.fluids.FluidStack> fluidOutputs) static <OBJECT> voidperpetuate(Stream<OBJECT> inputs, Stream<OBJECT> outputs) static <OBJECT> voidperpetuate(Stream<OBJECT> inputs, Stream<OBJECT> outputs, Function<OBJECT, IFlagPole<?, ?>> flagpoleGetter) voidsave()Called whenever theIFlagPoleis changed, to save the changes to the underlying object.Stream all Flags in this FlagPole that: Are notintrinsicHave no parents in this FlagPole This is the minimum set of Flags needed to uniquely define a FlagPole instance.booleanRemove a Flag and anychildrenit has that don't belong to another parent.booleanunflagOnly(net.minecraft.core.Holder<Flag> flagHolder) Remove a Flag, but not any of its children.
-
Method Details
-
get
-
perpetuate
- Parameters:
inputs-outputs-- See Also:
-
perpetuate
static <OBJECT> void perpetuate(Stream<OBJECT> inputs, Stream<OBJECT> outputs, Function<OBJECT, IFlagPole<?, ?>> flagpoleGetter) - Type Parameters:
OBJECT- Type of the flaggable object- Parameters:
inputs-outputs-flagpoleGetter-
-
perpetuate
-
getFlaggable
Flaggable<OBJECT,OBJECT_STACK> getFlaggable() -
getType
OBJECT getType() -
getAmount
double getAmount() -
save
void save()Called whenever theIFlagPoleis changed, to save the changes to the underlying object. -
has
-
hasAnyFlag
boolean hasAnyFlag() -
hasAnyExtrinsicFlag
boolean hasAnyExtrinsicFlag() -
streamAllFlags
-
streamOrphanExtrinsicFlags
Stream all Flags in this FlagPole that:- Are not
intrinsic - Have no parents in this FlagPole
- Returns:
- Distinct Stream of Flags
- Are not
-
streamShownFlags
-
streamShownAbsentFlags
-
flag
-
flagAll
Add several Flags, and- Parameters:
flagsStream-- Returns:
-
unflag
Remove a Flag and anychildrenit has that don't belong to another parent. If the Flag has any parents in this FlagPole, it will not be removed.- Parameters:
flagHolder-- Returns:
- Whether this FlagPole changed
- See Also:
-
unflagOnly
Remove a Flag, but not any of its children. If the Flag has any parents in this FlagPole, it will not be removed.- Parameters:
flagHolder-- Returns:
- Whether this FlagPole changed (the Flag was removed)
- See Also:
-
clearFlags
boolean clearFlags()Remove all extrinsic Flags.- Returns:
- Whether this FlagPole changed (whether it had any extrinsic Flags)
-
isIntrinsic
-
streamIntrinsicFlags
-
streamShownIfAbsentFlags
-