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
FieldsModifier and TypeFieldDescriptionnet.minecraft.client.resources.model.ModelResourceLocationFields inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfig
configProperties -
Constructor Summary
ConstructorsConstructorDescriptionItemConfig(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.ItemColorgetModelName(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.voidOverridable method that is immediately called after this element has been registered into a Forge registry.voidOverridable method that is called after the element of this config is fully registered, after theFMLCommonSetupEvent.net.minecraft.client.resources.model.ModelResourceLocationRegister default item models for this item.Methods inherited from class org.cyclops.cyclopscore.config.extendedconfig.ExtendedConfigForge
getResourceKeyMethods 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:IModelProviderConfigGet the model name for the given itemstack.- Specified by:
getModelNamein interfaceIModelProviderConfig- Parameters:
itemStack- The item stack- Returns:
- The model name.
-
getTranslationKey
Description copied from class:ExtendedConfigGet the unlocalized name (must be unique!) for this configurable.- Specified by:
getTranslationKeyin classExtendedConfig<ItemConfig,net.minecraft.world.item.Item> - Returns:
- The unlocalized name.
-
getFullTranslationKey
Description copied from class:ExtendedConfigGet the full unlocalized name for this configurable.- Overrides:
getFullTranslationKeyin classExtendedConfig<ItemConfig,net.minecraft.world.item.Item> - Returns:
- The unlocalized name.
-
getConfigurableType
Description copied from class:ExtendedConfigReturn the configurable type for which this config holds data- Specified by:
getConfigurableTypein 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:ExtendedConfigOverridable method that is called after the element of this config is fully registered, after theFMLCommonSetupEvent.- Overrides:
onRegisteredin classExtendedConfig<ItemConfig,net.minecraft.world.item.Item>
-
getDefaultCreativeTabEntries
-
onForgeRegistered
public void onForgeRegistered()Description copied from class:ExtendedConfigOverridable method that is immediately called after this element has been registered into a Forge registry.- Overrides:
onForgeRegisteredin classExtendedConfig<ItemConfig,net.minecraft.world.item.Item>
-
getRegistry
public net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.item.Item> getRegistry()- Specified by:
getRegistryin 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.
-