diff --git a/mappings/net/minecraft/client/gui/screen/Screen.mapping b/mappings/net/minecraft/client/gui/screen/Screen.mapping index 074b28dfae..f0f5bc3699 100644 --- a/mappings/net/minecraft/client/gui/screen/Screen.mapping +++ b/mappings/net/minecraft/client/gui/screen/Screen.mapping @@ -151,9 +151,12 @@ CLASS net/minecraft/class_437 net/minecraft/client/gui/screen/Screen METHOD method_37063 addDrawableChild (Lnet/minecraft/class_364;)Lnet/minecraft/class_364; ARG 1 drawableElement METHOD method_37064 narrateScreenIfNarrationEnabled (Z)V - ARG 1 useTranslationsCache + COMMENT If narration is enabled, narrates the elements of this screen. + ARG 1 onlyChangedNarrations + COMMENT if {@code true}, the text will not include unchanged narrations that have + COMMENT already been narrated previously METHOD method_37065 narrateScreen (Z)V - ARG 1 useTranslationsCache + ARG 1 onlyChangedNarrations METHOD method_37066 remove (Lnet/minecraft/class_364;)V ARG 1 child METHOD method_37067 clearChildren ()V diff --git a/mappings/net/minecraft/client/gui/screen/narration/Narration.mapping b/mappings/net/minecraft/client/gui/screen/narration/Narration.mapping index 9224aa677e..94778e9921 100644 --- a/mappings/net/minecraft/client/gui/screen/narration/Narration.mapping +++ b/mappings/net/minecraft/client/gui/screen/narration/Narration.mapping @@ -1,5 +1,11 @@ CLASS net/minecraft/class_6384 net/minecraft/client/gui/screen/narration/Narration + COMMENT A narration is a message consisting of a list of string "sentences". + COMMENT The sentences can be iterated using {@link #forEachSentence forEachSentence}. + COMMENT + COMMENT
Narrations are attached to {@linkplain NarrationPart narration parts}
+ COMMENT using {@link NarrationMessageBuilder#put(NarrationPart, Narration)}.
FIELD field_33793 EMPTY Lnet/minecraft/class_6384;
+ COMMENT An empty narration that contains no sentences.
FIELD field_33794 value Ljava/lang/Object;
FIELD field_33795 transformer Ljava/util/function/BiConsumer;
METHOD Narration messages consist of multiple sections known as
+ COMMENT {@linkplain NarrationPart parts}. Each narration message can
+ COMMENT contain only one narration per part.
+ COMMENT
+ COMMENT You can create a submessage by calling {@link #nextMessage()}.
+ COMMENT Each submessage can have its own set of narrations for the different
+ COMMENT narration parts.
+ COMMENT
+ COMMENT The narrations added to a message will be ordered by their part
+ COMMENT first, in {@link NarrationPart}'s natural ordering. If there are multiple
+ COMMENT narrations for a part added through submessages, they will be ordered earliest
+ COMMENT submessage first.
METHOD method_37031 nextMessage ()Lnet/minecraft/class_6382;
+ COMMENT Creates a narration message builder for a submessage.
+ COMMENT
+ COMMENT Submessages can have their own set of narrations for the narration parts,
+ COMMENT which are merged with the "parent" message's narrations
+ COMMENT as described above.
+ COMMENT
+ COMMENT @apiNote All returned builder instances are equivalent and refer to the same
+ COMMENT submessage. If you want to add yet another set of narrations, call this method
+ COMMENT again on the first submessage builder to obtain a "nested" submessage builder.
+ COMMENT
+ COMMENT @return the created builder
METHOD method_37032 put (Lnet/minecraft/class_6381;Lnet/minecraft/class_6384;)V
+ COMMENT Adds a narration to this message builder.
+ COMMENT
+ COMMENT If a narration already exists for the specified narration part,
+ COMMENT it is replaced by the new narration.
+ COMMENT
+ COMMENT @see #put(NarrationPart, Text)
+ COMMENT @see #put(NarrationPart, String)
+ COMMENT @see #put(NarrationPart, Text...)
ARG 1 part
ARG 2 narration
METHOD method_37033 put (Lnet/minecraft/class_6381;Ljava/lang/String;)V
+ COMMENT Adds a string narration to this message builder.
+ COMMENT
+ COMMENT If a narration already exists for the specified narration part,
+ COMMENT it is replaced by the new narration.
ARG 1 part
ARG 2 string
+ COMMENT the message for the narration
METHOD method_37034 put (Lnet/minecraft/class_6381;Lnet/minecraft/class_2561;)V
+ COMMENT Adds a {@link Text} narration to this message builder.
+ COMMENT
+ COMMENT If a narration already exists for the specified narration part,
+ COMMENT it is replaced by the new narration.
+ COMMENT
+ COMMENT @implSpec The default implementation behaves like
+ COMMENT {@code put(part, text.getString())}.
ARG 1 part
ARG 2 text
+ COMMENT the message for the narration
METHOD method_37035 put (Lnet/minecraft/class_6381;[Lnet/minecraft/class_2561;)V
+ COMMENT Adds an array of {@link Text} narrations to this message builder.
+ COMMENT
+ COMMENT Each {@link Text} in the input array will be its own sentence
+ COMMENT as described in {@link Narration#texts}.
+ COMMENT
+ COMMENT If a narration already exists for the specified narration part,
+ COMMENT it is replaced by the new narration.
+ COMMENT
+ COMMENT @implSpec The default implementation creates a {@link Narration} for the
+ COMMENT texts using {@link Narration#texts}.
ARG 1 part
ARG 2 texts
+ COMMENT the messages for the narration
diff --git a/mappings/net/minecraft/client/gui/screen/narration/NarrationPart.mapping b/mappings/net/minecraft/client/gui/screen/narration/NarrationPart.mapping
index 5373433e1e..71a9efc79a 100644
--- a/mappings/net/minecraft/client/gui/screen/narration/NarrationPart.mapping
+++ b/mappings/net/minecraft/client/gui/screen/narration/NarrationPart.mapping
@@ -1 +1,12 @@
CLASS net/minecraft/class_6381 net/minecraft/client/gui/screen/narration/NarrationPart
+ COMMENT A component of a {@linkplain NarrationMessageBuilder narration message}.
+ COMMENT This enum is mostly used for grouping and ordering narrations in a narration
+ COMMENT message.
+ FIELD field_33788 Lnet/minecraft/class_6381;
+ COMMENT The main narration for a narrated element.
+ FIELD field_33789 Lnet/minecraft/class_6381;
+ COMMENT The position of a narrated element in a container such as a list.
+ FIELD field_33790 Lnet/minecraft/class_6381;
+ COMMENT A hint for a narrated element, e.g. a button tooltip.
+ FIELD field_33791 Lnet/minecraft/class_6381;
+ COMMENT Usage instructions for a narrated element.
diff --git a/mappings/net/minecraft/client/gui/screen/narration/ScreenNarrator.mapping b/mappings/net/minecraft/client/gui/screen/narration/ScreenNarrator.mapping
index a8c61ba7f2..b2d043cd8d 100644
--- a/mappings/net/minecraft/client/gui/screen/narration/ScreenNarrator.mapping
+++ b/mappings/net/minecraft/client/gui/screen/narration/ScreenNarrator.mapping
@@ -1,12 +1,25 @@
CLASS net/minecraft/class_6385 net/minecraft/client/gui/screen/narration/ScreenNarrator
+ COMMENT Manages narration messages and combines them into a narrated string.
FIELD field_33796 currentMessageIndex I
FIELD field_33797 narrations Ljava/util/Map;
METHOD method_37043 (Lnet/minecraft/class_6385$class_6386;)Ljava/lang/Integer;
ARG 0 partIndex
METHOD method_37044 buildNarrations (Ljava/util/function/Consumer;)V
+ COMMENT Creates the narration messages for the next narration using a
+ COMMENT {@link NarrationMessageBuilder}.
ARG 1 builderConsumer
+ COMMENT a consumer that adds the narrations to a {@link NarrationMessageBuilder}
METHOD method_37045 buildNarratorText (Z)Ljava/lang/String;
- ARG 1 forceTransform
+ COMMENT Builds a text representation of the narrations produced by the last call to
+ COMMENT {@link #buildNarrations buildNarrations}.
+ COMMENT
+ COMMENT @implNote Contains all sentences in the narrations of the current narration
+ COMMENT message separated by {@code ". "}, ordered as described in
+ COMMENT {@link NarrationMessageBuilder}.
+ COMMENT @return the created narrator text
+ ARG 1 includeUnchanged
+ COMMENT if {@code true}, the text will include unchanged messages that have
+ COMMENT already been included in the output of this method previously
METHOD method_37046 (ZLjava/util/function/Consumer;Lnet/minecraft/class_6385$class_6386;Lnet/minecraft/class_6385$class_6387;)V
ARG 3 partIndex
ARG 4 message
@@ -18,20 +31,20 @@ CLASS net/minecraft/class_6385 net/minecraft/client/gui/screen/narration/ScreenN
ARG 1 sentence
CLASS class_6386 PartIndex
FIELD field_33801 part Lnet/minecraft/class_6381;
- FIELD field_33802 messageIndex I
+ FIELD field_33802 depth I
METHOD