Class AEFluidKey
java.lang.Object
appeng.api.stacks.AEKey
appeng.api.stacks.AEFluidKey
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final com.mojang.serialization.Codec<AEFluidKey> static final com.mojang.serialization.MapCodec<AEFluidKey> Fields inherited from class AEKey
OPTIONAL_STREAM_CODEC, STREAM_CODEC, TYPE_FIELD -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDrops(long amount, List<net.minecraft.world.item.ItemStack> drops, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Adds the drops if the container holding this key is broken, such as an interface holding stacks.protected net.minecraft.network.chat.ComponentCompute the display name, which is used to sort by name in client terminal.booleanstatic AEKeyFilterfilter()static AEFluidKeyfromPacket(net.minecraft.network.RegistryFriendlyByteBuf data) static AEFluidKeyfromTag(net.minecraft.world.level.storage.ValueInput input) <T> Tget(net.minecraft.core.component.DataComponentType<T> type) Get a data component attached to this key.net.minecraft.world.level.material.FluidgetFluid()net.minecraft.resources.IdentifiergetId()getType()booleaninthashCode()static booleanis(@Nullable GenericStack stack) static booleanbooleanisTagged(net.minecraft.tags.TagKey<?> tag) If the underlying resource supports tagging, this method checks if the resource represented by this key is tagged by the given tag.static booleanbooleanmatches(net.neoforged.neoforge.fluids.FluidStack variant) static AEFluidKeyof(net.minecraft.world.level.material.Fluid fluid) static @Nullable AEFluidKeyof(net.neoforged.neoforge.fluids.FluidStack fluidVariant) static @Nullable AEFluidKeyof(net.neoforged.neoforge.transfer.fluid.FluidResource resource) net.neoforged.neoforge.transfer.fluid.FluidResourcenet.neoforged.neoforge.fluids.FluidStacktoStack(int amount) toString()voidtoTag(net.minecraft.world.level.storage.ValueOutput output) Serialized keys MUST NOT contain keys that start with#, because this prefix can be used to add additional data into the same tag as the key.voidwriteToPacket(net.minecraft.network.RegistryFriendlyByteBuf data) Methods inherited from class AEKey
formatAmount, fromTagGeneric, fuzzyEquals, getAmountPerByte, getAmountPerOperation, getAmountPerUnit, getDisplayName, getFuzzySearchMaxValue, getFuzzySearchValue, getModId, getUnitSymbol, matches, readKey, readOptionalKey, supportsFuzzyRangeSearch, toTagGeneric, wrapForDisplayOrFilter, writeKey, writeOptionalKey
-
Field Details
-
MAP_CODEC
-
CODEC
-
AMOUNT_BUCKET
public static final int AMOUNT_BUCKET- See Also:
-
AMOUNT_BLOCK
public static final int AMOUNT_BLOCK- See Also:
-
-
Method Details
-
of
-
of
@Nullable public static @Nullable AEFluidKey of(net.neoforged.neoforge.fluids.FluidStack fluidVariant) -
of
@Nullable public static @Nullable AEFluidKey of(net.neoforged.neoforge.transfer.fluid.FluidResource resource) -
matches
-
is
-
filter
-
matches
public boolean matches(net.neoforged.neoforge.fluids.FluidStack variant) -
getType
-
dropSecondary
- Specified by:
dropSecondaryin classAEKey- Returns:
- This object if it has no secondary component, otherwise a copy of this resource key with the secondary component removed.
-
equals
-
hashCode
-
fromTag
-
toTag
-
getPrimaryKey
- Specified by:
getPrimaryKeyin classAEKey
-
getId
-
addDrops
public void addDrops(long amount, List<net.minecraft.world.item.ItemStack> drops, net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Description copied from class:AEKeyAdds the drops if the container holding this key is broken, such as an interface holding stacks. Item stacks should be placed in the list and not spawned directly into the world -
computeDisplayName
protected net.minecraft.network.chat.Component computeDisplayName()Description copied from class:AEKeyCompute the display name, which is used to sort by name in client terminal. Will be cached byAEKey.getDisplayName().- Specified by:
computeDisplayNamein classAEKey
-
isTagged
-
get
-
hasComponents
public boolean hasComponents()- Specified by:
hasComponentsin classAEKey- Returns:
- true if this key has *any* components attached.
-
toResource
public net.neoforged.neoforge.transfer.fluid.FluidResource toResource() -
toStack
public net.neoforged.neoforge.fluids.FluidStack toStack(int amount) -
getFluid
public net.minecraft.world.level.material.Fluid getFluid() -
writeToPacket
public void writeToPacket(net.minecraft.network.RegistryFriendlyByteBuf data) - Specified by:
writeToPacketin classAEKey
-
fromPacket
-
is
-
toString
-