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,7 @@ package net.knarcraft.stargate.utility;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.jetbrains.annotations.NotNull;
/**
* This class helps decide properties of materials not already present in the Spigot API
@@ -18,7 +19,7 @@ public final class MaterialHelper {
* @param material <p>The material to check</p>
* @return <p>True if the material is a wall coral</p>
*/
public static boolean isWallCoral(Material material) {
public static boolean isWallCoral(@NotNull Material material) {
//Unfortunately, there is no tag for dead wall corals, so they need to be checked manually
return Tag.WALL_CORALS.isTagged(material) ||
material.equals(Material.DEAD_BRAIN_CORAL_WALL_FAN) ||
@@ -34,7 +35,7 @@ public final class MaterialHelper {
* @param material <p>The material to check</p>
* @return <p>True if the material is a container</p>
*/
public static boolean isContainer(Material material) {
public static boolean isContainer(@NotNull Material material) {
return Tag.SHULKER_BOXES.isTagged(material) || material == Material.CHEST ||
material == Material.TRAPPED_CHEST || material == Material.ENDER_CHEST;
}
@@ -45,7 +46,7 @@ public final class MaterialHelper {
* @param material <p>The material to check</p>
* @return <p>True if the material can be used as a button</p>
*/
public static boolean isButtonCompatible(Material material) {
public static boolean isButtonCompatible(@NotNull Material material) {
return Tag.BUTTONS.isTagged(material) || isWallCoral(material) || isContainer(material);
}