Package appeng.api.stacks
Class AEKeyType
java.lang.Object
appeng.api.stacks.AEKeyType
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract com.mojang.serialization.MapCodec<? extends AEKey> codec()A codec used to encode keys of this type.final booleanReturns whether the key is part of this key space.final AEKeyFilterfilter()static AEKeyTypefluids()final StringformatAmount(long amount, AmountFormat format) Format the amount into a user-readable string.static @Nullable AEKeyTypefromRawId(int id) intThe amount of this key type that can be stored per byte used in a storage cell.intHow much of this key will be transferred as part of a transfer operation.intnet.minecraft.network.chat.ComponentGet the translated name of this key space.final net.minecraft.resources.ResourceLocationgetId()final bytegetRawId()Stream<net.minecraft.tags.TagKey<?>> Returns all tags that apply to keys of this type.@Nullable StringI.e.static AEKeyTypeitems()@Nullable AEKeyloadKeyFromTag(net.minecraft.core.HolderLookup.Provider registries, net.minecraft.nbt.CompoundTag tag) Attempts to load a key of this type from the given tag.abstract @Nullable AEKeyreadFromPacket(net.minecraft.network.RegistryFriendlyByteBuf input) Attempts to load a key of this type from the given packet buffer.booleanTrue to indicate that theAEKeyclass used by this storage channel supports range-based fuzzy search usingAEKey.getFuzzySearchValue()andAEKey.getFuzzySearchMaxValue().toString()final @Nullable AEKeyDoes this key belong to this storage channel.
-
Field Details
-
Constructor Details
-
AEKeyType
-
-
Method Details
-
codec
A codec used to encode keys of this type. -
items
- Returns:
- AE2's key space for
AEItemKey.
-
fromRawId
- Returns:
- See
getRawId()
-
fluids
- Returns:
- AE2's key space for
AEFluidKey.
-
getId
public final net.minecraft.resources.ResourceLocation getId()- Returns:
- The unique ID of this storage channel.
-
getKeyClass
-
getRawId
public final byte getRawId() -
getAmountPerOperation
public int getAmountPerOperation()How much of this key will be transferred as part of a transfer operation. Used to balance item vs. fluids transfers.E.g. used by IO Ports to transfer 1000 mB, not 1 mB to match the item channel transferring a full bucket per operation.
-
getAmountPerByte
public int getAmountPerByte()The amount of this key type that can be stored per byte used in a storage cell. Standard value for items is 8, and for fluids it's 8000. -
readFromPacket
@Nullable public abstract @Nullable AEKey readFromPacket(net.minecraft.network.RegistryFriendlyByteBuf input) Attempts to load a key of this type from the given packet buffer. -
loadKeyFromTag
@Nullable public @Nullable AEKey loadKeyFromTag(net.minecraft.core.HolderLookup.Provider registries, net.minecraft.nbt.CompoundTag tag) Attempts to load a key of this type from the given tag. -
tryCast
Does this key belong to this storage channel. -
contains
Returns whether the key is part of this key space.- Returns:
- whether the key is part of this key space
-
supportsFuzzyRangeSearch
public boolean supportsFuzzyRangeSearch()True to indicate that theAEKeyclass used by this storage channel supports range-based fuzzy search usingAEKey.getFuzzySearchValue()andAEKey.getFuzzySearchMaxValue(). For items this is used for damage-based search and filtering. -
filter
- Returns:
- A filter matching all keys of this type.
-
toString
-
getDescription
public net.minecraft.network.chat.Component getDescription()Get the translated name of this key space. -
getUnitSymbol
I.e. "B" for Buckets. -
getAmountPerUnit
public int getAmountPerUnit() -
formatAmount
Format the amount into a user-readable string. SeeAmountFormatfor an explanation of the different formats. Includes the unit if applicable. -
getTagNames
Returns all tags that apply to keys of this type. Is an optional operation is keys of this type cannot have tags, andAEKey.isTagged(TagKey)is not implemented for this key type.- See Also:
-