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

@@ -28,7 +28,8 @@ public class StargateActivateEvent extends StargatePlayerEvent {
* @param destinations <p>The destinations available to the player using the portal</p>
* @param destination <p>The currently selected destination</p>
*/
public StargateActivateEvent(Portal portal, Player player, List<String> destinations, String destination) {
public StargateActivateEvent(@NotNull Portal portal, @NotNull Player player, @NotNull List<String> destinations,
@NotNull String destination) {
super(portal, player);
this.destinations = destinations;
@@ -40,6 +41,7 @@ public class StargateActivateEvent extends StargatePlayerEvent {
*
* @return <p>The destinations available for the portal</p>
*/
@NotNull
public List<String> getDestinations() {
return destinations;
}
@@ -49,7 +51,7 @@ public class StargateActivateEvent extends StargatePlayerEvent {
*
* @param destinations <p>The new list of available destinations</p>
*/
public void setDestinations(List<String> destinations) {
public void setDestinations(@NotNull List<String> destinations) {
this.destinations = destinations;
}
@@ -58,6 +60,7 @@ public class StargateActivateEvent extends StargatePlayerEvent {
*
* @return <p>The selected destination</p>
*/
@NotNull
public String getDestination() {
return destination;
}
@@ -67,7 +70,7 @@ public class StargateActivateEvent extends StargatePlayerEvent {
*
* @param destination <p>The new selected destination</p>
*/
public void setDestination(String destination) {
public void setDestination(@NotNull String destination) {
this.destination = destination;
}
@@ -76,6 +79,7 @@ public class StargateActivateEvent extends StargatePlayerEvent {
*
* @return <p>A handler-list with all event handlers</p>
*/
@NotNull
public static HandlerList getHandlerList() {
return handlers;
}