mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-23 00:21:26 +01:00
Move assert
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
031d9253a3
commit
60d22929a1
@ -269,13 +269,11 @@ public class Tag<T> {
|
||||
|
||||
@ApiStatus.Experimental
|
||||
public static <T extends Record> @NotNull Tag<T> Structure(@NotNull String key, @NotNull Class<T> type) {
|
||||
assert type.isRecord();
|
||||
return Structure(key, TagRecord.serializer(type));
|
||||
}
|
||||
|
||||
@ApiStatus.Experimental
|
||||
public static <T extends Record> @NotNull Tag<T> View(@NotNull Class<T> type) {
|
||||
assert type.isRecord();
|
||||
return View(TagRecord.serializer(type));
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ final class TagRecord {
|
||||
};
|
||||
|
||||
static <T extends Record> @NotNull Serializer<T> serializer(@NotNull Class<T> type) {
|
||||
assert type.isRecord();
|
||||
//noinspection unchecked
|
||||
return (Serializer<T>) serializers.get(type);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user