Fix more incorrect array nullability annotations (#11836)

This commit is contained in:
Jake Potrebic
2024-12-27 13:24:16 -08:00
committed by GitHub
parent 13c94e40ad
commit ca8709b30f
27 changed files with 61 additions and 77 deletions

View File

@ -304,8 +304,7 @@ public class PaperServerListPingEvent extends ServerListPingEvent implements Can
return new PlayerIterator(); return new PlayerIterator();
} }
@NotNull protected @NotNull Object @NotNull [] getOnlinePlayers() {
protected Object[] getOnlinePlayers() {
return Bukkit.getOnlinePlayers().toArray(); return Bukkit.getOnlinePlayers().toArray();
} }

View File

@ -1184,7 +1184,7 @@ public final class Bukkit {
* @return the {@link Recipe} resulting from the given crafting matrix. * @return the {@link Recipe} resulting from the given crafting matrix.
*/ */
@Nullable @Nullable
public static Recipe getCraftingRecipe(@NotNull ItemStack[] craftingMatrix, @NotNull World world) { public static Recipe getCraftingRecipe(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world) {
return server.getCraftingRecipe(craftingMatrix, world); return server.getCraftingRecipe(craftingMatrix, world);
} }
@ -1213,7 +1213,7 @@ public final class Bukkit {
* @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items. * @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items.
*/ */
@NotNull @NotNull
public static ItemCraftResult craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) { public static ItemCraftResult craftItemResult(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world, @NotNull Player player) {
return server.craftItemResult(craftingMatrix, world, player); return server.craftItemResult(craftingMatrix, world, player);
} }
@ -1235,7 +1235,7 @@ public final class Bukkit {
* @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items. * @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items.
*/ */
@NotNull @NotNull
public static ItemCraftResult craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world) { public static ItemCraftResult craftItemResult(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world) {
return server.craftItemResult(craftingMatrix, world); return server.craftItemResult(craftingMatrix, world);
} }
@ -1266,7 +1266,7 @@ public final class Bukkit {
* an ItemStack of {@link Material#AIR} is returned. * an ItemStack of {@link Material#AIR} is returned.
*/ */
@NotNull @NotNull
public static ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player) { public static ItemStack craftItem(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world, @NotNull Player player) {
return server.craftItem(craftingMatrix, world, player); return server.craftItem(craftingMatrix, world, player);
} }
@ -1289,7 +1289,7 @@ public final class Bukkit {
* an ItemStack of {@link Material#AIR} is returned. * an ItemStack of {@link Material#AIR} is returned.
*/ */
@NotNull @NotNull
public static ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world) { public static ItemStack craftItem(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world) {
return server.craftItem(craftingMatrix, world); return server.craftItem(craftingMatrix, world);
} }
@ -1756,8 +1756,7 @@ public final class Bukkit {
* *
* @return an array containing all previous players * @return an array containing all previous players
*/ */
@NotNull public static @NotNull OfflinePlayer @NotNull [] getOfflinePlayers() {
public static OfflinePlayer[] getOfflinePlayers() {
return server.getOfflinePlayers(); return server.getOfflinePlayers();
} }
@ -2404,8 +2403,7 @@ public final class Bukkit {
* Gets the current server TPS * Gets the current server TPS
* @return current server TPS (1m, 5m, 15m in Paper-Server) * @return current server TPS (1m, 5m, 15m in Paper-Server)
*/ */
@NotNull public static double @NotNull [] getTPS() {
public static double[] getTPS() {
return server.getTPS(); return server.getTPS();
} }
@ -2414,8 +2412,7 @@ public final class Bukkit {
* *
* @return A sample of the servers last tick times (in nanos) * @return A sample of the servers last tick times (in nanos)
*/ */
@NotNull public static long @NotNull [] getTickTimes() {
public static long[] getTickTimes() {
return server.getTickTimes(); return server.getTickTimes();
} }

View File

@ -133,8 +133,7 @@ public interface Chunk extends PersistentDataHolder {
* *
* @return The entities. * @return The entities.
*/ */
@NotNull @NotNull Entity @NotNull [] getEntities();
Entity[] getEntities();
/** /**
* Get a list of all tile entities in the chunk. * Get a list of all tile entities in the chunk.
@ -143,7 +142,7 @@ public interface Chunk extends PersistentDataHolder {
*/ */
@NotNull @NotNull
// Paper start // Paper start
default BlockState[] getTileEntities() { default BlockState @NotNull [] getTileEntities() {
return getTileEntities(true); return getTileEntities(true);
} }
@ -154,7 +153,7 @@ public interface Chunk extends PersistentDataHolder {
* @return The tile entities. * @return The tile entities.
*/ */
@NotNull @NotNull
BlockState[] getTileEntities(boolean useSnapshot); BlockState @NotNull [] getTileEntities(boolean useSnapshot);
/** /**
* Get a list of all tile entities that match a given predicate in the chunk. * Get a list of all tile entities that match a given predicate in the chunk.

View File

@ -1018,7 +1018,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the {@link Recipe} resulting from the given crafting matrix. * @return the {@link Recipe} resulting from the given crafting matrix.
*/ */
@Nullable @Nullable
public Recipe getCraftingRecipe(@NotNull ItemStack[] craftingMatrix, @NotNull World world); public Recipe getCraftingRecipe(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world);
/** /**
* Get the crafted item using the list of {@link ItemStack} provided. * Get the crafted item using the list of {@link ItemStack} provided.
@ -1046,7 +1046,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* an ItemStack of {@link Material#AIR} is returned. * an ItemStack of {@link Material#AIR} is returned.
*/ */
@NotNull @NotNull
public ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player); public ItemStack craftItem(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world, @NotNull Player player);
/** /**
* Get the crafted item using the list of {@link ItemStack} provided. * Get the crafted item using the list of {@link ItemStack} provided.
@ -1067,7 +1067,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* an ItemStack of {@link Material#AIR} is returned. * an ItemStack of {@link Material#AIR} is returned.
*/ */
@NotNull @NotNull
public ItemStack craftItem(@NotNull ItemStack[] craftingMatrix, @NotNull World world); public ItemStack craftItem(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world);
/** /**
* Get the crafted item using the list of {@link ItemStack} provided. * Get the crafted item using the list of {@link ItemStack} provided.
@ -1094,7 +1094,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items. * @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items.
*/ */
@NotNull @NotNull
public ItemCraftResult craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world, @NotNull Player player); public ItemCraftResult craftItemResult(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world, @NotNull Player player);
/** /**
* Get the crafted item using the list of {@link ItemStack} provided. * Get the crafted item using the list of {@link ItemStack} provided.
@ -1114,7 +1114,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items. * @return resulting {@link ItemCraftResult} containing the resulting item, matrix and any overflow items.
*/ */
@NotNull @NotNull
public ItemCraftResult craftItemResult(@NotNull ItemStack[] craftingMatrix, @NotNull World world); public ItemCraftResult craftItemResult(@NotNull ItemStack @NotNull [] craftingMatrix, @NotNull World world);
/** /**
* Get an iterator through the list of crafting recipes. * Get an iterator through the list of crafting recipes.
@ -1503,8 +1503,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* *
* @return an array containing all previous players * @return an array containing all previous players
*/ */
@NotNull public @NotNull OfflinePlayer @NotNull [] getOfflinePlayers();
public OfflinePlayer[] getOfflinePlayers();
/** /**
* Gets the {@link Messenger} responsible for this server. * Gets the {@link Messenger} responsible for this server.
@ -2057,16 +2056,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* *
* @return current server TPS (1m, 5m, 15m in Paper-Server) * @return current server TPS (1m, 5m, 15m in Paper-Server)
*/ */
@NotNull public double @NotNull [] getTPS();
public double[] getTPS();
/** /**
* Get a sample of the servers last tick times (in nanos) * Get a sample of the servers last tick times (in nanos)
* *
* @return A sample of the servers last tick times (in nanos) * @return A sample of the servers last tick times (in nanos)
*/ */
@NotNull long @NotNull [] getTickTimes();
long[] getTickTimes();
/** /**
* Get the average tick time (in millis) * Get the average tick time (in millis)

View File

@ -346,8 +346,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* *
* @return Chunk[] containing all loaded chunks * @return Chunk[] containing all loaded chunks
*/ */
@NotNull public @NotNull Chunk @NotNull [] getLoadedChunks();
public Chunk[] getLoadedChunks();
/** /**
* Loads the specified {@link Chunk}. * Loads the specified {@link Chunk}.
@ -3563,8 +3562,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* *
* @return An array of {@link GameRule} names. * @return An array of {@link GameRule} names.
*/ */
@NotNull public @NotNull String @NotNull [] getGameRules();
public String[] getGameRules();
/** /**
* Gets the current state of the specified rule * Gets the current state of the specified rule

View File

@ -66,7 +66,7 @@ public abstract class Command {
* @param args All arguments passed to the command, split via ' ' * @param args All arguments passed to the command, split via ' '
* @return true if the command was successful, otherwise false * @return true if the command was successful, otherwise false
*/ */
public abstract boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String[] args); public abstract boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, @NotNull String @NotNull [] args);
/** /**
* Executed on tab completion for this command, returning a list of * Executed on tab completion for this command, returning a list of
@ -80,7 +80,7 @@ public abstract class Command {
* @throws IllegalArgumentException if sender, alias, or args is null * @throws IllegalArgumentException if sender, alias, or args is null
*/ */
@NotNull @NotNull
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException { public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String @NotNull [] args) throws IllegalArgumentException {
return tabComplete0(sender, alias, args, null); return tabComplete0(sender, alias, args, null);
} }
@ -97,7 +97,7 @@ public abstract class Command {
* @throws IllegalArgumentException if sender, alias, or args is null * @throws IllegalArgumentException if sender, alias, or args is null
*/ */
@NotNull @NotNull
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args, @Nullable Location location) throws IllegalArgumentException { public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String @NotNull [] args, @Nullable Location location) throws IllegalArgumentException {
return tabComplete(sender, alias, args); return tabComplete(sender, alias, args);
} }

View File

@ -19,5 +19,5 @@ public interface CommandExecutor {
* @param args Passed command arguments * @param args Passed command arguments
* @return true if a valid command, otherwise false * @return true if a valid command, otherwise false
*/ */
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args); public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args);
} }

