Package dan200.computercraft.api.pocket
Interface PocketUpgradeSerialiser<T extends IPocketUpgrade>
- Type Parameters:
 T- The type of pocket computer upgrade this is responsible for serialising.
- All Superinterfaces:
 UpgradeSerialiser<T>
Reads a 
IPocketUpgrade from disk and reads/writes it to a network packet.
 
 This follows the same format as TurtleUpgradeSerialiser - consult the
 documentation there for more information.
- See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PocketUpgradeSerialiser<?>>>Deprecated, for removal: This API element is subject to removal in a future version. - 
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PocketUpgradeSerialiser<?>>>The ID for the associated registry.static <T extends IPocketUpgrade>
PocketUpgradeSerialiser<T>Create an upgrade serialiser for a simple upgrade.static <T extends IPocketUpgrade>
PocketUpgradeSerialiser<T>simpleWithCustomItem(BiFunction<net.minecraft.resources.ResourceLocation, net.minecraft.world.item.ItemStack, T> factory) Create an upgrade serialiser for a simple upgrade whose crafting item can be specified.Methods inherited from interface dan200.computercraft.api.upgrades.UpgradeSerialiser
fromJson, fromNetwork, toNetwork 
- 
Field Details
- 
REGISTRY_ID
@Deprecated(forRemoval=true) static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PocketUpgradeSerialiser<?>>> REGISTRY_IDDeprecated, for removal: This API element is subject to removal in a future version.UseregistryId()instead.The ID for the associated registry. 
 - 
 - 
Method Details
- 
registryId
static net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<PocketUpgradeSerialiser<?>>> registryId()The ID for the associated registry.- Returns:
 - The registry key.
 
 - 
simple
static <T extends IPocketUpgrade> PocketUpgradeSerialiser<T> simple(Function<net.minecraft.resources.ResourceLocation, T> factory) Create an upgrade serialiser for a simple upgrade. This is similar to aSimpleCraftingRecipeSerializer, but for upgrades.If you might want to vary the item, it's suggested you use
simpleWithCustomItem(BiFunction)instead.- Type Parameters:
 T- The type of the generated upgrade.- Parameters:
 factory- Generate a new upgrade with a specific ID.- Returns:
 - The serialiser for this upgrade
 
 - 
simpleWithCustomItem
static <T extends IPocketUpgrade> PocketUpgradeSerialiser<T> simpleWithCustomItem(BiFunction<net.minecraft.resources.ResourceLocation, net.minecraft.world.item.ItemStack, T> factory) Create an upgrade serialiser for a simple upgrade whose crafting item can be specified.- Type Parameters:
 T- The type of the generated upgrade.- Parameters:
 factory- Generate a new upgrade with a specific ID and crafting item. The returned upgrade'sUpgradeBase.getCraftingItem()MUST equal the provided item.- Returns:
 - The serialiser for this upgrade.
 - See Also:
 
 
 - 
 
registryId()instead.