Class ItemConfig
java.lang.Object
org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig<C,I>
org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfigForge<ItemConfig,net.minecraft.world.item.Item>
org.cyclops.cyclopscore.config.extendedconfig.ItemConfig
- All Implemented Interfaces:
Comparable<ExtendedConfig<ItemConfig,
,net.minecraft.world.item.Item>> IModelProviderConfig
public class ItemConfig
extends ExtendedConfigForge<ItemConfig,net.minecraft.world.item.Item>
implements IModelProviderConfig
Config for items.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionnet.minecraft.client.resources.model.ModelResourceLocation
Fields inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig
configProperties
-
Constructor Summary
ConstructorDescriptionItemConfig
(ModBase mod, String namedId, Function<ItemConfig, ? extends net.minecraft.world.item.Item> elementConstructor) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionReturn the configurable type for which this config holds dataprotected Collection<net.minecraft.world.item.ItemStack>
Get the full unlocalized name for this configurable.net.minecraft.client.color.item.ItemColor
getModelName
(net.minecraft.world.item.ItemStack itemStack) Get the model name for the given itemstack.net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.item.Item>
Get the unlocalized name (must be unique!) for this configurable.void
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
.net.minecraft.client.resources.model.ModelResourceLocation
Register default item models for this item.Methods inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfigForge
getResourceKey
Methods inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig
compareTo, downCast, getConfigPropertyPrefix, getInstance, getSubUniqueName, initializeInstance, onConfigPropertyReload, save, showDoubleInitError
-
Field Details
-
dynamicItemVariantLocation
public net.minecraft.client.resources.model.ModelResourceLocation dynamicItemVariantLocation
-
-
Constructor Details
-
ItemConfig
public ItemConfig(ModBase mod, String namedId, Function<ItemConfig, ? extends net.minecraft.world.item.Item> elementConstructor) Make a new instance.- Parameters:
mod
- The mod instance.namedId
- The unique name ID for the configurable.elementConstructor
- The element constructor.
-
-
Method Details
-
getModelName
Description copied from interface:IModelProviderConfig
Get the model name for the given itemstack.- Specified by:
getModelName
in interfaceIModelProviderConfig
- Parameters:
itemStack
- The item stack- Returns:
- The model name.
-
getTranslationKey
Description copied from class:ExtendedConfig
Get the unlocalized name (must be unique!) for this configurable.- Specified by:
getTranslationKey
in classExtendedConfig<ItemConfig,
net.minecraft.world.item.Item> - Returns:
- The unlocalized name.
-
getFullTranslationKey
Description copied from class:ExtendedConfig
Get the full unlocalized name for this configurable.- Overrides:
getFullTranslationKey
in classExtendedConfig<ItemConfig,
net.minecraft.world.item.Item> - Returns:
- The unlocalized name.
-
getConfigurableType
Description copied from class:ExtendedConfig
Return the configurable type for which this config holds data- Specified by:
getConfigurableType
in classExtendedConfig<ItemConfig,
net.minecraft.world.item.Item> - Returns:
- the type of the configurable to where the config belongs
-
registerDynamicModel
public net.minecraft.client.resources.model.ModelResourceLocation registerDynamicModel()Register default item models for this item. This should only be used when registering dynamic models.- Returns:
- The item resource location.
-
onRegistered
public void onRegistered()Description copied from class:ExtendedConfig
Overridable method that is called after the element of this config is fully registered, after theFMLCommonSetupEvent
.- Overrides:
onRegistered
in classExtendedConfig<ItemConfig,
net.minecraft.world.item.Item>
-
getDefaultCreativeTabEntries
-
onForgeRegistered
public void onForgeRegistered()Description copied from class:ExtendedConfig
Overridable method that is immediately called after this element has been registered into a Forge registry.- Overrides:
onForgeRegistered
in classExtendedConfig<ItemConfig,
net.minecraft.world.item.Item>
-
getRegistry
public net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.item.Item> getRegistry()- Specified by:
getRegistry
in classExtendedConfigForge<ItemConfig,
net.minecraft.world.item.Item> - Returns:
- The registry in which this should be registered.
-
getItemColorHandler
@Nullable public net.minecraft.client.color.item.ItemColor getItemColorHandler()- Returns:
- The color handler for the item instance.
-