View File

@ -22,7 +22,7 @@ import org.jetbrains.annotations.Nullable;
public interface MessageCommandSender extends CommandSender { public interface MessageCommandSender extends CommandSender {
@Override @Override
default void sendMessage(@NotNull String[] messages) { default void sendMessage(@NotNull String @NotNull [] messages) {
for (String message : messages) { for (String message : messages) {
sendMessage(message); sendMessage(message);
} }
@ -34,7 +34,7 @@ public interface MessageCommandSender extends CommandSender {
} }
@Override @Override
default void sendMessage(@Nullable UUID sender, @NotNull String[] messages) { default void sendMessage(@Nullable UUID sender, @NotNull String @NotNull [] messages) {
for (String message : messages) { for (String message : messages) {
sendMessage(message); sendMessage(message);
} }

View File

@ -18,8 +18,7 @@ public class MultipleCommandAlias extends Command {
* *
* @return commands associated with alias * @return commands associated with alias
*/ */
@NotNull public @NotNull Command @NotNull [] getCommands() {
public Command[] getCommands() {
return commands; return commands;
} }

View File

@ -23,5 +23,5 @@ public interface TabCompleter {
* to default to the command executor * to default to the command executor
*/ */
@Nullable @Nullable
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args); public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args);
} }

View File

@ -2308,7 +2308,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* long. * long.
*/ */
@Deprecated // Paper - adventure @Deprecated // Paper - adventure
public void setResourcePack(@NotNull String url, @Nullable byte[] hash); public void setResourcePack(@NotNull String url, byte @Nullable [] hash);
/** /**
* Request that the player's client download and switch resource packs. * Request that the player's client download and switch resource packs.
@ -2353,7 +2353,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* long. * long.
*/ */
@Deprecated // Paper - adventure @Deprecated // Paper - adventure
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt); public void setResourcePack(@NotNull String url, byte @Nullable [] hash, @Nullable String prompt);
// Paper start // Paper start
/** /**
@ -2447,7 +2447,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)}
*/ */
@Deprecated // Paper - adventure @Deprecated // Paper - adventure
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, boolean force); public void setResourcePack(@NotNull String url, byte @Nullable [] hash, boolean force);
/** /**
* Request that the player's client download and switch resource packs. * Request that the player's client download and switch resource packs.
@ -2494,7 +2494,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)}
*/ */
@Deprecated // Paper @Deprecated // Paper
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force); public void setResourcePack(@NotNull String url, byte @Nullable [] hash, @Nullable String prompt, boolean force);
// Paper start // Paper start
/** /**
@ -2592,7 +2592,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)} * @deprecated in favour of {@link #sendResourcePacks(net.kyori.adventure.resource.ResourcePackRequest)}
*/ */
@Deprecated // Paper - adventure @Deprecated // Paper - adventure
public void setResourcePack(@NotNull UUID id, @NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force); public void setResourcePack(@NotNull UUID id, @NotNull String url, byte @Nullable [] hash, @Nullable String prompt, boolean force);
// Paper start // Paper start
/** /**

View File

@ -203,8 +203,7 @@ public class HandlerList {
* *
* @return the array of registered listeners * @return the array of registered listeners
*/ */
@NotNull public @NotNull RegisteredListener @NotNull [] getRegisteredListeners() {
public RegisteredListener[] getRegisteredListeners() {
RegisteredListener[] handlers; RegisteredListener[] handlers;
while ((handlers = this.handlers) == null) bake(); // This prevents fringe cases of returning null while ((handlers = this.handlers) == null) bake(); // This prevents fringe cases of returning null
return handlers; return handlers;

View File

@ -329,7 +329,7 @@ public interface EntityEquipment {
* *
* @param items The items to set the armor as. Individual items may be null. * @param items The items to set the armor as. Individual items may be null.
*/ */
void setArmorContents(@NotNull ItemStack[] items); void setArmorContents(@NotNull ItemStack @NotNull [] items);
/** /**
* Clears the entity of all armor and held items * Clears the entity of all armor and held items

View File

@ -24,8 +24,7 @@ public interface ItemCraftResult {
* *
* @return resulting matrix * @return resulting matrix
*/ */
@NotNull public @NotNull ItemStack @NotNull [] getResultingMatrix();
public ItemStack[] getResultingMatrix();
/** /**
* Gets the overflowed items for items that don't fit back into the crafting * Gets the overflowed items for items that don't fit back into the crafting

View File

@ -744,8 +744,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
* @param bytes bytes representing an item in NBT * @param bytes bytes representing an item in NBT
* @return ItemStack migrated to this version of Minecraft if needed. * @return ItemStack migrated to this version of Minecraft if needed.
*/ */
@NotNull public static @NotNull ItemStack deserializeBytes(final byte @NotNull [] bytes) {
public static ItemStack deserializeBytes(@NotNull byte[] bytes) {
return org.bukkit.Bukkit.getUnsafe().deserializeItem(bytes); return org.bukkit.Bukkit.getUnsafe().deserializeItem(bytes);
} }
@ -754,8 +753,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
* use the built in data converter instead of bukkits dangerous serialization system. * use the built in data converter instead of bukkits dangerous serialization system.
* @return bytes representing this item in NBT. * @return bytes representing this item in NBT.
*/ */
@NotNull public byte @NotNull [] serializeAsBytes() {
public byte[] serializeAsBytes() {
return org.bukkit.Bukkit.getUnsafe().serializeItem(this); return org.bukkit.Bukkit.getUnsafe().serializeItem(this);
} }

View File

@ -118,7 +118,7 @@ public interface PlayerInventory extends Inventory {
* *
* @param items The ItemStacks to use as armour * @param items The ItemStacks to use as armour
*/ */
public void setArmorContents(@Nullable ItemStack[] items); public void setArmorContents(@Nullable ItemStack @NotNull [] items);
/** /**
* Put the given ItemStacks into the extra slots * Put the given ItemStacks into the extra slots
@ -127,7 +127,7 @@ public interface PlayerInventory extends Inventory {
* *
* @param items The ItemStacks to use as extra * @param items The ItemStacks to use as extra
*/ */
public void setExtraContents(@Nullable ItemStack[] items); public void setExtraContents(@Nullable ItemStack @NotNull [] items);
/** /**
* Put the given ItemStack into the helmet slot. This does not check if * Put the given ItemStack into the helmet slot. This does not check if

View File

@ -234,8 +234,7 @@ public class ShapedRecipe extends CraftingRecipe {
* @return The recipe's shape. * @return The recipe's shape.
* @throws NullPointerException when not set yet * @throws NullPointerException when not set yet
*/ */
@NotNull public @NotNull String @NotNull [] getShape() {
public String[] getShape() {
return rows.clone(); return rows.clone();
} }
} }

View File

@ -4,6 +4,7 @@ import org.bukkit.enchantments.EnchantmentOffer;
import org.bukkit.inventory.EnchantingInventory; import org.bukkit.inventory.EnchantingInventory;
import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.Nullable;
/** /**
* An instance of {@link InventoryView} which provides extra methods related to * An instance of {@link InventoryView} which provides extra methods related to
@ -36,8 +37,7 @@ public interface EnchantmentView extends InventoryView {
* *
* @return The enchantment offers that are provided * @return The enchantment offers that are provided
*/ */
@NotNull @Nullable EnchantmentOffer @NotNull [] getOffers();
EnchantmentOffer[] getOffers();
/** /**
* Sets the offers to provide to the player. * Sets the offers to provide to the player.
@ -45,5 +45,5 @@ public interface EnchantmentView extends InventoryView {
* @param offers The offers to provide * @param offers The offers to provide
* @throws IllegalArgumentException if the array length isn't 3 * @throws IllegalArgumentException if the array length isn't 3
*/ */
void setOffers(@NotNull EnchantmentOffer[] offers) throws IllegalArgumentException; void setOffers(@Nullable EnchantmentOffer @NotNull [] offers) throws IllegalArgumentException;
} }

