|
27 | 27 | import net.kyori.adventure.audience.Audience; |
28 | 28 | import net.kyori.adventure.text.Component; |
29 | 29 | import net.kyori.adventure.text.event.ClickEvent; |
30 | | -import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; |
31 | | -import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; |
32 | | -import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer; |
33 | 30 | import org.spongepowered.api.Sponge; |
34 | 31 | import org.spongepowered.api.command.CommandCause; |
35 | 32 | import org.spongepowered.api.registry.DefaultedRegistryReference; |
@@ -102,97 +99,13 @@ public static Component resolve( |
102 | 99 | return SpongeComponents.factory().render(component, senderContext, resolver, otherResolvers); |
103 | 100 | } |
104 | 101 |
|
105 | | - /** |
106 | | - * Get a serializer for {@link Component}s that will convert to and from the |
107 | | - * legacy component format used by the Vanilla client. |
108 | | - * |
109 | | - * <p>This legacy serializer uses the standard section symbol to mark |
110 | | - * formatting characters.</p> |
111 | | - * |
112 | | - * <p>Implementations may provide a serializer capable of processing any |
113 | | - * information that requires access to implementation details.</p> |
114 | | - * |
115 | | - * @return a section serializer |
116 | | - */ |
117 | | - public static LegacyComponentSerializer legacySectionSerializer() { |
118 | | - return SpongeComponents.factory().legacySectionSerializer(); |
119 | | - } |
120 | | - |
121 | | - /** |
122 | | - * Get a serializer for {@link Component}s that will convert to and from the |
123 | | - * legacy component format used by the Vanilla client. |
124 | | - * |
125 | | - * <p>This legacy serializer uses the alternate ampersand symbol ({@code &}) |
126 | | - * to mark formatting characters.</p> |
127 | | - * |
128 | | - * <p>Implementations may provide a serializer capable of processing any |
129 | | - * information that requires access to implementation details.</p> |
130 | | - * |
131 | | - * @return a legacy serializer using ampersands |
132 | | - */ |
133 | | - public static LegacyComponentSerializer legacyAmpersandSerializer() { |
134 | | - return SpongeComponents.factory().legacyAmpersandSerializer(); |
135 | | - } |
136 | | - |
137 | | - /** |
138 | | - * Get a serializer for {@link Component}s that will convert to and from the |
139 | | - * legacy component format used by the Vanilla client. |
140 | | - * |
141 | | - * <p>Implementations may provide a serializer capable of processing any |
142 | | - * information that requires access to implementation details.</p> |
143 | | - * |
144 | | - * @param formatChar the format character to use in place of the standard |
145 | | - * section symbol |
146 | | - * @return a legacy serializer using ampersands |
147 | | - */ |
148 | | - public static LegacyComponentSerializer legacySerializer(final char formatChar) { |
149 | | - return SpongeComponents.factory().legacySerializer(formatChar); |
150 | | - } |
151 | | - |
152 | | - /** |
153 | | - * Get a serializer for {@link Component}s that will convert to and from the |
154 | | - * standard JSON serialization format using Gson. |
155 | | - * |
156 | | - * <p>Implementations may provide a serializer capable of processing any |
157 | | - * information that requires implementation details, such as legacy |
158 | | - * (pre-1.16) hover events.</p> |
159 | | - * |
160 | | - * @return a json component serializer |
161 | | - */ |
162 | | - public static GsonComponentSerializer gsonSerializer() { |
163 | | - return SpongeComponents.factory().gsonSerializer(); |
164 | | - } |
165 | | - |
166 | | - /** |
167 | | - * Get a serializer for {@link Component}s that will convert components to |
168 | | - * a plain-text string. |
169 | | - * |
170 | | - * <p>Implementations may provide a serializer capable of processing any |
171 | | - * information that requires access to implementation details.</p> |
172 | | - * |
173 | | - * @return a serializer to plain text |
174 | | - */ |
175 | | - public static PlainComponentSerializer plainSerializer() { |
176 | | - return SpongeComponents.factory().plainSerializer(); |
177 | | - } |
178 | | - |
179 | 102 | private static Factory factory() { |
180 | 103 | return Sponge.game().factoryProvider().provide(Factory.class); |
181 | 104 | } |
182 | 105 |
|
183 | 106 | public interface Factory { |
184 | 107 | ClickEvent callbackClickEvent(final Consumer<CommandCause> callback); |
185 | 108 |
|
186 | | - LegacyComponentSerializer legacySectionSerializer(); |
187 | | - |
188 | | - LegacyComponentSerializer legacyAmpersandSerializer(); |
189 | | - |
190 | | - LegacyComponentSerializer legacySerializer(final char formatChar); |
191 | | - |
192 | | - GsonComponentSerializer gsonSerializer(); |
193 | | - |
194 | | - PlainComponentSerializer plainSerializer(); |
195 | | - |
196 | 109 | @SuppressWarnings("unchecked") |
197 | 110 | Component render( |
198 | 111 | final Component component, |
|
0 commit comments