SPIGOT-2540: Add nullability annotations to entire Bukkit API
By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
@ -3,7 +3,6 @@ package org.bukkit.entity;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import org.bukkit.Achievement;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Instrument;
|
||||
@ -25,6 +24,8 @@ import org.bukkit.map.MapView;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a player, connected or not
|
||||
@ -40,6 +41,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @return the friendly name
|
||||
*/
|
||||
@NotNull
|
||||
public String getDisplayName();
|
||||
|
||||
/**
|
||||
@ -51,13 +53,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param name The new display name.
|
||||
*/
|
||||
public void setDisplayName(String name);
|
||||
public void setDisplayName(@Nullable String name);
|
||||
|
||||
/**
|
||||
* Gets the name that is shown on the player list.
|
||||
*
|
||||
* @return the player list name
|
||||
*/
|
||||
@NotNull
|
||||
public String getPlayerListName();
|
||||
|
||||
/**
|
||||
@ -67,13 +70,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param name new player list name
|
||||
*/
|
||||
public void setPlayerListName(String name);
|
||||
public void setPlayerListName(@Nullable String name);
|
||||
|
||||
/**
|
||||
* Gets the currently displayed player list header for this player.
|
||||
*
|
||||
* @return player list header or null
|
||||
*/
|
||||
@Nullable
|
||||
public String getPlayerListHeader();
|
||||
|
||||
/**
|
||||
@ -81,6 +85,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @return player list header or null
|
||||
*/
|
||||
@Nullable
|
||||
public String getPlayerListFooter();
|
||||
|
||||
/**
|
||||
@ -88,14 +93,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param header player list header, null for empty
|
||||
*/
|
||||
public void setPlayerListHeader(String header);
|
||||
public void setPlayerListHeader(@Nullable String header);
|
||||
|
||||
/**
|
||||
* Sets the currently displayed player list footer for this player.
|
||||
*
|
||||
* @param footer player list footer, null for empty
|
||||
*/
|
||||
public void setPlayerListFooter(String footer);
|
||||
public void setPlayerListFooter(@Nullable String footer);
|
||||
|
||||
/**
|
||||
* Sets the currently displayed player list header and footer for this
|
||||
@ -104,20 +109,21 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param header player list header, null for empty
|
||||
* @param footer player list footer, null for empty
|
||||
*/
|
||||
public void setPlayerListHeaderFooter(String header, String footer);
|
||||
public void setPlayerListHeaderFooter(@Nullable String header, @Nullable String footer);
|
||||
|
||||
/**
|
||||
* Set the target of the player's compass.
|
||||
*
|
||||
* @param loc Location to point to
|
||||
*/
|
||||
public void setCompassTarget(Location loc);
|
||||
public void setCompassTarget(@NotNull Location loc);
|
||||
|
||||
/**
|
||||
* Get the previously set compass target.
|
||||
*
|
||||
* @return location of the target
|
||||
*/
|
||||
@NotNull
|
||||
public Location getCompassTarget();
|
||||
|
||||
/**
|
||||
@ -125,6 +131,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @return the player's address
|
||||
*/
|
||||
@Nullable
|
||||
public InetSocketAddress getAddress();
|
||||
|
||||
/**
|
||||
@ -132,21 +139,21 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param message Message to be displayed
|
||||
*/
|
||||
public void sendRawMessage(String message);
|
||||
public void sendRawMessage(@NotNull String message);
|
||||
|
||||
/**
|
||||
* Kicks player with custom kick message.
|
||||
*
|
||||
* @param message kick message
|
||||
*/
|
||||
public void kickPlayer(String message);
|
||||
public void kickPlayer(@Nullable String message);
|
||||
|
||||
/**
|
||||
* Says a message (or runs a command).
|
||||
*
|
||||
* @param msg message to print
|
||||
*/
|
||||
public void chat(String msg);
|
||||
public void chat(@NotNull String msg);
|
||||
|
||||
/**
|
||||
* Makes the player perform the given command
|
||||
@ -154,7 +161,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param command Command to perform
|
||||
* @return true if the command was successful, otherwise false
|
||||
*/
|
||||
public boolean performCommand(String command);
|
||||
public boolean performCommand(@NotNull String command);
|
||||
|
||||
/**
|
||||
* Returns if the player is in sneak mode
|
||||
@ -229,7 +236,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public void playNote(Location loc, byte instrument, byte note);
|
||||
public void playNote(@NotNull Location loc, byte instrument, byte note);
|
||||
|
||||
/**
|
||||
* Play a note for a player at a location. This requires a note block
|
||||
@ -240,7 +247,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param instrument The instrument
|
||||
* @param note The note
|
||||
*/
|
||||
public void playNote(Location loc, Instrument instrument, Note note);
|
||||
public void playNote(@NotNull Location loc, @NotNull Instrument instrument, @NotNull Note note);
|
||||
|
||||
|
||||
/**
|
||||
@ -253,7 +260,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param volume The volume of the sound
|
||||
* @param pitch The pitch of the sound
|
||||
*/
|
||||
public void playSound(Location location, Sound sound, float volume, float pitch);
|
||||
public void playSound(@NotNull Location location, @NotNull Sound sound, float volume, float pitch);
|
||||
|
||||
/**
|
||||
* Play a sound for a player at the location.
|
||||
@ -267,7 +274,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param volume the volume of the sound
|
||||
* @param pitch the pitch of the sound
|
||||
*/
|
||||
public void playSound(Location location, String sound, float volume, float pitch);
|
||||
public void playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch);
|
||||
|
||||
/**
|
||||
* Play a sound for a player at the location.
|
||||
@ -280,7 +287,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param volume The volume of the sound
|
||||
* @param pitch The pitch of the sound
|
||||
*/
|
||||
public void playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch);
|
||||
public void playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||
|
||||
/**
|
||||
* Play a sound for a player at the location.
|
||||
@ -295,21 +302,21 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param volume the volume of the sound
|
||||
* @param pitch the pitch of the sound
|
||||
*/
|
||||
public void playSound(Location location, String sound, SoundCategory category, float volume, float pitch);
|
||||
public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
|
||||
|
||||
/**
|
||||
* Stop the specified sound from playing.
|
||||
*
|
||||
* @param sound the sound to stop
|
||||
*/
|
||||
public void stopSound(Sound sound);
|
||||
public void stopSound(@NotNull Sound sound);
|
||||
|
||||
/**
|
||||
* Stop the specified sound from playing.
|
||||
*
|
||||
* @param sound the sound to stop
|
||||
*/
|
||||
public void stopSound(String sound);
|
||||
public void stopSound(@NotNull String sound);
|
||||
|
||||
/**
|
||||
* Stop the specified sound from playing.
|
||||
@ -317,7 +324,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param sound the sound to stop
|
||||
* @param category the category of the sound
|
||||
*/
|
||||
public void stopSound(Sound sound, SoundCategory category);
|
||||
public void stopSound(@NotNull Sound sound, @Nullable SoundCategory category);
|
||||
|
||||
/**
|
||||
* Stop the specified sound from playing.
|
||||
@ -325,7 +332,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param sound the sound to stop
|
||||
* @param category the category of the sound
|
||||
*/
|
||||
public void stopSound(String sound, SoundCategory category);
|
||||
public void stopSound(@NotNull String sound, @Nullable SoundCategory category);
|
||||
|
||||
/**
|
||||
* Plays an effect to just this player.
|
||||
@ -336,7 +343,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public void playEffect(Location loc, Effect effect, int data);
|
||||
public void playEffect(@NotNull Location loc, @NotNull Effect effect, int data);
|
||||
|
||||
/**
|
||||
* Plays an effect to just this player.
|
||||
@ -346,7 +353,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param effect the {@link Effect}
|
||||
* @param data a data bit needed for some effects
|
||||
*/
|
||||
public <T> void playEffect(Location loc, Effect effect, T data);
|
||||
public <T> void playEffect(@NotNull Location loc, @NotNull Effect effect, @Nullable T data);
|
||||
|
||||
/**
|
||||
* Send a block change. This fakes a block change packet for a user at a
|
||||
@ -358,7 +365,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public void sendBlockChange(Location loc, Material material, byte data);
|
||||
public void sendBlockChange(@NotNull Location loc, @NotNull Material material, byte data);
|
||||
|
||||
/**
|
||||
* Send a block change. This fakes a block change packet for a user at a
|
||||
@ -367,7 +374,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param loc The location of the changed block
|
||||
* @param block The new block
|
||||
*/
|
||||
public void sendBlockChange(Location loc, BlockData block);
|
||||
public void sendBlockChange(@NotNull Location loc, @NotNull BlockData block);
|
||||
|
||||
/**
|
||||
* Send a chunk change. This fakes a chunk change packet for a user at a
|
||||
@ -387,7 +394,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated Magic value
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data);
|
||||
public boolean sendChunkChange(@NotNull Location loc, int sx, int sy, int sz, @NotNull byte[] data);
|
||||
|
||||
/**
|
||||
* Send a sign change. This fakes a sign change packet for a user at
|
||||
@ -404,7 +411,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if location is null
|
||||
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
||||
*/
|
||||
public void sendSignChange(Location loc, String[] lines) throws IllegalArgumentException;
|
||||
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Render a map and send it to the player in its entirety. This may be
|
||||
@ -412,7 +419,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param map The map to be sent
|
||||
*/
|
||||
public void sendMap(MapView map);
|
||||
public void sendMap(@NotNull MapView map);
|
||||
|
||||
/**
|
||||
* Forces an update of the player's entire inventory.
|
||||
@ -432,7 +439,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated future versions of Minecraft do not have achievements
|
||||
*/
|
||||
@Deprecated
|
||||
public void awardAchievement(Achievement achievement);
|
||||
public void awardAchievement(@NotNull Achievement achievement);
|
||||
|
||||
/**
|
||||
* Removes the given achievement and any children achievements that the
|
||||
@ -443,7 +450,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated future versions of Minecraft do not have achievements
|
||||
*/
|
||||
@Deprecated
|
||||
public void removeAchievement(Achievement achievement);
|
||||
public void removeAchievement(@NotNull Achievement achievement);
|
||||
|
||||
/**
|
||||
* Gets whether this player has the given achievement.
|
||||
@ -454,7 +461,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated future versions of Minecraft do not have achievements
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean hasAchievement(Achievement achievement);
|
||||
public boolean hasAchievement(@NotNull Achievement achievement);
|
||||
|
||||
/**
|
||||
* Increments the given statistic for this player.
|
||||
@ -467,7 +474,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the statistic requires an
|
||||
* additional parameter
|
||||
*/
|
||||
public void incrementStatistic(Statistic statistic) throws IllegalArgumentException;
|
||||
public void incrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Decrements the given statistic for this player.
|
||||
@ -480,7 +487,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the statistic requires an
|
||||
* additional parameter
|
||||
*/
|
||||
public void decrementStatistic(Statistic statistic) throws IllegalArgumentException;
|
||||
public void decrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Increments the given statistic for this player.
|
||||
@ -492,7 +499,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the statistic requires an
|
||||
* additional parameter
|
||||
*/
|
||||
public void incrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException;
|
||||
public void incrementStatistic(@NotNull Statistic statistic, int amount) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Decrements the given statistic for this player.
|
||||
@ -504,7 +511,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the statistic requires an
|
||||
* additional parameter
|
||||
*/
|
||||
public void decrementStatistic(Statistic statistic, int amount) throws IllegalArgumentException;
|
||||
public void decrementStatistic(@NotNull Statistic statistic, int amount) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Sets the given statistic for this player.
|
||||
@ -516,7 +523,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the statistic requires an
|
||||
* additional parameter
|
||||
*/
|
||||
public void setStatistic(Statistic statistic, int newValue) throws IllegalArgumentException;
|
||||
public void setStatistic(@NotNull Statistic statistic, int newValue) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Gets the value of the given statistic for this player.
|
||||
@ -527,7 +534,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the statistic requires an
|
||||
* additional parameter
|
||||
*/
|
||||
public int getStatistic(Statistic statistic) throws IllegalArgumentException;
|
||||
public int getStatistic(@NotNull Statistic statistic) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Increments the given statistic for this player for the given material.
|
||||
@ -542,7 +549,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void incrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException;
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Decrements the given statistic for this player for the given material.
|
||||
@ -557,7 +564,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void decrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException;
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Gets the value of the given statistic for this player.
|
||||
@ -570,7 +577,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public int getStatistic(Statistic statistic, Material material) throws IllegalArgumentException;
|
||||
public int getStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Increments the given statistic for this player for the given material.
|
||||
@ -584,7 +591,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void incrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException;
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int amount) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Decrements the given statistic for this player for the given material.
|
||||
@ -598,7 +605,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void decrementStatistic(Statistic statistic, Material material, int amount) throws IllegalArgumentException;
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int amount) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Sets the given statistic for this player for the given material.
|
||||
@ -612,7 +619,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void setStatistic(Statistic statistic, Material material, int newValue) throws IllegalArgumentException;
|
||||
public void setStatistic(@NotNull Statistic statistic, @NotNull Material material, int newValue) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Increments the given statistic for this player for the given entity.
|
||||
@ -627,7 +634,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void incrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException;
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Decrements the given statistic for this player for the given entity.
|
||||
@ -642,7 +649,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void decrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException;
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Gets the value of the given statistic for this player.
|
||||
@ -655,7 +662,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public int getStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException;
|
||||
public int getStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Increments the given statistic for this player for the given entity.
|
||||
@ -669,7 +676,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void incrementStatistic(Statistic statistic, EntityType entityType, int amount) throws IllegalArgumentException;
|
||||
public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int amount) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Decrements the given statistic for this player for the given entity.
|
||||
@ -683,7 +690,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void decrementStatistic(Statistic statistic, EntityType entityType, int amount);
|
||||
public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int amount);
|
||||
|
||||
/**
|
||||
* Sets the given statistic for this player for the given entity.
|
||||
@ -697,7 +704,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException if the given parameter is not valid
|
||||
* for the statistic
|
||||
*/
|
||||
public void setStatistic(Statistic statistic, EntityType entityType, int newValue);
|
||||
public void setStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int newValue);
|
||||
|
||||
/**
|
||||
* Sets the current time on the player's client. When relative is true the
|
||||
@ -755,7 +762,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param type The WeatherType enum type the player should experience
|
||||
*/
|
||||
public void setPlayerWeather(WeatherType type);
|
||||
public void setPlayerWeather(@NotNull WeatherType type);
|
||||
|
||||
/**
|
||||
* Returns the type of weather the player is currently experiencing.
|
||||
@ -763,6 +770,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @return The WeatherType that the player is currently experiencing or
|
||||
* null if player is seeing server weather.
|
||||
*/
|
||||
@Nullable
|
||||
public WeatherType getPlayerWeather();
|
||||
|
||||
/**
|
||||
@ -910,7 +918,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated see {@link #hidePlayer(Plugin, Player)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void hidePlayer(Player player);
|
||||
public void hidePlayer(@NotNull Player player);
|
||||
|
||||
/**
|
||||
* Hides a player from this player
|
||||
@ -918,7 +926,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param plugin Plugin that wants to hide the player
|
||||
* @param player Player to hide
|
||||
*/
|
||||
public void hidePlayer(Plugin plugin, Player player);
|
||||
public void hidePlayer(@NotNull Plugin plugin, @NotNull Player player);
|
||||
|
||||
/**
|
||||
* Allows this player to see a player that was previously hidden
|
||||
@ -927,7 +935,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated see {@link #showPlayer(Plugin, Player)}
|
||||
*/
|
||||
@Deprecated
|
||||
public void showPlayer(Player player);
|
||||
public void showPlayer(@NotNull Player player);
|
||||
|
||||
/**
|
||||
* Allows this player to see a player that was previously hidden. If
|
||||
@ -937,7 +945,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param plugin Plugin that wants to show the player
|
||||
* @param player Player to show
|
||||
*/
|
||||
public void showPlayer(Plugin plugin, Player player);
|
||||
public void showPlayer(@NotNull Plugin plugin, @NotNull Player player);
|
||||
|
||||
/**
|
||||
* Checks to see if a player has been hidden from this player
|
||||
@ -946,7 +954,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @return True if the provided player is not being hidden from this
|
||||
* player
|
||||
*/
|
||||
public boolean canSee(Player player);
|
||||
public boolean canSee(@NotNull Player player);
|
||||
|
||||
/**
|
||||
* Checks to see if this player is currently flying or not.
|
||||
@ -1030,7 +1038,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* should use {@link #setResourcePack(String)}.
|
||||
*/
|
||||
@Deprecated
|
||||
public void setTexturePack(String url);
|
||||
public void setTexturePack(@NotNull String url);
|
||||
|
||||
/**
|
||||
* Request that the player's client download and switch resource packs.
|
||||
@ -1064,7 +1072,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException Thrown if the URL is too long. The
|
||||
* length restriction is an implementation specific arbitrary value.
|
||||
*/
|
||||
public void setResourcePack(String url);
|
||||
public void setResourcePack(@NotNull String url);
|
||||
|
||||
/**
|
||||
* Request that the player's client download and switch resource packs.
|
||||
@ -1101,13 +1109,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
|
||||
* long.
|
||||
*/
|
||||
public void setResourcePack(String url, byte[] hash);
|
||||
public void setResourcePack(@NotNull String url, @NotNull byte[] hash);
|
||||
|
||||
/**
|
||||
* Gets the Scoreboard displayed to this player
|
||||
*
|
||||
* @return The current scoreboard seen by this player
|
||||
*/
|
||||
@NotNull
|
||||
public Scoreboard getScoreboard();
|
||||
|
||||
/**
|
||||
@ -1120,7 +1129,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalStateException if this is a player that is not logged
|
||||
* yet or has logged out
|
||||
*/
|
||||
public void setScoreboard(Scoreboard scoreboard) throws IllegalArgumentException, IllegalStateException;
|
||||
public void setScoreboard(@NotNull Scoreboard scoreboard) throws IllegalArgumentException, IllegalStateException;
|
||||
|
||||
/**
|
||||
* Gets if the client is displayed a 'scaled' health, that is, health on a
|
||||
@ -1173,6 +1182,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @return the followed entity, or null if not in spectator mode or not
|
||||
* following a specific entity.
|
||||
*/
|
||||
@Nullable
|
||||
public Entity getSpectatorTarget();
|
||||
|
||||
/**
|
||||
@ -1183,7 +1193,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @throws IllegalStateException if the player is not in
|
||||
* {@link GameMode#SPECTATOR}
|
||||
*/
|
||||
public void setSpectatorTarget(Entity entity);
|
||||
public void setSpectatorTarget(@Nullable Entity entity);
|
||||
|
||||
/**
|
||||
* Sends a title and a subtitle message to the player. If either of these
|
||||
@ -1197,7 +1207,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @deprecated API behavior subject to change
|
||||
*/
|
||||
@Deprecated
|
||||
public void sendTitle(String title, String subtitle);
|
||||
public void sendTitle(@Nullable String title, @Nullable String subtitle);
|
||||
|
||||
/**
|
||||
* Sends a title and a subtitle message to the player. If either of these
|
||||
@ -1214,7 +1224,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param stay time in ticks for titles to stay. Defaults to 70.
|
||||
* @param fadeOut time in ticks for titles to fade out. Defaults to 20.
|
||||
*/
|
||||
public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut);
|
||||
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
|
||||
|
||||
/**
|
||||
* Resets the title displayed to the player. This will clear the displayed
|
||||
@ -1230,7 +1240,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param location the location to spawn at
|
||||
* @param count the number of particles
|
||||
*/
|
||||
public void spawnParticle(Particle particle, Location location, int count);
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1242,7 +1252,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param z the position on the z axis to spawn at
|
||||
* @param count the number of particles
|
||||
*/
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count);
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1254,7 +1264,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, T data);
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data);
|
||||
|
||||
|
||||
/**
|
||||
@ -1269,7 +1279,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, T data);
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1284,7 +1294,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param offsetY the maximum random offset on the Y axis
|
||||
* @param offsetZ the maximum random offset on the Z axis
|
||||
*/
|
||||
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ);
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1301,7 +1311,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param offsetY the maximum random offset on the Y axis
|
||||
* @param offsetZ the maximum random offset on the Z axis
|
||||
*/
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ);
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1318,7 +1328,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data);
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1337,7 +1347,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data);
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1354,7 +1364,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param extra the extra data for this particle, depends on the
|
||||
* particle used (normally speed)
|
||||
*/
|
||||
public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra);
|
||||
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1373,7 +1383,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param extra the extra data for this particle, depends on the
|
||||
* particle used (normally speed)
|
||||
*/
|
||||
public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra);
|
||||
public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1392,7 +1402,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data);
|
||||
|
||||
/**
|
||||
* Spawns the particle (the number of times specified by count)
|
||||
@ -1413,7 +1423,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param data the data to use for the particle or null,
|
||||
* the type of this depends on {@link Particle#getDataType()}
|
||||
*/
|
||||
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
|
||||
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data);
|
||||
|
||||
/**
|
||||
* Return the player's progression on the specified advancement.
|
||||
@ -1421,7 +1431,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param advancement advancement
|
||||
* @return object detailing the player's progress
|
||||
*/
|
||||
public AdvancementProgress getAdvancementProgress(Advancement advancement);
|
||||
@NotNull
|
||||
public AdvancementProgress getAdvancementProgress(@NotNull Advancement advancement);
|
||||
|
||||
/**
|
||||
* Get the player's current client side view distance.
|
||||
@ -1444,6 +1455,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @return the player's locale
|
||||
*/
|
||||
@NotNull
|
||||
public String getLocale();
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user