View File

@ -112,7 +112,7 @@ public class MapFont {
private final int height; private final int height;
private final boolean[] data; private final boolean[] data;
public CharacterSprite(int width, int height, @NotNull boolean[] data) { public CharacterSprite(int width, int height, boolean @NotNull [] data) {
this.width = width; this.width = width;
this.height = height; this.height = height;
this.data = data; this.data = data;

View File

@ -319,7 +319,7 @@ public abstract class JavaPlugin extends PluginBase {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) {
return false; return false;
} }
@ -328,7 +328,7 @@ public abstract class JavaPlugin extends PluginBase {
*/ */
@Override @Override
@Nullable @Nullable
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) { public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String @NotNull [] args) {
return null; return null;
} }

View File

@ -229,5 +229,5 @@ public interface Messenger {
* @param channel Channel that the message was sent by. * @param channel Channel that the message was sent by.
* @param message Raw payload of the message. * @param message Raw payload of the message.
*/ */
public void dispatchIncomingMessage(@NotNull Player source, @NotNull String channel, @NotNull byte[] message); public void dispatchIncomingMessage(@NotNull Player source, @NotNull String channel, byte @NotNull [] message);
} }

View File

@ -17,5 +17,5 @@ public interface PluginMessageListener {
* @param player Source of the message. * @param player Source of the message.
* @param message The raw message that was sent. * @param message The raw message that was sent.
*/ */
public void onPluginMessageReceived(@NotNull String channel, @NotNull Player player, @NotNull byte[] message); public void onPluginMessageReceived(@NotNull String channel, @NotNull Player player, byte @NotNull [] message);
} }

