Add some annotations

This commit is contained in:
GeorgH93 2020-05-15 22:00:16 +02:00
parent 31af2f7b56
commit a069874c01
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -32,6 +32,7 @@
import org.bukkit.Sound;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.FileNotFoundException;
import java.util.*;
@ -375,7 +376,7 @@ public boolean isItemShortcutEnabled()
return MCVersion.isNewerOrEqualThan(MCVersion.MC_1_8) && getConfigE().getBoolean("ItemShortcut.Enabled", true);
}
public String getItemShortcutItemName()
public @NotNull String getItemShortcutItemName()
{
return getConfigE().getString("ItemShortcut.Item", "BackpackHeadBlue");
}
@ -403,7 +404,7 @@ public int getItemShortcutPreferredSlotId()
//endregion
//region Sound settings
private Sound getSound(String option, String autoValue)
private @Nullable Sound getSound(final @NotNull String option, final @NotNull String autoValue)
{
if(!getConfigE().getBoolean("Sound.Enabled", true)) return null;
String soundName = getConfigE().getString("Sound." + option, "auto").toUpperCase(Locale.ENGLISH);
@ -420,12 +421,12 @@ private Sound getSound(String option, String autoValue)
return null;
}
public Sound getOpenSound()
public @Nullable Sound getOpenSound()
{
return getSound("OpenSound", MCVersion.isNewerOrEqualThan(MCVersion.MC_1_11) ? "BLOCK_SHULKER_BOX_OPEN" : (MCVersion.isNewerOrEqualThan(MCVersion.MC_1_9_2) ? "BLOCK_CHEST_OPEN" : "CHEST_OPEN"));
}
public Sound getCloseSound()
public @Nullable Sound getCloseSound()
{
return getSound("CloseSound", MCVersion.isNewerOrEqualThan(MCVersion.MC_1_11) ? "BLOCK_SHULKER_BOX_CLOSE" : (MCVersion.isNewerOrEqualThan(MCVersion.MC_1_9_2) ? "BLOCK_CHEST_CLOSE" : "CHEST_CLOSE"));
}