Skip to content

Commit f6193d3

Browse files
committed
feature(api): UI sound source and missing source documentation
1 parent 2f26f44 commit f6193d3

File tree

2 files changed

+93
-2
lines changed

2 files changed

+93
-2
lines changed

api/src/main/java/net/kyori/adventure/sound/Sound.java

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,110 @@ public interface Sound extends Examinable {
229229
/**
230230
* The sound source.
231231
*
232+
* <p>The documentation for each source details the vanilla use.</p>
233+
*
232234
* @since 4.0.0
233235
*/
234236
enum Source {
237+
/**
238+
* The main sound source.
239+
*
240+
* <p>This source controls the overall sound of the game.</p>
241+
*
242+
* @since 4.0.0
243+
*/
235244
MASTER("master"),
245+
246+
/**
247+
* The music sound source.
248+
*
249+
* <p>This source handles the in-game soundtrack.</p>
250+
*
251+
* @since 4.0.0
252+
*/
236253
MUSIC("music"),
254+
255+
/**
256+
* The record sound source.
257+
*
258+
* <p>This source handles jukeboxes and note blocks.</p>
259+
*
260+
* @since 4.0.0
261+
*/
237262
RECORD("record"),
263+
264+
/**
265+
* The weather sound source.
266+
*
267+
* <p>This source handles weather sounds.</p>
268+
*
269+
* @since 4.0.0
270+
*/
238271
WEATHER("weather"),
272+
273+
/**
274+
* The block sound source.
275+
*
276+
* <p>This source handles player interaction with blocks as well as passive block sounds.</p>
277+
*
278+
* @since 4.0.0
279+
*/
239280
BLOCK("block"),
281+
282+
/**
283+
* The hostile sound source.
284+
*
285+
* <p>This source handles hostile entities.</p>
286+
*
287+
* @since 4.0.0
288+
*/
240289
HOSTILE("hostile"),
290+
291+
/**
292+
* The neutral sound source.
293+
*
294+
* <p>This source handles neutral entities.</p>
295+
*
296+
* @since 4.0.0
297+
*/
241298
NEUTRAL("neutral"),
299+
300+
/**
301+
* The player sound source.
302+
*
303+
* <p>This source handles player entities.</p>
304+
*
305+
* @since 4.0.0
306+
*/
242307
PLAYER("player"),
308+
309+
/**
310+
* The ambient sound source.
311+
*
312+
* <p>This source handles ambience.</p>
313+
*
314+
* @since 4.0.0
315+
*/
243316
AMBIENT("ambient"),
244-
VOICE("voice");
317+
318+
/**
319+
* The voice sound source.
320+
*
321+
* <p>This source handles the narrator.</p>
322+
*
323+
* @since 4.0.0
324+
*/
325+
VOICE("voice"),
326+
327+
/**
328+
* The UI sound source.
329+
*
330+
* <p>This source handles UI actions.</p>
331+
*
332+
* @since 4.22.0
333+
* @sinceMinecraft 1.21.6
334+
*/
335+
UI("ui");
245336

246337
/**
247338
* The name map.

api/src/main/java/net/kyori/adventure/sound/SoundImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public float pitch() {
7373
}
7474

7575
@Override
76-
public OptionalLong seed() {
76+
public @NotNull OptionalLong seed() {
7777
return this.seed;
7878
}
7979

0 commit comments

Comments
 (0)