Class ExtendedConfig<C extends ExtendedConfig<C,I>,I>
java.lang.Object
org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig<C,I>
- Type Parameters:
C
- Class of the extension of ExtendedConfigI
- The instance corresponding to this config.
- All Implemented Interfaces:
Comparable<ExtendedConfig<C,
I>>
- Direct Known Subclasses:
CapabilityConfig
,CreativeModeTabConfig
,DummyConfig
,ExtendedConfigForge
,FluidConfig
,RecipeConditionConfig
,TrunkPlacerConfig
,WorldStructureConfig
public abstract class ExtendedConfig<C extends ExtendedConfig<C,I>,I>
extends Object
implements Comparable<ExtendedConfig<C,I>>
A config that refers to a configurable.
Every unique configurable must have one unique extension of this class.
This extension can contain several configurable settings and properties
that can also be set in the config file.
-
Field Summary
Modifier and TypeFieldDescriptionA list ofConfigurablePropertyData
that can contain additional settings for this configurable. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ExtendedConfig<C, I> o) downCast()
Deprecated.protected String
getConfigPropertyPrefix
(ConfigurableProperty annotation) abstract ConfigurableType
Return the configurable type for which this config holds dataGet the full unlocalized name for this configurable.Will return the unique name of the object this config refers toabstract String
Get the unlocalized name (must be unique!) for this configurable.protected void
void
onConfigPropertyReload
(ConfigurablePropertyData<?> configProperty, boolean reload) Called when the config is loaded or reloadedvoid
Overridable method that is immediately called after this element has been registered into a Forge registry.void
Overridable method that is called after the element of this config is fully registered, after theFMLCommonSetupEvent
.protected void
save()
Save this config inside the correct element and inside the implementation if itself.void
Call this method in the initInstance method of Configurables if the instance was already set.
-
Field Details
-
configProperties
A list ofConfigurablePropertyData
that can contain additional settings for this configurable.
-
-
Constructor Details
-
ExtendedConfig
Create a new config- Parameters:
mod
- The mod instance.namedId
- A unique name idelementConstructor
- The element constructor.
-
-
Method Details
-
getConfigPropertyPrefix
- Parameters:
annotation
- The annotation to define the prefix for.- Returns:
- The prefix that will be used inside the config file for
ConfigurableProperty
's.
-
initializeInstance
protected void initializeInstance() -
save
protected void save()Save this config inside the correct element and inside the implementation if itself. -
getConfigurableType
Return the configurable type for which this config holds data- Returns:
- the type of the configurable to where the config belongs
-
getTranslationKey
Get the unlocalized name (must be unique!) for this configurable.- Returns:
- The unlocalized name.
-
getFullTranslationKey
Get the full unlocalized name for this configurable.- Returns:
- The unlocalized name.
-
getInstance
- Returns:
- Instance of the object this config refers to.
-
getSubUniqueName
Will return the unique name of the object this config refers to- Returns:
- unique name of sub object
-
onRegistered
public void onRegistered()Overridable method that is called after the element of this config is fully registered, after theFMLCommonSetupEvent
. -
onForgeRegistered
public void onForgeRegistered()Overridable method that is immediately called after this element has been registered into a Forge registry. -
compareTo
- Specified by:
compareTo
in interfaceComparable<C extends ExtendedConfig<C,
I>>
-
showDoubleInitError
public void showDoubleInitError()Call this method in the initInstance method of Configurables if the instance was already set. -
downCast
Deprecated.Get the lowest castable config.- Returns:
- The downcasted config.
-
onConfigPropertyReload
Called when the config is loaded or reloaded- Parameters:
reload
- If we are reloading, otherwise this is an initial load.configProperty
- The config property
-