Adds nullability annotations among other things

Adds nullability annotations for all methods
Fixes some nullability problems and inconsistencies
Gets rid of RelativeBlockVector's inner class
Changes RelativeBlockVector to a record
Simplifies FromTheEndTeleportation's storage, and makes it into a minimal record
Removes the putStringInList method
Gets rid of some primitive list usage
Fixes some incorrect method accessibility
Removes some redundancy in PortalOption
This commit is contained in:
2024-02-20 12:43:01 +01:00
parent 894a692e7b
commit b4a6ce1a77
78 changed files with 1025 additions and 639 deletions

View File

@@ -2,6 +2,8 @@ package net.knarcraft.stargate.container;
import org.bukkit.Axis;
import org.bukkit.Material;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a request for changing a block into another material
@@ -19,7 +21,7 @@ public class BlockChangeRequest {
* @param material <p>The new material to change the block to</p>
* @param axis <p>The new axis to orient the block along</p>
*/
public BlockChangeRequest(BlockLocation blockLocation, Material material, Axis axis) {
public BlockChangeRequest(@NotNull BlockLocation blockLocation, @NotNull Material material, @Nullable Axis axis) {
this.blockLocation = blockLocation;
newMaterial = material;
newAxis = axis;
@@ -30,6 +32,7 @@ public class BlockChangeRequest {
*
* @return <p>The location of the block</p>
*/
@NotNull
public BlockLocation getBlockLocation() {
return blockLocation;
}
@@ -39,6 +42,7 @@ public class BlockChangeRequest {
*
* @return <p>The material to change the block into</p>
*/
@NotNull
public Material getMaterial() {
return newMaterial;
}
@@ -48,6 +52,7 @@ public class BlockChangeRequest {
*
* @return <p>The axis to orient the block along</p>
*/
@Nullable
public Axis getAxis() {
return newAxis;
}