From 051ad5cfe42c980bd66428631c59313af546d34a Mon Sep 17 00:00:00 2001 From: GregZ_ Date: Fri, 23 Jun 2017 16:48:11 +0100 Subject: [PATCH] Quests - V2.8.6-02 - Code reformat - By GregZ_ * Incremented dev version in pom.xml. * Added javadoc comments to all files in the me.blackvein.particles package. * Added javadoc source folder, this will eventually contain all of the package-info files as well as any javadoc resources and overview pages. --- pom.xml | 2 +- .../me/blackvein/particles/Eff_1_10_R1.java | 47 ++++++++++++++++++ .../me/blackvein/particles/Eff_1_11_R1.java | 47 ++++++++++++++++++ .../me/blackvein/particles/Eff_1_12_R1.java | 47 ++++++++++++++++++ .../me/blackvein/particles/Eff_1_7_R3.java | 41 ++++++++++++++++ .../me/blackvein/particles/Eff_1_7_R4.java | 41 ++++++++++++++++ .../me/blackvein/particles/Eff_1_8_R1.java | 47 ++++++++++++++++++ .../me/blackvein/particles/Eff_1_8_R2.java | 47 ++++++++++++++++++ .../me/blackvein/particles/Eff_1_8_R3.java | 47 ++++++++++++++++++ .../me/blackvein/particles/Eff_1_9_R1.java | 48 +++++++++++++++++++ .../me/blackvein/particles/Eff_1_9_R2.java | 47 ++++++++++++++++++ .../me/blackvein/particles/package-info.java | 5 ++ 12 files changed, 465 insertions(+), 1 deletion(-) create mode 100644 src/main/javadoc/me/blackvein/particles/package-info.java diff --git a/pom.xml b/pom.xml index ef6f49a70..9760fc86a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ me.blackvein.quests quests - 2.8.6-01 + 2.8.6-02 quests https://github.com/FlyingPikachu/Quests/ jar diff --git a/src/main/java/me/blackvein/particles/Eff_1_10_R1.java b/src/main/java/me/blackvein/particles/Eff_1_10_R1.java index b915f346b..0d0e19270 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_10_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_10_R1.java @@ -7,6 +7,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_10_R1.EnumParticle; import net.minecraft.server.v1_10_R1.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_10_R1 Enum, it contains all valid effects that players can + * use with the 1.10 server version. + * + * @author FlyingPikachu + * @author GregZ_ + * @since 2.6.2 + * @version 3 + */ public enum Eff_1_10_R1 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -57,12 +66,50 @@ public enum Eff_1_10_R1 { DAMAGE_INDICATOR(EnumParticle.DAMAGE_INDICATOR), FALLING_DUST(EnumParticle.FALLING_DUST); + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_10_R1 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_10_R1(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_11_R1.java b/src/main/java/me/blackvein/particles/Eff_1_11_R1.java index 1f0f34689..34ff32f45 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_11_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_11_R1.java @@ -7,6 +7,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_11_R1.EnumParticle; import net.minecraft.server.v1_11_R1.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_11_R1 Enum, it contains all valid effects that players can + * use with the 1.11 server version. + * + * @author FlyingPikachu + * @author GregZ_ + * @since 2.7.4 + * @version 3 + */ public enum Eff_1_11_R1 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -59,12 +68,50 @@ public enum Eff_1_11_R1 { SPIT(EnumParticle.SPIT), TOTEM(EnumParticle.TOTEM); + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_11_R1 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_11_R1(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_12_R1.java b/src/main/java/me/blackvein/particles/Eff_1_12_R1.java index 1db749541..727322a54 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_12_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_12_R1.java @@ -7,6 +7,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_12_R1.EnumParticle; import net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_12_R1 Enum, it contains all valid effects that players can + * use with the 1.12 server version. + * + * @author FlyingPikachu + * @author GregZ_ + * @since 2.8.0 + * @version 3 + */ public enum Eff_1_12_R1 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -59,12 +68,50 @@ public enum Eff_1_12_R1 { SPIT(EnumParticle.SPIT), TOTEM(EnumParticle.TOTEM); + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_12_R1 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_12_R1(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_7_R3.java b/src/main/java/me/blackvein/particles/Eff_1_7_R3.java index 689525977..cc433d55b 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_7_R3.java +++ b/src/main/java/me/blackvein/particles/Eff_1_7_R3.java @@ -6,6 +6,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_7_R3 Enum, it contains all valid effects that players can + * use with the 1.7.9 server version. + * + * @author Blackvein + * @author GregZ_ + * @since 1.9.0 + * @version 3 + */ public enum Eff_1_7_R3 { HUGE_EXPLOSION("hugeexplosion"), @@ -44,12 +53,44 @@ public enum Eff_1_7_R3 { ICONCRACK("iconcrack_"), TILECRACK("tilecrack_"); + /** + * The name of the particle to be sent. + */ private final String particleName; + /** + * Create a new instance of the Eff_1_7_R3 enum with the given particle name + * to be sent. + * + * @param particleName + * The name of the particle to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_7_R3(String particleName) { this.particleName = particleName; } + /** + * Send the given particle to the player via NMS. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleName, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_7_R4.java b/src/main/java/me/blackvein/particles/Eff_1_7_R4.java index 224a71d04..9c14e345f 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_7_R4.java +++ b/src/main/java/me/blackvein/particles/Eff_1_7_R4.java @@ -6,6 +6,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_7_R4 Enum, it contains all valid effects that players can + * use with the 1.7.10 server version. + * + * @author Blackvein + * @author GregZ_ + * @since 1.9.0 + * @version 3 + */ public enum Eff_1_7_R4 { HUGE_EXPLOSION("hugeexplosion"), @@ -44,12 +53,44 @@ public enum Eff_1_7_R4 { ICONCRACK("iconcrack_"), TILECRACK("tilecrack_"); + /** + * The name of the particle to be sent. + */ private final String particleName; + /** + * Create a new instance of the Eff_1_7_R4 enum with the given particle name + * to be sent. + * + * @param particleName + * The name of the particle to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_7_R4(String particleName) { this.particleName = particleName; } + /** + * Send the given particle to the player via NMS. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleName, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_8_R1.java b/src/main/java/me/blackvein/particles/Eff_1_8_R1.java index c28b7dd08..fb48d5419 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_8_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_8_R1.java @@ -7,6 +7,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_8_R1.EnumParticle; import net.minecraft.server.v1_8_R1.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_8_R1 Enum, it contains all valid effects that players can + * use with the 1.8 server version. + * + * @author FlyingPikachu + * @author GregZ_ + * @since 2.0.0 + * @version 3 + */ public enum Eff_1_8_R1 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -52,12 +61,50 @@ public enum Eff_1_8_R1 { TAKE(EnumParticle.ITEM_TAKE), MOB_APPEARANCE(EnumParticle.MOB_APPEARANCE); + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_8_R1 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_8_R1(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_8_R2.java b/src/main/java/me/blackvein/particles/Eff_1_8_R2.java index 381dff463..b6d0ec4c8 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_8_R2.java +++ b/src/main/java/me/blackvein/particles/Eff_1_8_R2.java @@ -7,6 +7,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_8_R2.EnumParticle; import net.minecraft.server.v1_8_R2.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_8_R2 Enum, it contains all valid effects that players can + * use with the 1.8.3 server version. + * + * @author FlyingPikachu + * @author GregZ_ + * @since 2.3.1 + * @version 3 + */ public enum Eff_1_8_R2 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -52,12 +61,50 @@ public enum Eff_1_8_R2 { TAKE(EnumParticle.ITEM_TAKE), MOB_APPEARANCE(EnumParticle.MOB_APPEARANCE); + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_8_R1 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_8_R2(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_8_R3.java b/src/main/java/me/blackvein/particles/Eff_1_8_R3.java index af3300882..97ad56005 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_8_R3.java +++ b/src/main/java/me/blackvein/particles/Eff_1_8_R3.java @@ -7,6 +7,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_8_R3.EnumParticle; import net.minecraft.server.v1_8_R3.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_8_R3 Enum, it contains all valid effects that players can + * use with the 1.8.4 - 1.8.8 server versions. + * + * @author FlyingPikachu + * @author GregZ_ + * @since 2.5.0 + * @version 4 + */ public enum Eff_1_8_R3 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -52,12 +61,50 @@ public enum Eff_1_8_R3 { TAKE(EnumParticle.ITEM_TAKE), MOB_APPEARANCE(EnumParticle.MOB_APPEARANCE); + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_8_R3 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_8_R3(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_9_R1.java b/src/main/java/me/blackvein/particles/Eff_1_9_R1.java index 295e44ca1..071a27b27 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_9_R1.java +++ b/src/main/java/me/blackvein/particles/Eff_1_9_R1.java @@ -7,6 +7,16 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_9_R1.EnumParticle; import net.minecraft.server.v1_9_R1.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_9_R1 Enum, it contains all valid effects that players can + * use with the 1.9 server version. + * + * @author FlyingPikachu + * @author woutwoot + * @author GregZ_ + * @since 2.6.0 + * @version 5 + */ public enum Eff_1_9_R1 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -56,12 +66,50 @@ public enum Eff_1_9_R1 { ENDROD(EnumParticle.END_ROD), DAMAGE_INDICATOR(EnumParticle.DAMAGE_INDICATOR),; + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_9_R1 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_9_R1(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/java/me/blackvein/particles/Eff_1_9_R2.java b/src/main/java/me/blackvein/particles/Eff_1_9_R2.java index 5b10f8b1e..94b6e9401 100644 --- a/src/main/java/me/blackvein/particles/Eff_1_9_R2.java +++ b/src/main/java/me/blackvein/particles/Eff_1_9_R2.java @@ -7,6 +7,15 @@ import org.bukkit.entity.Player; import net.minecraft.server.v1_9_R2.EnumParticle; import net.minecraft.server.v1_9_R2.PacketPlayOutWorldParticles; +/** + * This is the Eff_1_9_R2 Enum, it contains all valid effects that players can + * use with the 1.9.4 server version. + * + * @author FlyingPikachu + * @author GregZ_ + * @since 2.6.1 + * @version 4 + */ public enum Eff_1_9_R2 { EXPLOSION(EnumParticle.EXPLOSION_NORMAL), @@ -56,12 +65,50 @@ public enum Eff_1_9_R2 { ENDROD(EnumParticle.END_ROD), DAMAGE_INDICATOR(EnumParticle.DAMAGE_INDICATOR),; + /** + * The NMS EnumParticle to be sent to the player. + */ private final EnumParticle particleEnum; + /** + * Create a new instance of the Eff_1_9_R2 enum with the given particle type + * to be sent. + * + * @param particleEnum + * The particle type to be sent to the player in the + * PacketPlayOutWorldParticles packet. + */ Eff_1_9_R2(EnumParticle particleEnum) { this.particleEnum = particleEnum; } + /** + * Send the given particle to the player via NMS. It should be noted that + * all particles have the range limit set to 256 due to the second variable + * in the packet constructor being false. + * + * @param player + * The player to send the particle to. + * @param location + * The location to play the particle at. + * @param offsetX + * The offset of the particle in the X direction. + * @param offsetY + * The offset of the particle in the Y direction. + * @param offsetZ + * The offset of the particle in the Z direction. + * @param speed + * The speed that the particle effect will be played at. + * @param count + * The number of particles to send to the player. + * @param data + * An integer array needed for some particles, this is used for + * packets such as block crack or particle colour on redstone / + * firework particles. + * @throws Exception + * A ReportedException may be thrown if the network manager + * fails to handle the packet. + */ public void sendToPlayer(Player player, Location location, float offsetX, float offsetY, float offsetZ, float speed, int count, int[] data) throws Exception { PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(particleEnum, false, (float) location.getX(), (float) location.getY(), (float) location.getZ(), offsetX, offsetY, offsetZ, speed, count, data); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); diff --git a/src/main/javadoc/me/blackvein/particles/package-info.java b/src/main/javadoc/me/blackvein/particles/package-info.java new file mode 100644 index 000000000..387432aa3 --- /dev/null +++ b/src/main/javadoc/me/blackvein/particles/package-info.java @@ -0,0 +1,5 @@ +/** + * Store the particle effect enums, these are used to support multiple versions + * of NMS. + */ +package me.blackvein.particles; \ No newline at end of file