testserver/Spigot-API-Patches/0051-Fix-upstream-javadoc-w...

400 lines
19 KiB
Diff
Raw Normal View History

2019-04-23 04:47:07 +00:00
From 811f1e098bd6192a850ab6b9ce5b121664628c21 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 10 Jun 2017 16:59:40 -0500
Subject: [PATCH] Fix upstream javadoc warnings and errors
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
2019-04-23 04:47:07 +00:00
index ffebffd8..f5e3929a 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java
@@ -39,8 +39,8 @@ public final class NamespacedKey {
/**
* Create a key in a specific namespace.
*
- * @param namespace
- * @param key
+ * @param namespace String representing a grouping of keys
+ * @param key Name for this specific key
* @deprecated should never be used by plugins, for internal use only!!
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
2019-04-23 04:47:07 +00:00
index 0e6dd6e1..ac12a8fb 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
2019-04-23 04:47:07 +00:00
@@ -1643,6 +1643,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
* @param count the number of particles
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data);
2019-04-23 04:47:07 +00:00
@@ -1658,6 +1659,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
* @param count the number of particles
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data);
2019-04-23 04:47:07 +00:00
@@ -1707,6 +1709,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
* @param offsetZ the maximum random offset on the Z axis
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data);
2019-04-23 04:47:07 +00:00
@@ -1726,6 +1729,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
* @param offsetZ the maximum random offset on the Z axis
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data);
2019-04-23 04:47:07 +00:00
@@ -1781,6 +1785,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
* particle used (normally speed)
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data);
2019-04-23 04:47:07 +00:00
@@ -1802,6 +1807,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
* particle used (normally speed)
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
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);
2019-04-23 04:47:07 +00:00
@@ -1824,6 +1830,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
2018-10-25 13:38:19 +00:00
* @param force whether to send the particle to players within an extended
* range and encourage their client to render it regardless of
* settings
+ * @param <T> Particle data type
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force);
2018-10-25 13:38:19 +00:00
2019-04-23 04:47:07 +00:00
@@ -1848,6 +1855,7 @@ public interface World extends PluginMessageRecipient, Metadatable {
2018-10-25 13:38:19 +00:00
* @param force whether to send the particle to players within an extended
* range and encourage their client to render it regardless of
* settings
+ * @param <T> Particle data type
*/
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, boolean force);
2018-10-25 13:38:19 +00:00
diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java
2019-04-23 04:47:07 +00:00
index 2f195672..234aa9dd 100644
--- a/src/main/java/org/bukkit/entity/AbstractHorse.java
+++ b/src/main/java/org/bukkit/entity/AbstractHorse.java
@@ -25,7 +25,7 @@ public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameab
public Horse.Variant getVariant();
/**
- * @param variant
+ * @param variant Variant to set
* @deprecated you are required to spawn a different entity
*/
@Deprecated
2018-08-17 04:29:16 +00:00
diff --git a/src/main/java/org/bukkit/entity/AreaEffectCloud.java b/src/main/java/org/bukkit/entity/AreaEffectCloud.java
2019-04-23 04:47:07 +00:00
index 290aff28..9fd54b96 100644
2018-08-17 04:29:16 +00:00
--- a/src/main/java/org/bukkit/entity/AreaEffectCloud.java
+++ b/src/main/java/org/bukkit/entity/AreaEffectCloud.java
@@ -141,6 +141,7 @@ public interface AreaEffectCloud extends Entity {
2018-08-17 04:29:16 +00:00
* @param particle the new particle type
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> the particle data type // Paper
*/
<T> void setParticle(@NotNull Particle particle, @Nullable T data);
2018-08-17 04:29:16 +00:00
diff --git a/src/main/java/org/bukkit/entity/Guardian.java b/src/main/java/org/bukkit/entity/Guardian.java
2019-04-23 04:47:07 +00:00
index 5d9698dc..2c56eb85 100644
--- a/src/main/java/org/bukkit/entity/Guardian.java
+++ b/src/main/java/org/bukkit/entity/Guardian.java
@@ -12,7 +12,7 @@ public interface Guardian extends Monster {
public boolean isElder();
/**
- * @param shouldBeElder
+ * @param shouldBeElder Sets whether the Guardian is an Elder
* @deprecated Must spawn a new {@link ElderGuardian}.
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/entity/Horse.java b/src/main/java/org/bukkit/entity/Horse.java
2019-04-23 04:47:07 +00:00
index 734f5ac7..5efa4e60 100644
--- a/src/main/java/org/bukkit/entity/Horse.java
+++ b/src/main/java/org/bukkit/entity/Horse.java
@@ -154,7 +154,7 @@ public interface Horse extends AbstractHorse {
public boolean isCarryingChest();
/**
- * @param chest
+ * @param chest Sets whether the Horse is carrying a chest
* @deprecated see {@link ChestedHorse}
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
2019-04-23 04:47:07 +00:00
index 219556ed..c21785d5 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -438,7 +438,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* Use supplied alternative character to the section symbol to represent legacy color codes.
*
- * @param alternateChar Alternate symbol such as '&'
+ * @param alternateChar Alternate symbol such as '&amp;'
* @param message The message to send
*/
public void sendActionBar(char alternateChar, @NotNull String message);
@@ -505,6 +505,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Update the subtitle of titles displayed to the player
*
+ * @param subtitle Subtitle to set
* @deprecated Use {@link #updateTitle(Title)}
*/
@Deprecated
@@ -513,6 +514,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Update the subtitle of titles displayed to the player
*
+ * @param subtitle Subtitle to set
* @deprecated Use {@link #updateTitle(Title)}
*/
@Deprecated
@@ -521,6 +523,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Show the given title to the player, along with the last subtitle set, using the last set times
*
+ * @param title Title to set
* @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
*/
@Deprecated
@@ -529,6 +532,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Show the given title to the player, along with the last subtitle set, using the last set times
*
+ * @param title Title to set
* @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)}
*/
@Deprecated
@@ -1428,6 +1432,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param count the number of particles
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data);
@@ -1443,6 +1448,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param count the number of particles
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data);
@@ -1492,6 +1498,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param offsetZ the maximum random offset on the Z axis
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data);
@@ -1511,6 +1518,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param offsetZ the maximum random offset on the Z axis
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data);
@@ -1566,6 +1574,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* particle used (normally speed)
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data);
@@ -1587,6 +1596,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* particle used (normally speed)
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
+ * @param <T> Type
*/
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);
diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java
2019-04-23 04:47:07 +00:00
index 2a0b0109..2ac30c0f 100644
--- a/src/main/java/org/bukkit/entity/Skeleton.java
+++ b/src/main/java/org/bukkit/entity/Skeleton.java
@@ -19,6 +19,7 @@ public interface Skeleton extends Monster {
public SkeletonType getSkeletonType();
/**
+ * @param type Type to set
* @deprecated Must spawn a new subtype variant
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java
2019-04-23 04:47:07 +00:00
index 756f285e..ee2e70c6 100644
--- a/src/main/java/org/bukkit/entity/Zombie.java
+++ b/src/main/java/org/bukkit/entity/Zombie.java
@@ -32,7 +32,7 @@ public interface Zombie extends Monster {
public boolean isVillager();
/**
- * @param flag
+ * @param flag Sets whether the Zombie is a villager
* @deprecated must spawn {@link ZombieVillager}.
*/
@Deprecated
@@ -40,7 +40,7 @@ public interface Zombie extends Monster {
public void setVillager(boolean flag);
/**
- * @param profession
+ * @param profession Sets the ZombieVillager's profession
* @see ZombieVillager#getVillagerProfession()
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
2019-04-23 04:47:07 +00:00
index 1ca8de5e..0dba5d01 100644
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
2019-04-23 04:47:07 +00:00
@@ -28,6 +28,7 @@ public class PlayerLoginEvent extends PlayerEvent {
* @param hostname The hostname that was used to connect to the server
* @param address The address the player used to connect, provided for
* timing issues
+ * @param realAddress The unspoofed, actual address, that the player used to connect
*/
public PlayerLoginEvent(@NotNull final Player player, @NotNull final String hostname, @NotNull final InetAddress address, final @NotNull InetAddress realAddress) { // Spigot
super(player);
2019-04-23 04:47:07 +00:00
@@ -51,6 +52,7 @@ public class PlayerLoginEvent extends PlayerEvent {
* timing issues
* @param result The result status for this event
* @param message The message to be displayed if result denies login
+ * @param realAddress The unspoofed, actual address, that the player used to connect
*/
public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final String message, @NotNull final InetAddress realAddress) { // Spigot
this(player, hostname, address, realAddress); // Spigot
2019-04-14 22:45:42 +00:00
diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
2019-04-23 04:47:07 +00:00
index 8b901845..374fe364 100644
2019-04-14 22:45:42 +00:00
--- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java
@@ -76,7 +76,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
*
* @return Location the player moved to
*/
- @Nullable
+ @NotNull // Paper
public Location getTo() {
return to;
}
2018-08-17 04:29:16 +00:00
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
2019-04-23 04:47:07 +00:00
index 07d2b4cf..cbcbe8c8 100644
2018-08-17 04:29:16 +00:00
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -132,10 +132,10 @@ public interface ItemFactory {
2018-08-17 04:29:16 +00:00
* Apply a material change for an item meta. Do not use under any
* circumstances.
*
- * @param meta
- * @param material
+ * @param meta meta
+ * @param material material
* @return updated material
- * @throws IllegalArgumentException
+ * @throws IllegalArgumentException exception
* @deprecated for internal use only
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/inventory/Merchant.java b/src/main/java/org/bukkit/inventory/Merchant.java
2019-04-23 04:47:07 +00:00
index ab2b5958..4b0aef05 100644
--- a/src/main/java/org/bukkit/inventory/Merchant.java
+++ b/src/main/java/org/bukkit/inventory/Merchant.java
2019-04-23 04:47:07 +00:00
@@ -34,7 +34,7 @@ public interface Merchant {
*
* @param i the index
* @return the recipe
- * @throws IndexOutOfBoundsException
+ * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory
*/
@NotNull
MerchantRecipe getRecipe(int i) throws IndexOutOfBoundsException;
2019-04-23 04:47:07 +00:00
@@ -44,7 +44,7 @@ public interface Merchant {
*
* @param i the index
* @param recipe the recipe
- * @throws IndexOutOfBoundsException
+ * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory
*/
void setRecipe(int i, @NotNull MerchantRecipe recipe) throws IndexOutOfBoundsException;
diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java
2019-04-23 04:47:07 +00:00
index 57d893a4..77846f32 100644
--- a/src/main/java/org/bukkit/potion/Potion.java
+++ b/src/main/java/org/bukkit/potion/Potion.java
2019-04-23 04:47:07 +00:00
@@ -78,6 +78,7 @@ public class Potion {
}
/**
+ * @param name Unused, always uses {@link PotionType#WATER}
* @deprecated
*/
@Deprecated
diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java
2019-04-23 04:47:07 +00:00
index 91ddadbb..d21f407c 100644
--- a/src/main/java/org/bukkit/potion/PotionBrewer.java
+++ b/src/main/java/org/bukkit/potion/PotionBrewer.java
2019-04-23 04:47:07 +00:00
@@ -37,6 +37,8 @@ public interface PotionBrewer {
* a potion with the given type.
*
* @param type The type of the potion
+ * @param upgraded Whether the potion is upgraded
+ * @param extended Whether the potion is extended
* @return The list of effects
*/
@NotNull
diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java
2019-04-23 04:47:07 +00:00
index 1952dd9c..8b2e3439 100644
--- a/src/main/java/org/bukkit/potion/PotionType.java
+++ b/src/main/java/org/bukkit/potion/PotionType.java
@@ -72,6 +72,7 @@ public enum PotionType {
}
/**
+ * @return Damage value associated with this PotionType, broken
* @deprecated Non-functional
*/
@Deprecated
@@ -84,6 +85,8 @@ public enum PotionType {
}
/**
+ * @param damage Damage value associated with a PotionType
+ * @return PotionType for given damage value, broken
* @deprecated Non-functional
*/
@Deprecated
@@ -94,6 +97,8 @@ public enum PotionType {
}
/**
+ * @param effectType EffectType
+ * @return Associated PotionType
* @deprecated Misleading
*/
@Deprecated
--
2.21.0