Interface ICommonRegistrar

All Known Subinterfaces:
IRegistrar

@NonExtendable public interface ICommonRegistrar
The registrar for common-sided objects.

Configuration Translations

These translation keys will be used on the plugin config screen:
  • config.waila.plugin_[namespace].[path] for the config name.
  • config.waila.plugin_[namespace].[path]_desc for the config description. This one is optional and can be left missing.

Config options can also be grouped with the same prefix on its path followed by a period [.], e.g. my_plugin:group.option1 and my_plugin:group.option2.
Then, add a translation for config.waila.plugin_[namespace].[group] with the group name for it to be visible in the config screen.

  • Method Details

    • featureConfig

      void featureConfig(ResourceLocation key, boolean clientOnly)
      Registers a namespaced config key to be accessed within data providers.

      The main purpose of this method is for toggling feature that enabled by default. This method allows server to disable the option remotely for all connected clients, the clients can then toggle the option for their own side only if it is enabled on the server.

      Parameters:
      key - the namespaced key to be used with IPluginConfig.getBoolean(ResourceLocation)
      clientOnly - whether the feature available on client-only, e.g. not using server data
      See Also:
    • localConfig

      void localConfig(ResourceLocation key, boolean defaultValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are accessible from either client or server, but both could be different with each other as they are not synced.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      See Also:
    • localConfig

      void localConfig(ResourceLocation key, int defaultValue, IntFormat format)
      Registers a namespaced config key to be accessed within data providers.

      These values are accessible from either client or server, but both could be different with each other as they are not synced.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      format - used for formatting text box in plugin config screen
      See Also:
    • localConfig

      default void localConfig(ResourceLocation key, int defaultValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are accessible from either client or server, but both could be different with each other as they are not synced.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      See Also:
    • localConfig

      void localConfig(ResourceLocation key, double defaultValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are accessible from either client or server, but both could be different with each other as they are not synced.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      See Also:
    • localConfig

      void localConfig(ResourceLocation key, String defaultValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are accessible from either client or server, but both could be different with each other as they are not synced.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      See Also:
    • localConfig

      <T extends Enum<T>> void localConfig(ResourceLocation key, T defaultValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are accessible from either client or server, but both could be different with each other as they are not synced.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
    • externalConfig

      void externalConfig(ResourceLocation key, Path path)
      Adds an entry to the config screen to open a file with external editor.

      Does NOT handle file parsing, and will NOT available from IPluginConfig. Needs to be handled by the user manually.

      Parameters:
      key - the namespaced key
      path - the path to the file
      See Also:
    • syncedConfig

      void syncedConfig(ResourceLocation key, boolean defaultValue, boolean clientOnlyValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are sent from the server to the client upon connection.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      clientOnlyValue - the value that will be used when the server connected doesn't have waila installed
      See Also:
    • syncedConfig

      void syncedConfig(ResourceLocation key, int defaultValue, int clientOnlyValue, IntFormat format)
      Registers a namespaced config key to be accessed within data providers.

      These values are sent from the server to the client upon connection.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      clientOnlyValue - the value that will be used when the server connected doesn't have waila installed
      format - used for formatting text box in plugin config screen
      See Also:
    • syncedConfig

      default void syncedConfig(ResourceLocation key, int defaultValue, int clientOnlyValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are sent from the server to the client upon connection.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      clientOnlyValue - the value that will be used when the server connected doesn't have waila installed
      See Also:
    • syncedConfig

      void syncedConfig(ResourceLocation key, double defaultValue, double clientOnlyValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are sent from the server to the client upon connection.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      clientOnlyValue - the value that will be used when the server connected doesn't have waila installed
      See Also:
    • syncedConfig

      void syncedConfig(ResourceLocation key, String defaultValue, String clientOnlyValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are sent from the server to the client upon connection.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      clientOnlyValue - the value that will be used when the server connected doesn't have waila installed
      See Also:
    • syncedConfig

      <T extends Enum<T>> void syncedConfig(ResourceLocation key, T defaultValue, T clientOnlyValue)
      Registers a namespaced config key to be accessed within data providers.

      These values are sent from the server to the client upon connection.

      Parameters:
      key - the namespaced key
      defaultValue - the default value
      clientOnlyValue - the value that will be used when the server connected doesn't have waila installed
      See Also:
    • configAlias

      void configAlias(ResourceLocation actual, ResourceLocation... aliases)
      Registers config key aliases that will be migrated gracefully to the actual key.

      Also sync the value using aliased keys, so outdated client can still get the correct value.

    • blacklist

      void blacklist(int priority, Block... blocks)
      Adds the specified entity types to the default blacklist.
      Parameters:
      priority - the modifier priority, lower number will be called last
    • blacklist

      void blacklist(int priority, BlockEntityType<?>... blockEntityTypes)
      Adds the specified entity types to the default blacklist.
      Parameters:
      priority - the modifier priority, lower number will be called last
    • blacklist

      default void blacklist(Block... blocks)
      Adds the specified entity types to the default blacklist.
    • blacklist

      default void blacklist(BlockEntityType<?>... blockEntityTypes)
      Adds the specified entity types to the default blacklist.
    • removeBlacklist

      void removeBlacklist(int priority, Block... blocks)
      Removes the specified entity types to the default blacklist.
      Parameters:
      priority - the modifier priority, lower number will be called last
    • removeBlacklist

      void removeBlacklist(int priority, BlockEntityType<?>... blockEntityTypes)
      Removes the specified entity types to the default blacklist.
      Parameters:
      priority - the modifier priority, lower number will be called last
    • removeBlacklist

      default void removeBlacklist(Block... blocks)
      Removes the specified entity types to the default blacklist.
    • removeBlacklist

      default void removeBlacklist(BlockEntityType<?>... blockEntityTypes)
      Removes the specified entity types to the default blacklist.
    • blockData

      <T, BE extends BlockEntity> void blockData(IDataProvider<BE> provider, Class<T> clazz, int priority)
      Registers an IDataProvider<BlockEntity> instance for data syncing purposes. A BlockEntity is also an acceptable class type.
      Parameters:
      provider - the data provider instance
      clazz - the highest level class to apply to
      priority - the priority of this provider 0 is the minimum, lower number will be called first
      See Also:
    • blockData

      default <T, BE extends BlockEntity> void blockData(IDataProvider<BE> provider, Class<T> clazz)
      Registers an IDataProvider<BlockEntity> instance with default priority for data syncing purposes. A BlockEntity is also an acceptable class type.
      Parameters:
      provider - the data provider instance
      clazz - the highest level class to apply to
    • blacklist

      void blacklist(int priority, EntityType<?>... entityTypes)
      Adds the specified entity types to the default blacklist.
      Parameters:
      priority - the modifier priority, lower number will be called last
    • blacklist

      default void blacklist(EntityType<?>... entityTypes)
      Adds the specified entity types to the default blacklist.
    • removeBlacklist

      void removeBlacklist(int priority, EntityType<?>... entityTypes)
      Removes the specified entity types to the default blacklist.
      Parameters:
      priority - the modifier priority, lower number will be called last
    • removeBlacklist

      default void removeBlacklist(EntityType<?>... entityTypes)
      Removes the specified entity types to the default blacklist.
    • entityData

      <T, E extends Entity> void entityData(IDataProvider<E> provider, Class<T> clazz, int priority)
      Registers an IDataProvider<Entity> instance for data syncing purposes.
      Parameters:
      provider - the data provider instance
      clazz - the highest level class to apply to
      priority - the priority of this provider 0 is the minimum, lower number will be called first
      See Also:
    • entityData

      default <T, E extends Entity> void entityData(IDataProvider<E> provider, Class<T> clazz)
      Registers an IDataProvider<Entity> instance with default priority for data syncing purposes.
      Parameters:
      provider - the data provider instance
      clazz - the highest level class to apply to
    • dataType

      <D extends IData> void dataType(IData.Type<D> type, net.minecraft.network.codec.StreamCodec<? super RegistryFriendlyByteBuf,? extends D> codec)
      Registers a data type used for syncing data from server to client.
      Parameters:
      type - the data type
      codec - the data-to-buffer codec