Ensure Location is still sealed, and add api description annotation to public methods in UncheckedWorldLocation

This commit is contained in:
dordsor21 2022-06-11 13:04:05 +01:00
parent 8608604306
commit 058c65e34c
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@ import org.khelekore.prtree.SimpleMBR;
* An unmodifiable 6-tuple (world,x,y,z,yaw,pitch) * An unmodifiable 6-tuple (world,x,y,z,yaw,pitch)
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class Location extends BlockLoc implements Comparable<Location> { public sealed class Location extends BlockLoc implements Comparable<Location> permits UncheckedWorldLocation {
private final float yaw; private final float yaw;
private final float pitch; private final float pitch;

View File

@ -36,7 +36,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
* @since TODO * @since TODO
*/ */
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
public class UncheckedWorldLocation extends Location { public final class UncheckedWorldLocation extends Location {
private final String worldName; private final String worldName;
@ -61,6 +61,7 @@ public class UncheckedWorldLocation extends Location {
* *
* @since TODO * @since TODO
*/ */
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
public static @NonNull UncheckedWorldLocation at( public static @NonNull UncheckedWorldLocation at(
final @NonNull String world, final int x, final int y, final int z final @NonNull String world, final int x, final int y, final int z
) { ) {
@ -68,6 +69,7 @@ public class UncheckedWorldLocation extends Location {
} }
@Override @Override
@AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.")
public @NonNull String getWorldName() { public @NonNull String getWorldName() {
return this.worldName; return this.worldName;
} }