Cleanup javadoc warnings

This commit is contained in:
Shane Freeder
2018-08-16 12:20:58 +01:00
parent 609d6bba6a
commit 69928187c9
20 changed files with 203 additions and 62 deletions

View File

@@ -11,7 +11,7 @@ This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
new file mode 100644
index 00000000..f7aa162f
index 000000000..feebfb653
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
@@ -0,0 +0,0 @@
@@ -52,6 +52,8 @@ index 00000000..f7aa162f
+ /**
+ * Sends the particle to all receiving players (or all).
+ * This method is safe to use Asynchronously
+ *
+ * @return a reference to this object.
+ */
+ public ParticleBuilder spawn() {
+ if (this.location == null) {
@@ -74,6 +76,7 @@ index 00000000..f7aa162f
+ /**
+ * Changes what particle will be sent
+ * @param particle The particle
+ * @return a reference to this object.
+ */
+ public ParticleBuilder particle(Particle particle) {
+ this.particle = particle;
@@ -105,6 +108,7 @@ index 00000000..f7aa162f
+ * Sends this particle to all players in the world. This is rather silly and you should likely not be doing this.
+ *
+ * Just be a logical person and use receivers by radius or collection.
+ * @return a reference to this object.
+ */
+ public ParticleBuilder allPlayers() {
+ this.receivers = null;
@@ -113,6 +117,7 @@ index 00000000..f7aa162f
+
+ /**
+ * @param receivers List of players to receive this particle, or null for all players in the world
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(@Nullable List<Player> receivers) {
+ // Had to keep this as we first made API List<> and not Collection, but removing this may break plugins compiled on older jars
@@ -123,6 +128,7 @@ index 00000000..f7aa162f
+
+ /**
+ * @param receivers List of players to receive this particle, or null for all players in the world
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(@Nullable Collection<Player> receivers) {
+ this.receivers = receivers != null ? Lists.newArrayList(receivers) : null;
@@ -131,6 +137,7 @@ index 00000000..f7aa162f
+
+ /**
+ * @param receivers List of players to be receive this particle, or null for all players in the world
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(Player... receivers) {
+ this.receivers = receivers != null ? Lists.newArrayList(receivers) : null;
@@ -142,6 +149,7 @@ index 00000000..f7aa162f
+ * If you want a more spherical check, see {@link #receivers(int, boolean)}
+ *
+ * @param radius amount to add on all axis
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int radius) {
+ return receivers(radius, radius);
@@ -153,6 +161,7 @@ index 00000000..f7aa162f
+ * If byDistance is true, radius is tested by distance in a spherical shape
+ * @param radius amount to add on each axis
+ * @param byDistance true to use a spherical radius, false to use a cuboid
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int radius, boolean byDistance) {
+ if (!byDistance) {
@@ -181,6 +190,7 @@ index 00000000..f7aa162f
+ *
+ * @param xzRadius amount to add on the x/z axis
+ * @param yRadius amount to add on the y axis
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int xzRadius, int yRadius) {
+ return receivers(xzRadius, yRadius, xzRadius);
@@ -193,6 +203,7 @@ index 00000000..f7aa162f
+ * @param xzRadius amount to add on the x/z axis
+ * @param yRadius amount to add on the y axis
+ * @param byDistance true to use a cylinder shape, false to use cuboid
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int xzRadius, int yRadius, boolean byDistance) {
+ if (!byDistance) {
@@ -223,6 +234,7 @@ index 00000000..f7aa162f
+ * @param xRadius amount to add on the x axis
+ * @param yRadius amount to add on the y axis
+ * @param zRadius amount to add on the z axis
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int xRadius, int yRadius, int zRadius) {
+ if (location == null) {
@@ -241,6 +253,7 @@ index 00000000..f7aa162f
+ /**
+ * Sets the source of this particle for visibility concerns (Vanish API)
+ * @param source The player who is considered the source
+ * @return a reference to this object.
+ */
+ public ParticleBuilder source(Player source) {
+ this.source = source;
@@ -257,6 +270,7 @@ index 00000000..f7aa162f
+ /**
+ * Sets the location of where to spawn the particle
+ * @param location The location of the particle
+ * @return a reference to this object.
+ */
+ public ParticleBuilder location(Location location) {
+ this.location = location.clone();
@@ -269,6 +283,7 @@ index 00000000..f7aa162f
+ * @param x X location
+ * @param y Y location
+ * @param z Z location
+ * @return a reference to this object.
+ */
+ public ParticleBuilder location(World world, double x, double y, double z) {
+ this.location = new Location(world, x, y, z);
@@ -285,6 +300,7 @@ index 00000000..f7aa162f
+ /**
+ * Sets the number of particles to spawn
+ * @param count Number of particles
+ * @return a reference to this object.
+ */
+ public ParticleBuilder count(int count) {
+ this.count = count;
@@ -293,18 +309,21 @@ index 00000000..f7aa162f
+
+ /**
+ * Particle offset X. Varies by particle on how this is used
+ * @return Particle offset X.
+ */
+ public double offsetX() {
+ return offsetX;
+ }
+ /**
+ * Particle offset Y. Varies by particle on how this is used
+ * @return Particle offset Y.
+ */
+ public double offsetY() {
+ return offsetY;
+ }
+ /**
+ * Particle offset Z. Varies by particle on how this is used
+ * @return Particle offset Z.
+ */
+ public double offsetZ() {
+ return offsetZ;
@@ -312,6 +331,10 @@ index 00000000..f7aa162f
+
+ /**
+ * Sets the particle offset. Varies by particle on how this is used
+ * @param offsetX Particle offset X
+ * @param offsetY Particle offset Y
+ * @param offsetZ Particle offset Z
+ * @return a reference to this object.
+ */
+ public ParticleBuilder offset(double offsetX, double offsetY, double offsetZ) {
+ this.offsetX = offsetX;
@@ -322,6 +345,7 @@ index 00000000..f7aa162f
+
+ /**
+ * Gets the Particle extra data. Varies by particle on how this is used
+ * @return the extra particle data
+ */
+ public double extra() {
+ return extra;
@@ -329,6 +353,8 @@ index 00000000..f7aa162f
+
+ /**
+ * Sets the particle extra data. Varies by particle on how this is used
+ * @param extra the extra particle data
+ * @return a reference to this object.
+ */
+ public ParticleBuilder extra(double extra) {
+ this.extra = extra;
@@ -337,6 +363,8 @@ index 00000000..f7aa162f
+
+ /**
+ * Gets the particle custom data. Varies by particle on how this is used
+ * @param <T> The Particle data type
+ * @return the ParticleData for this particle
+ */
+ public <T> T data() {
+ //noinspection unchecked
@@ -345,6 +373,9 @@ index 00000000..f7aa162f
+
+ /**
+ * Sets the particle custom data. Varies by particle on how this is used
+ * @param data The new particle data
+ * @param <T> The Particle data type
+ * @return a reference to this object.
+ */
+ public <T> ParticleBuilder data(T data) {
+ this.data = data;
@@ -357,6 +388,7 @@ index 00000000..f7aa162f
+ * If false, the particle will show according to the client's particle settings.
+ *
+ * @param force true to force, false for normal
+ * @return a reference to this object.
+ */
+ public ParticleBuilder force(boolean force) {
+ this.force = force;
@@ -366,6 +398,8 @@ index 00000000..f7aa162f
+ /**
+ * Sets the particle Color.
+ * Only valid for REDSTONE, SPELL_MOB and SPELL_MOB_AMBIENT.
+ * @param color the new particle color
+ * @return a reference to this object.
+ */
+ public ParticleBuilder color(Color color) {
+ return color(color.getRed(), color.getGreen(), color.getBlue());
@@ -374,6 +408,10 @@ index 00000000..f7aa162f
+ /**
+ * Sets the particle Color.
+ * Only valid for REDSTONE, SPELL_MOB and SPELL_MOB_AMBIENT.
+ * @param r red color component
+ * @param g green color component
+ * @param b blue color component
+ * @return a reference to this object.
+ */
+ public ParticleBuilder color(int r, int g, int b) {
+ if (particle != Particle.REDSTONE && particle != Particle.SPELL_MOB && particle != Particle.SPELL_MOB_AMBIENT) {
@@ -394,7 +432,7 @@ index 00000000..f7aa162f
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 9794c13e..cc9c2c5e 100644
index 9794c13e5..6582e51f2 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -0,0 +0,0 @@ public enum Particle {
@@ -405,6 +443,8 @@ index 9794c13e..cc9c2c5e 100644
+ // Paper start - Particle API expansion
+ /**
+ * Creates a {@link com.destroystokyo.paper.ParticleBuilder}
+ *
+ * @return a {@link com.destroystokyo.paper.ParticleBuilder} for the particle
+ */
+ public com.destroystokyo.paper.ParticleBuilder builder() {
+ return new com.destroystokyo.paper.ParticleBuilder(this);
@@ -412,7 +452,7 @@ index 9794c13e..cc9c2c5e 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 3b81f81e..114e81dd 100644
index 8d29ede0a..b983bdc54 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {