@@ -75,17 +75,17 @@ private PaperDialogCodecs() {
7575 private static final MapCodec <DialogBody .PlainMessageBody > PLAIN_MESSAGE_BODY_CODEC = RecordCodecBuilder .mapCodec (instance -> instance .group (
7676 AdventureCodecs .COMPONENT_CODEC .fieldOf ("contents" ).forGetter (DialogBody .PlainMessageBody ::contents ),
7777 Dialog .WIDTH_CODEC .optionalFieldOf ("width" , PlainMessage .DEFAULT_WIDTH ).forGetter (DialogBody .PlainMessageBody ::width )
78- ).apply (instance , DialogBody ::plainMessageBody )
78+ ).apply (instance , DialogBody ::plainMessage )
7979 );
80- private static final Codec <DialogBody .PlainMessageBody > SIMPLE_PLAIN_MESSAGE_BODY_CODEC = Codec .withAlternative (PLAIN_MESSAGE_BODY_CODEC .codec (), AdventureCodecs .COMPONENT_CODEC , component -> DialogBody .plainMessageBody (component , PlainMessage .DEFAULT_WIDTH ));
80+ private static final Codec <DialogBody .PlainMessageBody > SIMPLE_PLAIN_MESSAGE_BODY_CODEC = Codec .withAlternative (PLAIN_MESSAGE_BODY_CODEC .codec (), AdventureCodecs .COMPONENT_CODEC , component -> DialogBody .plainMessage (component , PlainMessage .DEFAULT_WIDTH ));
8181 private static final MapCodec <DialogBody .ItemBody > ITEM_BODY_CODEC = RecordCodecBuilder .mapCodec (instance -> instance .group (
8282 ItemStack .STRICT_CODEC .xmap (CraftItemStack ::asBukkitCopy , CraftItemStack ::asNMSCopy ).fieldOf ("item" ).forGetter (DialogBody .ItemBody ::item ),
8383 SIMPLE_PLAIN_MESSAGE_BODY_CODEC .optionalFieldOf ("description" ).forGetter (body -> Optional .ofNullable (body .description ())),
8484 Codec .BOOL .optionalFieldOf ("show_decorations" , true ).forGetter (DialogBody .ItemBody ::showDecorations ),
8585 Codec .BOOL .optionalFieldOf ("show_tooltip" , true ).forGetter (DialogBody .ItemBody ::showTooltip ),
8686 Dialog .WIDTH_CODEC .optionalFieldOf ("width" , 16 ).forGetter (DialogBody .ItemBody ::width ),
8787 Dialog .WIDTH_CODEC .optionalFieldOf ("height" , 16 ).forGetter (DialogBody .ItemBody ::height )
88- ).apply (instance , (itemStack , plainMessageBody , showDecorations , showTooltip , width , height ) -> DialogBody .itemBody (itemStack , plainMessageBody .orElse (null ), showDecorations , showTooltip , width , height ))
88+ ).apply (instance , (itemStack , plainMessageBody , showDecorations , showTooltip , width , height ) -> DialogBody .item (itemStack , plainMessageBody .orElse (null ), showDecorations , showTooltip , width , height ))
8989 );
9090 private static final Registry <MapCodec <? extends DialogBody >> DIALOG_BODY_TYPES = Util .make (() -> {
9191 final MappedRegistry <MapCodec <? extends DialogBody >> registry = new MappedRegistry <>(ResourceKey .createRegistryKey (ResourceLocation .fromNamespaceAndPath (ResourceLocation .PAPER_NAMESPACE , "dialog_body_type" )), Lifecycle .experimental ());
@@ -106,7 +106,7 @@ private PaperDialogCodecs() {
106106 Codec .BOOL .optionalFieldOf ("initial" , false ).forGetter (BooleanDialogInputType ::initial ),
107107 Codec .STRING .optionalFieldOf ("on_true" , "true" ).forGetter (BooleanDialogInputType ::onTrue ),
108108 Codec .STRING .optionalFieldOf ("on_false" , "false" ).forGetter (BooleanDialogInputType ::onFalse )
109- ).apply (instance , DialogInputType ::booleanInputType )
109+ ).apply (instance , DialogInputType ::bool )
110110 );
111111 private static final MapCodec <NumberRangeDialogInputType > NUMBER_RANGE_INPUT_MAP_CODEC = RecordCodecBuilder .mapCodec (instance -> instance .group (
112112 Dialog .WIDTH_CODEC .optionalFieldOf ("width" , PlainMessage .DEFAULT_WIDTH ).forGetter (NumberRangeDialogInputType ::width ),
@@ -116,7 +116,7 @@ private PaperDialogCodecs() {
116116 Codec .FLOAT .fieldOf ("end" ).forGetter (NumberRangeDialogInputType ::end ),
117117 Codec .FLOAT .optionalFieldOf ("initial" ).forGetter (type -> Optional .ofNullable (type .initial ())),
118118 ExtraCodecs .POSITIVE_FLOAT .optionalFieldOf ("step" ).forGetter (type -> Optional .ofNullable (type .step ()))
119- ).apply (instance , (width , label , labelFormat , start , end , initial , step ) -> DialogInputType .numberRangeInputType (width , label , labelFormat , start , end , initial .orElse (null ), step .orElse (null )))
119+ ).apply (instance , (width , label , labelFormat , start , end , initial , step ) -> DialogInputType .numberRange (width , label , labelFormat , start , end , initial .orElse (null ), step .orElse (null )))
120120 );
121121 private static final Codec <SingleOptionDialogInputType .OptionEntry > SINGLE_OPTION_DIALOG_INPUT_ENTRY_FULL_CODEC = RecordCodecBuilder .create (instance -> instance .group (
122122 Codec .STRING .fieldOf ("id" ).forGetter (SingleOptionDialogInputType .OptionEntry ::id ),
@@ -132,7 +132,7 @@ private PaperDialogCodecs() {
132132 ExtraCodecs .nonEmptyList (SINGLE_OPTION_DIALOG_INPUT_ENTRY_CODEC .listOf ()).fieldOf ("options" ).forGetter (SingleOptionDialogInputType ::entries ),
133133 AdventureCodecs .COMPONENT_CODEC .fieldOf ("label" ).forGetter (SingleOptionDialogInputType ::label ),
134134 Codec .BOOL .optionalFieldOf ("label_visible" , true ).forGetter (SingleOptionDialogInputType ::labelVisible )
135- ).apply (instance , DialogInputType ::singleOptionInputType )
135+ ).apply (instance , DialogInputType ::singleOption )
136136 );
137137 private static final Codec <TextDialogInputType .MultilineOptions > TEXT_DIALOG_INPUT_MULTILINE_OPTIONS_CODEC = RecordCodecBuilder .create (instance -> instance .group (
138138 ExtraCodecs .POSITIVE_INT .optionalFieldOf ("max_lines" ).forGetter (options -> Optional .ofNullable (options .maxLines ())),
@@ -147,7 +147,7 @@ private PaperDialogCodecs() {
147147 ExtraCodecs .POSITIVE_INT .optionalFieldOf ("max_length" , 32 ).forGetter (TextDialogInputType ::maxLength ),
148148 TEXT_DIALOG_INPUT_MULTILINE_OPTIONS_CODEC .optionalFieldOf ("multiline" ).forGetter (inputType -> Optional .ofNullable (inputType .multiline ()))
149149 ).apply (instance , (width , label , labelVisible , initial , maxLength , multilineOptions ) ->
150- DialogInputType .textInputType (width , label , labelVisible , initial , maxLength , multilineOptions .orElse (null ))
150+ DialogInputType .text (width , label , labelVisible , initial , maxLength , multilineOptions .orElse (null ))
151151 )
152152 );
153153 private static final Registry <MapCodec <? extends DialogInputType >> DIALOG_INPUT_TYPES = Util .make (() -> {
0 commit comments