/* * Copyright (c) Forge Development LLC and contributors * SPDX-License-Identifier: LGPL-2.1-only */ package net.minecraftforge.registries; import com.mojang.serialization.Codec; import java.util.ArrayList; import java.util.List; import net.minecraft.client.multiplayer.ClientPacketListener; import net.minecraft.core.Registry; import net.minecraft.resources.RegistryDataLoader; import net.minecraft.resources.ResourceKey; import net.minecraftforge.eventbus.api.Cancelable; import net.minecraftforge.eventbus.api.Event; import net.minecraftforge.fml.LogicalSide; import net.minecraftforge.fml.event.IModBusEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; public class DataPackRegistryEvent extends Event implements IModBusEvent { @ApiStatus.Internal public DataPackRegistryEvent() {} /** * Fired when datapack registries can be registered. * Datapack registries are registries which can only load entries through JSON files from datapacks. *
* Data JSONs will be loaded from {@code data/
* This event is not {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.
*
* This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* on both {@linkplain LogicalSide logical sides}.
*/
public static final class NewRegistry extends DataPackRegistryEvent
{
private final List
* Data JSONs will be loaded from {@code data/
* Data JSONs will be loaded from {@code data/
* If {@code networkCodec} is not null, clients must have this datapack registry/mod
* when joining a server that has this datapack registry/mod.
* The data will be synced using the network codec and accessible via {@link ClientPacketListener#registryAccess()}.
* @see #dataPackRegistry(ResourceKey, Codec)
*/
public