Finish converting most of the undeprecated api to jspecify

This commit is contained in:
Jake Potrebic
2024-09-30 11:44:36 -07:00
parent 29a25df60e
commit 0adf5876db
45 changed files with 782 additions and 718 deletions

View File

@@ -15,13 +15,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.Fluid;
+import org.bukkit.Location;
+import org.bukkit.util.Vector;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Range;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * A representation of a fluid in a specific state of data.
+ * This type is not linked to a specific location and hence mostly resembles a {@link org.bukkit.block.data.BlockData}.
+ */
+@NullMarked
+public interface FluidData extends Cloneable {
+
+ /**
@@ -29,14 +30,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return the fluid type
+ */
+ @NotNull Fluid getFluidType();
+ Fluid getFluidType();
+
+ /**
+ * Returns a copy of this FluidData.
+ *
+ * @return a copy of the fluid data
+ */
+ @NotNull FluidData clone();
+ FluidData clone();
+
+ /**
+ * Computes the direction of the flow of the liquid at the given location as a vector.
@@ -48,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param location - the location to check the liquid flow
+ * @return the flow direction vector at the given location
+ */
+ @NotNull Vector computeFlowDirection(@NotNull Location location);
+ Vector computeFlowDirection(Location location);
+
+ /**
+ * Returns the level of liquid this fluid data holds.
@@ -69,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return the height as a float value
+ */
+ @Range(from = 0, to = 1)
+ float computeHeight(@NotNull Location location);
+ float computeHeight(Location location);
+
+ /**
+ * Returns whether this fluid is a source block