Interface ModifyEvent<T>

Type Parameters:
T - The container entry type.
All Superinterfaces:
IBaseEvent<Content.Type>, IEvent<Content.Type>
All Known Implementing Classes:
ModifyEvents.BiomeCovers, ModifyEvents.BiomeDynamicLayers, ModifyEvents.BiomeEnvironments, ModifyEvents.BiomeFluids, ModifyEvents.BiomePrefabs, ModifyEvents.BiomeStaticLayers, ModifyEvents.BiomeTints, ModifyEvents.CaveCovers, ModifyEvents.CavePrefabs, ModifyEvents.CaveTypes

public interface ModifyEvent<T> extends IEvent<Content.Type>
Event interface for a series of world-gen content modification hooks that are fired for Zone and Biome containers during the loading process to allow for the addition and removal of entries that are not included in the base asset file.
  • Method Details

    • seed

    • type

      @Nonnull Content.Type type()
      Get the type of event.
      Returns:
      the type of event.
    • file

      @Nonnull FileContext<?> file()
      Get the file context for this event.
      Returns:
      the file context.
    • entries

      @Nonnull List<T> entries()
      Get the mutable list of entries.
      Returns:
      the list of entries.
    • loader

      @Nonnull ModifyEvent.ContentLoader<T> loader()
      Get the content loader for this event.
      Returns:
      the content loader used to load entries from a world-gen asset path.
    • dispatch

      static <E extends ModifyEvent<?>> void dispatch(@Nonnull Class<E> type, @Nonnull E event) throws Error
      Helper for posting a loading event and propagating errors thrown during handling of the event.
      Type Parameters:
      E - The type of event.
      Parameters:
      type - The type of event to post.
      event - The event to post.
      Throws:
      Error - Propagates any errors thrown during event handling.