Class DefaultModDisplayInfo
java.lang.Object
net.neoforged.neoforge.client.gui.modlist.DefaultModDisplayInfo
- All Implemented Interfaces:
IExtensionPoint, ModDisplayInfo
The default implementation of
ModDisplayInfo.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ModContainerprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthors()Returns the mod authors.banner()Returns the banner displayed in the info panel, ornull.convertPath(String path) Converts a given path string into anImageResource.credits()Returns the credits.Returns the mod description.Returns the display name.Returns the URL for the mod homepage, ornull.booleaninthashCode()icon()Returns the icon displayed in the mod list, ornull.booleaniconBlur()Returns whether linear filtering should be used when scaling the icon.id()Returns the mod ID.Returns the URL for the mod issues page, ornull.license()Returns the mod license.toString()version()Returns the mod version.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
container
-
-
Constructor Details
-
DefaultModDisplayInfo
-
-
Method Details
-
id
Returns the mod ID. This is used to retrieve the mod container, configuration screen extension point, and other relevant information.- Specified by:
idin interfaceModDisplayInfo- Returns:
- the mod ID
-
displayName
Returns the display name. This is always displayed, even if empty. Click actions do not work on this component.- Specified by:
displayNamein interfaceModDisplayInfo- Returns:
- the display name
-
version
Returns the mod version. This is always displayed, even if empty.- Specified by:
versionin interfaceModDisplayInfo- Returns:
- the mod version
-
authors
Returns the mod authors. This is displayed if it is not an empty component. This pulls from theauthorskey of the mod info.- Specified by:
authorsin interfaceModDisplayInfo- Returns:
- the mod authors
-
credits
Returns the credits. This is displayed if it is not an empty component. This pulls from thecreditskey of the mod info.- Specified by:
creditsin interfaceModDisplayInfo- Returns:
- the credits
-
description
Returns the mod description. This is displayed if it is not an empty component. This uses the translation keyneoforge.screen.mods.info.description.[modid]if available, falling back to the deprecated translation keyfml.menu.mods.info.description.[modid]if available, where[modid]is the mod ID, with a fallback to thedescriptionkey of the mod info.- Specified by:
descriptionin interfaceModDisplayInfo- Returns:
- the mod description
-
license
Returns the mod license. This is always displayed, even if empty. This uses thelicensekey of the mod file info. If thelicenseURLkey of the mod file info is set and is a valid URL, then this component has an open URL click action with that URL.- Specified by:
licensein interfaceModDisplayInfo- Returns:
- the mod license
-
banner
Returns the banner displayed in the info panel, or
null.The banner is rendered with its original aspect ratio, bounded by the width of the info panel (ordinarily 250 pixels) and a maximum height of 50 pixels.
This uses the `bannerFile` key of the mod info or, if not available, the mod file info.If
bannerFileis not available in both, the same sources are searched forlogoFile.- Specified by:
bannerin interfaceModDisplayInfo- Returns:
- the banner displayed in the info panel, or
null - See Also:
-
icon
Returns the icon displayed in the mod list, or
null.The icon is rendered as a square with sides of 24 pixels.
This uses the `iconFile` key of the mod info or, if not available, the mod file info.- Specified by:
iconin interfaceModDisplayInfo- Returns:
- the icon displayed in the mod list, or
null - See Also:
-
iconBlur
public boolean iconBlur()Returns whether linear filtering should be used when scaling the icon. This uses theiconBlurkey of the mod info or, if not available, the mod file info.- Specified by:
iconBlurin interfaceModDisplayInfo- Returns:
- whether linear filtering should be used when scaling the icon
-
convertPath
Converts a given path string into an
ImageResource.The logic for converting a path is as follows, in order:
- If the path contains a pound sign (
#), it is taken as a root resource with the parts before and after the pound sign taken as the pack ID and the resource path, respectively. - If the path has a colon (
:), is it taken as a pack asset. - Otherwise, it is assumed to be a root resource with the mod's resource pack as determined by
ResourcePackLoader.getPackName(IModFile).
- Parameters:
path- the path to convert- Returns:
- the image resource
- If the path contains a pound sign (
-
displayUrl
Returns the URL for the mod homepage, ornull. Ifnull, the homepage button is disabled. This uses thedisplayURLor, if not available, themodUrlkey from the mod info.- Specified by:
displayUrlin interfaceModDisplayInfo- Returns:
- the URL for the mod homepage, or
null
-
issuesUrl
Returns the URL for the mod issues page, ornull. Ifnull, the issues page button is disabled. This uses theissueTrackerURLkey of the mod info or, if not available, the mod file info.- Specified by:
issuesUrlin interfaceModDisplayInfo- Returns:
- the URL for the mod issues page, or
null
-
container
-
equals
-
hashCode
-
toString
-