From 058c65e34c266217e6a9959197343e49827df33c Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sat, 11 Jun 2022 13:04:05 +0100 Subject: [PATCH] Ensure Location is still sealed, and add api description annotation to public methods in UncheckedWorldLocation --- .../src/main/java/com/plotsquared/core/location/Location.java | 2 +- .../com/plotsquared/core/location/UncheckedWorldLocation.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/location/Location.java b/Core/src/main/java/com/plotsquared/core/location/Location.java index 24f3e43d5..91200eb39 100644 --- a/Core/src/main/java/com/plotsquared/core/location/Location.java +++ b/Core/src/main/java/com/plotsquared/core/location/Location.java @@ -41,7 +41,7 @@ import org.khelekore.prtree.SimpleMBR; * An unmodifiable 6-tuple (world,x,y,z,yaw,pitch) */ @SuppressWarnings("unused") -public class Location extends BlockLoc implements Comparable { +public sealed class Location extends BlockLoc implements Comparable permits UncheckedWorldLocation { private final float yaw; private final float pitch; diff --git a/Core/src/main/java/com/plotsquared/core/location/UncheckedWorldLocation.java b/Core/src/main/java/com/plotsquared/core/location/UncheckedWorldLocation.java index aab412cb6..1e9b1a5bb 100644 --- a/Core/src/main/java/com/plotsquared/core/location/UncheckedWorldLocation.java +++ b/Core/src/main/java/com/plotsquared/core/location/UncheckedWorldLocation.java @@ -36,7 +36,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; * @since TODO */ @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; @@ -61,6 +61,7 @@ public class UncheckedWorldLocation extends Location { * * @since TODO */ + @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") public static @NonNull UncheckedWorldLocation at( final @NonNull String world, final int x, final int y, final int z ) { @@ -68,6 +69,7 @@ public class UncheckedWorldLocation extends Location { } @Override + @AnnotationHelper.ApiDescription(info = "Internal use only. Subject to changes at any time.") public @NonNull String getWorldName() { return this.worldName; }