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

@@ -8,6 +8,7 @@ import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.EndGateway;
import org.bukkit.block.data.Orientable;
import org.jetbrains.annotations.NotNull;
/**
* This thread changes gate blocks to display a gate as open or closed
@@ -58,7 +59,7 @@ public class BlockChangeThread implements Runnable {
*
* @param block <p>The block to fix</p>
*/
private static void fixEndGatewayGate(Block block) {
private static void fixEndGatewayGate(@NotNull Block block) {
EndGateway gateway = (EndGateway) block.getState();
gateway.setAge(Long.MIN_VALUE);
if (block.getWorld().getEnvironment() == World.Environment.THE_END) {
@@ -74,7 +75,7 @@ public class BlockChangeThread implements Runnable {
* @param block <p>The block to orient</p>
* @param axis <p>The axis to use for orienting the block</p>
*/
private static void orientBlock(Block block, Axis axis) {
private static void orientBlock(@NotNull Block block, @NotNull Axis axis) {
Orientable orientable = (Orientable) block.getBlockData();
orientable.setAxis(axis);
block.setBlockData(orientable);