Class RegistrySnapshot
java.lang.Object
net.neoforged.neoforge.registries.RegistrySnapshot
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<ResourceLocation,
ResourceLocation> private final Map<ResourceLocation,
ResourceLocation> private byte[]
private final Registry<?>
private final it.unimi.dsi.fastutil.ints.Int2ObjectSortedMap<ResourceLocation>
private final it.unimi.dsi.fastutil.ints.Int2ObjectSortedMap<ResourceLocation>
private static final Comparator<ResourceLocation>
-
Constructor Summary
ModifierConstructorDescriptionprivate
Creates a blank snapshot to populate.RegistrySnapshot
(Registry<T> registry, boolean full) Creates a registry snapshot based on the given registry.Creates a registry snapshot from the received buffer. -
Method Summary
Modifier and TypeMethodDescription<T> Registry<T>
it.unimi.dsi.fastutil.ints.Int2ObjectSortedMap<ResourceLocation>
getIds()
void
write
(FriendlyByteBuf buf) Write the registry snapshot to the given buffer and cache the binary data.
-
Field Details
-
SORTER
-
ids
-
idsView
-
aliases
-
aliasesView
-
fullBackup
-
binary
@Nullable private byte[] binary
-
-
Constructor Details
-
RegistrySnapshot
private RegistrySnapshot()Creates a blank snapshot to populate. -
RegistrySnapshot
Creates a registry snapshot based on the given registry.- Type Parameters:
T
- the registry type- Parameters:
registry
- the registry to snapshot.full
- iftrue
, all entries will be stored in this snapshot. These entries are never saved to disk nor sent to the client.
-
RegistrySnapshot
Creates a registry snapshot from the received buffer.- Parameters:
buf
- the buffer containing the data of the received snapshot.
-
-
Method Details
-
write
Write the registry snapshot to the given buffer and cache the binary data.- Parameters:
buf
- the buffer to write to.
-
getIds
-
getAliases
-
getFullBackup
-