View File

@ -27,7 +27,7 @@ public interface PluginMessageRecipient {
* @throws ChannelNotRegisteredException Thrown if the channel is not * @throws ChannelNotRegisteredException Thrown if the channel is not
* registered for this plugin. * registered for this plugin.
*/ */
public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, @NotNull byte[] message); public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, byte @NotNull [] message);
/** /**
* Gets a set containing all the Plugin Channels that this client is * Gets a set containing all the Plugin Channels that this client is

View File

@ -439,7 +439,7 @@ public class StandardMessenger implements Messenger {
} }
@Override @Override
public void dispatchIncomingMessage(@NotNull Player source, @NotNull String channel, @NotNull byte[] message) { public void dispatchIncomingMessage(@NotNull Player source, @NotNull String channel, byte @NotNull [] message) {
if (source == null) { if (source == null) {
throw new IllegalArgumentException("Player source cannot be null"); throw new IllegalArgumentException("Player source cannot be null");
} }
@ -534,7 +534,7 @@ public class StandardMessenger implements Messenger {
* @throws ChannelNotRegisteredException Thrown if the channel is not * @throws ChannelNotRegisteredException Thrown if the channel is not
* registered for this plugin. * registered for this plugin.
*/ */
public static void validatePluginMessage(@NotNull Messenger messenger, @NotNull Plugin source, @NotNull String channel, @NotNull byte[] message) { public static void validatePluginMessage(@NotNull Messenger messenger, @NotNull Plugin source, @NotNull String channel, byte @NotNull [] message) {
if (messenger == null) { if (messenger == null) {
throw new IllegalArgumentException("Messenger cannot be null"); throw new IllegalArgumentException("Messenger cannot be null");
} }

View File

@ -150,7 +150,7 @@ public class ChatPaginator {
private int pageNumber; private int pageNumber;
private int totalPages; private int totalPages;
public ChatPage(@NotNull String[] lines, int pageNumber, int totalPages) { public ChatPage(@NotNull String @NotNull [] lines, int pageNumber, int totalPages) {
this.lines = lines; this.lines = lines;
this.pageNumber = pageNumber; this.pageNumber = pageNumber;
this.totalPages = totalPages; this.totalPages = totalPages;
@ -165,7 +165,7 @@ public class ChatPaginator {
} }
@NotNull @NotNull
public String[] getLines() { public String @NotNull [] getLines() {
return lines; return lines;
} }
} }

View File

@ -12,7 +12,7 @@ public abstract class OctaveGenerator {
protected double yScale = 1; protected double yScale = 1;
protected double zScale = 1; protected double zScale = 1;
protected OctaveGenerator(@NotNull NoiseGenerator[] octaves) { protected OctaveGenerator(@NotNull NoiseGenerator @NotNull [] octaves) {
this.octaves = octaves; this.octaves = octaves;
} }
@ -90,7 +90,7 @@ public abstract class OctaveGenerator {
* @return Clone of the individual octaves * @return Clone of the individual octaves
*/ */
@NotNull @NotNull
public NoiseGenerator[] getOctaves() { public NoiseGenerator @NotNull [] getOctaves() {
return octaves.clone(); return octaves.clone();
} }

View File

@ -78,15 +78,15 @@ public class SimplexNoiseGenerator extends PerlinNoiseGenerator {
offsetW = rand.nextDouble() * 256; offsetW = rand.nextDouble() * 256;
} }
protected static double dot(@NotNull int[] g, double x, double y) { protected static double dot(int @NotNull [] g, double x, double y) {
return g[0] * x + g[1] * y; return g[0] * x + g[1] * y;
} }
protected static double dot(@NotNull int[] g, double x, double y, double z) { protected static double dot(int @NotNull [] g, double x, double y, double z) {
return g[0] * x + g[1] * y + g[2] * z; return g[0] * x + g[1] * y + g[2] * z;
} }
protected static double dot(@NotNull int[] g, double x, double y, double z, double w) { protected static double dot(int @NotNull [] g, double x, double y, double z, double w) {
return g[0] * x + g[1] * y + g[2] * z + g[3] * w; return g[0] * x + g[1] * y + g[2] * z + g[3] * w;
} }