Interface ICommonRegistrar
- All Known Subinterfaces:
IRegistrar
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]_descfor 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 Summary
Modifier and TypeMethodDescriptionvoidblacklist(int priority, EntityType<?>... entityTypes) Adds the specified entity types to the default blacklist.voidAdds the specified entity types to the default blacklist.voidblacklist(int priority, BlockEntityType<?>... blockEntityTypes) Adds the specified entity types to the default blacklist.default voidblacklist(EntityType<?>... entityTypes) Adds the specified entity types to the default blacklist.default voidAdds the specified entity types to the default blacklist.default voidblacklist(BlockEntityType<?>... blockEntityTypes) Adds the specified entity types to the default blacklist.default <T,BE extends BlockEntity>
voidblockData(IDataProvider<BE> provider, Class<T> clazz) Registers anIDataProvider<BlockEntity>instance with default priority for data syncing purposes.<T,BE extends BlockEntity>
voidblockData(IDataProvider<BE> provider, Class<T> clazz, int priority) Registers anIDataProvider<BlockEntity>instance for data syncing purposes.voidconfigAlias(ResourceLocation actual, ResourceLocation... aliases) Registers config key aliases that will be migrated gracefully to the actual key.<D extends IData>
voiddataType(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.default <T,E extends Entity>
voidentityData(IDataProvider<E> provider, Class<T> clazz) Registers anIDataProvider<Entity>instance with default priority for data syncing purposes.<T,E extends Entity>
voidentityData(IDataProvider<E> provider, Class<T> clazz, int priority) Registers anIDataProvider<Entity>instance for data syncing purposes.voidexternalConfig(ResourceLocation key, Path path) Adds an entry to the config screen to open a file with external editor.voidfeatureConfig(ResourceLocation key, boolean clientOnly) Registers a namespaced config key to be accessed within data providers.voidlocalConfig(ResourceLocation key, boolean defaultValue) Registers a namespaced config key to be accessed within data providers.voidlocalConfig(ResourceLocation key, double defaultValue) Registers a namespaced config key to be accessed within data providers.default voidlocalConfig(ResourceLocation key, int defaultValue) Registers a namespaced config key to be accessed within data providers.voidlocalConfig(ResourceLocation key, int defaultValue, IntFormat format) Registers a namespaced config key to be accessed within data providers.voidlocalConfig(ResourceLocation key, String defaultValue) Registers a namespaced config key to be accessed within data providers.<T extends Enum<T>>
voidlocalConfig(ResourceLocation key, T defaultValue) Registers a namespaced config key to be accessed within data providers.voidremoveBlacklist(int priority, EntityType<?>... entityTypes) Removes the specified entity types to the default blacklist.voidremoveBlacklist(int priority, Block... blocks) Removes the specified entity types to the default blacklist.voidremoveBlacklist(int priority, BlockEntityType<?>... blockEntityTypes) Removes the specified entity types to the default blacklist.default voidremoveBlacklist(EntityType<?>... entityTypes) Removes the specified entity types to the default blacklist.default voidremoveBlacklist(Block... blocks) Removes the specified entity types to the default blacklist.default voidremoveBlacklist(BlockEntityType<?>... blockEntityTypes) Removes the specified entity types to the default blacklist.voidsyncedConfig(ResourceLocation key, boolean defaultValue, boolean clientOnlyValue) Registers a namespaced config key to be accessed within data providers.voidsyncedConfig(ResourceLocation key, double defaultValue, double clientOnlyValue) Registers a namespaced config key to be accessed within data providers.default voidsyncedConfig(ResourceLocation key, int defaultValue, int clientOnlyValue) Registers a namespaced config key to be accessed within data providers.voidsyncedConfig(ResourceLocation key, int defaultValue, int clientOnlyValue, IntFormat format) Registers a namespaced config key to be accessed within data providers.voidsyncedConfig(ResourceLocation key, String defaultValue, String clientOnlyValue) Registers a namespaced config key to be accessed within data providers.<T extends Enum<T>>
voidsyncedConfig(ResourceLocation key, T defaultValue, T clientOnlyValue) Registers a namespaced config key to be accessed within data providers.
-
Method Details
-
featureConfig
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 withIPluginConfig.getBoolean(ResourceLocation)clientOnly- whether the feature available on client-only, e.g. not using server data- See Also:
-
localConfig
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 keydefaultValue- the default value- See Also:
-
localConfig
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 keydefaultValue- the default valueformat- used for formatting text box in plugin config screen- See Also:
-
localConfig
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 keydefaultValue- the default value- See Also:
-
localConfig
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 keydefaultValue- the default value- See Also:
-
localConfig
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 keydefaultValue- the default value- See Also:
-
localConfig
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 keydefaultValue- the default value
-
externalConfig
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 keypath- the path to the file- See Also:
-
syncedConfig
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 keydefaultValue- the default valueclientOnlyValue- the value that will be used when the server connected doesn't have waila installed- See Also:
-
syncedConfig
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 keydefaultValue- the default valueclientOnlyValue- the value that will be used when the server connected doesn't have waila installedformat- used for formatting text box in plugin config screen- See Also:
-
syncedConfig
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 keydefaultValue- the default valueclientOnlyValue- the value that will be used when the server connected doesn't have waila installed- See Also:
-
syncedConfig
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 keydefaultValue- the default valueclientOnlyValue- the value that will be used when the server connected doesn't have waila installed- See Also:
-
syncedConfig
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 keydefaultValue- the default valueclientOnlyValue- the value that will be used when the server connected doesn't have waila installed- See Also:
-
syncedConfig
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 keydefaultValue- the default valueclientOnlyValue- the value that will be used when the server connected doesn't have waila installed- See Also:
-
configAlias
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
Adds the specified entity types to the default blacklist.- Parameters:
priority- the modifier priority, lower number will be called last
-
blacklist
Adds the specified entity types to the default blacklist.- Parameters:
priority- the modifier priority, lower number will be called last
-
blacklist
Adds the specified entity types to the default blacklist. -
blacklist
Adds the specified entity types to the default blacklist. -
removeBlacklist
Removes the specified entity types to the default blacklist.- Parameters:
priority- the modifier priority, lower number will be called last
-
removeBlacklist
Removes the specified entity types to the default blacklist.- Parameters:
priority- the modifier priority, lower number will be called last
-
removeBlacklist
Removes the specified entity types to the default blacklist. -
removeBlacklist
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 anIDataProvider<BlockEntity>instance for data syncing purposes. ABlockEntityis also an acceptable class type.- Parameters:
provider- the data provider instanceclazz- the highest level class to apply topriority- the priority of this provider 0 is the minimum, lower number will be called first- See Also:
-
blockData
Registers anIDataProvider<BlockEntity>instance with default priority for data syncing purposes. ABlockEntityis also an acceptable class type.- Parameters:
provider- the data provider instanceclazz- the highest level class to apply to
-
blacklist
Adds the specified entity types to the default blacklist.- Parameters:
priority- the modifier priority, lower number will be called last
-
blacklist
Adds the specified entity types to the default blacklist. -
removeBlacklist
Removes the specified entity types to the default blacklist.- Parameters:
priority- the modifier priority, lower number will be called last
-
removeBlacklist
Removes the specified entity types to the default blacklist. -
entityData
Registers anIDataProvider<Entity>instance for data syncing purposes.- Parameters:
provider- the data provider instanceclazz- the highest level class to apply topriority- the priority of this provider 0 is the minimum, lower number will be called first- See Also:
-
entityData
Registers anIDataProvider<Entity>instance with default priority for data syncing purposes.- Parameters:
provider- the data provider instanceclazz- 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 typecodec- the data-to-buffer codec
-