updated classes with contract annotations

This commit is contained in:
Sxtanna
2020-07-27 11:40:58 -04:00
parent 134086f6a9
commit b73a6916cb
4 changed files with 41 additions and 7 deletions

View File

@@ -25,6 +25,7 @@ import me.clip.placeholderapi.PlaceholderHook;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.configuration.ConfigurationSection;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -271,6 +272,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook
* @deprecated As of versions greater than 2.8.7, use {@link #getRequiredPlugin()}
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.10.8")
public String getPlugin()
{
return null;
@@ -280,6 +282,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to show a description
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.10.8")
public String getDescription()
{
return null;
@@ -289,6 +292,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook
* @deprecated As of versions greater than 2.8.7, use the expansion cloud to display a link
*/
@Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.10.8")
public String getLink()
{
return null;

View File

@@ -39,6 +39,7 @@ import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.server.PluginDisableEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
@@ -163,13 +164,10 @@ public final class LocalExpansionManager implements Listener
/**
* Do not call this method yourself, use {@link PlaceholderExpansion#register()}
*/
@ApiStatus.Internal
public boolean register(@NotNull final PlaceholderExpansion expansion)
{
final String identifier = expansion.getIdentifier();
if (identifier == null)
{
return false;
}
if (expansion instanceof Configurable)
{
@@ -267,6 +265,7 @@ public final class LocalExpansionManager implements Listener
/**
* Do not call this method yourself, use {@link PlaceholderExpansion#unregister()}
*/
@ApiStatus.Internal
public boolean unregister(@NotNull final PlaceholderExpansion expansion)
{
if (expansions.remove(expansion.getIdentifier()) == null)