mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-13 03:05:52 -07:00
Fix incorrect nullability annotations for PlayerJoinEvent's join message
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package org.bukkit.event.player;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a player joins a server
|
* Called when a player joins a server
|
||||||
@@ -11,7 +12,7 @@ public class PlayerJoinEvent extends PlayerEvent {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private String joinMessage;
|
private String joinMessage;
|
||||||
|
|
||||||
public PlayerJoinEvent(@NotNull final Player playerJoined, @NotNull final String joinMessage) {
|
public PlayerJoinEvent(@NotNull final Player playerJoined, @Nullable final String joinMessage) {
|
||||||
super(playerJoined);
|
super(playerJoined);
|
||||||
this.joinMessage = joinMessage;
|
this.joinMessage = joinMessage;
|
||||||
}
|
}
|
||||||
@@ -19,9 +20,9 @@ public class PlayerJoinEvent extends PlayerEvent {
|
|||||||
/**
|
/**
|
||||||
* Gets the join message to send to all online players
|
* Gets the join message to send to all online players
|
||||||
*
|
*
|
||||||
* @return string join message
|
* @return string join message. Can be null
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@Nullable
|
||||||
public String getJoinMessage() {
|
public String getJoinMessage() {
|
||||||
return joinMessage;
|
return joinMessage;
|
||||||
}
|
}
|
||||||
@@ -29,9 +30,9 @@ public class PlayerJoinEvent extends PlayerEvent {
|
|||||||
/**
|
/**
|
||||||
* Sets the join message to send to all online players
|
* Sets the join message to send to all online players
|
||||||
*
|
*
|
||||||
* @param joinMessage join message
|
* @param joinMessage join message. If null, no message will be sent
|
||||||
*/
|
*/
|
||||||
public void setJoinMessage(@NotNull String joinMessage) {
|
public void setJoinMessage(@Nullable String joinMessage) {
|
||||||
this.joinMessage = joinMessage;
|
this.joinMessage = joinMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user