Repository navigation
Start javadocs on Identifier #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 26.3
Are you sure you want to change the base?
Changes from all commits
457114a
b849562
aa8394f
a9ecc71
9919f58
2e5f523
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||
| CLASS net/minecraft/resources/Identifier | ||||||
| COMMENT `Identifier`s are used in Minecraft's code to identify a resource's location. | ||||||
| COMMENT To avoid ambiguity, they consist of a namespace representing the creator of the resource and the path to the resource. | ||||||
| COMMENT When converted to a string, the namespace and path are combined becoming `namespace:path`. | ||||||
| METHOD assertValidPath (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; | ||||||
| COMMENT @throws IdentifierException if the path contains a non `[a-z0-9/._-]` character. | ||||||
| METHOD fromNamespaceAndPath (Ljava/lang/String;Ljava/lang/String;)Lnet/minecraft/resources/Identifier; | ||||||
| COMMENT Creates an identifier from a namespace and a path. | ||||||
| COMMENT @param namespace the namespace, restricted to `[a-z0-9_.-]`. | ||||||
| COMMENT @param path the path, restricted to `[a-z0-9/._-]` | ||||||
| COMMENT @return an `Identifier` created from the namespace and path. | ||||||
| COMMENT @throws IdentifierException if either string contains an invalid character. | ||||||
| METHOD toLanguageKey ()Ljava/lang/String; | ||||||
| COMMENT @return A translation key in the format `namespace.path`. | ||||||
| METHOD toLanguageKey (Ljava/lang/String;)Ljava/lang/String; | ||||||
| COMMENT @return A translation key in the format `prefix.namespace.path`. | ||||||
| METHOD toLanguageKey (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; | ||||||
| COMMENT @return A translation key in the format `prefix.namespace.path.suffix`. | ||||||
| METHOD toShortLanguageKey ()Ljava/lang/String; | ||||||
| COMMENT @return A translation key in the format `namespace.path`. If the namespace is `minecraft`, the translation key is shortened to `path`. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we reference other methods? For example: Similar to [toLanguageKey], but drops the default [namespace] `minecraft`.Question: can multiple @return A translation key in the format `namespace.path`.
@return A translation key in the format `path`, if the [namespace] is {@value #DEFAULT_NAMESPACE}.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think referencing other methods makes sense. Multiple
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It isn't? |
||||||
| METHOD tryBuild (Ljava/lang/String;Ljava/lang/String;)Lnet/minecraft/resources/Identifier; | ||||||
| COMMENT Creates an `Identifier` from a namespace and a path. | ||||||
| COMMENT @param namespace the namespace, restricted to `[a-z0-9_.-]`. | ||||||
| COMMENT @param path the path, restricted to `[a-z0-9/._-]` | ||||||
| COMMENT @return an `Identifier` created from the namespace and path, or `null` if either string contains an invalid character. | ||||||
| METHOD withDefaultNamespace (Ljava/lang/String;)Lnet/minecraft/resources/Identifier; | ||||||
| COMMENT Creates an `Identifier` with the namespace set to [DEFAULT_NAMESPACE]. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Renders like this, which reads more like a sentence:
|
||||||
| COMMENT @param path the path, restricted to `[a-z0-9/._-]` | ||||||
| METHOD withPath (Ljava/lang/String;)Lnet/minecraft/resources/Identifier; | ||||||
| COMMENT @param newPath the path, restricted to `[a-z0-9/._-]` | ||||||
| COMMENT @return a new `Identifier` with the same namespace and a different path. | ||||||
| METHOD withPath (Ljava/util/function/UnaryOperator;)Lnet/minecraft/resources/Identifier; | ||||||
| COMMENT @param modifier a modifier to prepend to the existing path, with the result restricted to `[a-z0-9/._-]` | ||||||
| COMMENT @return creates a new `Identifier` with the same namespace and a different path. | ||||||
| METHOD withPrefix (Ljava/lang/String;)Lnet/minecraft/resources/Identifier; | ||||||
| COMMENT @param prefix a string to prepend to the existing path, restricted to `[a-z0-9/._-]` | ||||||
| COMMENT @return a new `Identifier` with the same namespace and a different path. | ||||||
| METHOD withSuffix (Ljava/lang/String;)Lnet/minecraft/resources/Identifier; | ||||||
| COMMENT @param suffix a string to append to the existing path, restricted to `[a-z0-9/._-]` | ||||||
| COMMENT @return a new `Identifier` with the same namespace and a different path. | ||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Docs' refreshed guidelines say: "Avoid specifying that the [modded] game is Minecraft"
Should we apply that rule to Annotater too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we should not apply that to the annotator, since the code is not modified yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's even more of a reason why mentioning "Minecraft" is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annotater's guidelines don't specify this, I think the clarification is fine.