Package commoble.databuddy.data

# Class KeyedCodecJsonDataManager<K,V>

java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>
net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
commoble.databuddy.data.KeyedCodecJsonDataManager<K,V>

All Implemented Interfaces:
  `net.minecraft.server.packs.resources.PreparableReloadListener`

Direct Known Subclasses:
  `CodecJsonDataManager`

@Deprecated(forRemoval=true, since="4.0.0.0") public class KeyedCodecJsonDataManager<K,V> extends net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
Deprecated, for removal: This API element is subject to removal in a future version.
To be removed in the next version of Minecraft. CodecJsonDataManager will be refactored to be like this class (allowing non-ResourceLocation keys)

## Nested Class Summary

## Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

`net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Map<K,V>`
`data`
Deprecated, for removal: This API element is subject to removal in a future version.
The raw data that we parsed from json last time resources were reloaded

## Constructor Summary

Constructors
Constructor
Description
`KeyedCodecJsonDataManager(String folderName, Function<net.minecraft.resources.ResourceLocation,com.mojang.serialization.DataResult<K>> keyReader, com.mojang.serialization.Codec<V> valueCodec)`
Deprecated, for removal: This API element is subject to removal in a future version.
`KeyedCodecJsonDataManager(String folderName, Function<net.minecraft.resources.ResourceLocation,com.mojang.serialization.DataResult<K>> keyReader, com.mojang.serialization.Codec<V> valueCodec, com.google.gson.Gson gson)`
Deprecated, for removal: This API element is subject to removal in a future version.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`apply(Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement> jsons, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler)`
Deprecated, for removal: This API element is subject to removal in a future version.
`Map<K,V>`
`getData()`
Deprecated, for removal: This API element is subject to removal in a future version.
`<PACKET> KeyedCodecJsonDataManager<K,V>`
`subscribeMeAsSyncable(net.minecraftforge.network.simple.SimpleChannel channel, Function<Map<K,V>,PACKET> packetFactory)`
Deprecated, for removal: This API element is subject to removal in a future version.
This should be called at most once, during construction of your mod (static init of your main mod class is fine) Calling this method automatically subscribes a packet-sender to `OnDatapackSyncEvent`.

### Methods inherited from class net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener

`getPreparedPath, prepare, scanDirectory`

### Methods inherited from class net.minecraft.server.packs.resources.SimplePreparableReloadListener

`reload`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

`getName`

## Field Details

### data

protected Map<K,V> data
Deprecated, for removal: This API element is subject to removal in a future version.
The raw data that we parsed from json last time resources were reloaded

## Constructor Details

### KeyedCodecJsonDataManager

public KeyedCodecJsonDataManager(String folderName, Function<net.minecraft.resources.ResourceLocation,com.mojang.serialization.DataResult<K>> keyReader, com.mojang.serialization.Codec<V> valueCodec)
Deprecated, for removal: This API element is subject to removal in a future version.

### KeyedCodecJsonDataManager

public KeyedCodecJsonDataManager(String folderName, Function<net.minecraft.resources.ResourceLocation,com.mojang.serialization.DataResult<K>> keyReader, com.mojang.serialization.Codec<V> valueCodec, com.google.gson.Gson gson)
Deprecated, for removal: This API element is subject to removal in a future version.

## Method Details

### getData

public Map<K,V> getData()
Deprecated, for removal: This API element is subject to removal in a future version.

Returns:
  The data entries

### apply

protected void apply(Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement> jsons, net.minecraft.server.packs.resources.ResourceManager resourceManager, net.minecraft.util.profiling.ProfilerFiller profiler)
Deprecated, for removal: This API element is subject to removal in a future version.

Specified by:
  `apply` in class `net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>`

### subscribeMeAsSyncable

public <PACKET> KeyedCodecJsonDataManager<K,V> subscribeMeAsSyncable(net.minecraftforge.network.simple.SimpleChannel channel, Function<Map<K,V>,PACKET> packetFactory)
Deprecated, for removal: This API element is subject to removal in a future version.
This should be called at most once, during construction of your mod (static init of your main mod class is fine) Calling this method automatically subscribes a packet-sender to `OnDatapackSyncEvent`.

Type Parameters:
  `PACKET` - the packet type that will be sent on the given channel
Parameters:
  `channel` - The networking channel of your mod
  `packetFactory` - A packet constructor or factory method that converts the given map to a packet object to send on the given channel
Returns:
  this manager object