From be9826c6e78df000fdae6c9b8b15c375f5a8616d Mon Sep 17 00:00:00 2001 From: DerFrZocker Date: Sun, 9 Jun 2024 13:01:07 +0200 Subject: [PATCH] Add commodore for particle --- src/main/java/org/bukkit/World.java | 42 +++++++++++++++++++++ src/main/java/org/bukkit/entity/Player.java | 42 +++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index d0867284..4a49b177 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -2708,6 +2708,48 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient */ public void spawnParticle(@NotNull Particle.Typed particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be + * randomized positively and negatively by the offset parameters + * on each axis. + * + * @param particle the particle to spawn + * @param location the location to spawn at + * @param count the number of particles + * @param offsetX the maximum random offset on the X axis + * @param offsetY the maximum random offset on the Y axis + * @param offsetZ the maximum random offset on the Z axis + * @param extra the extra data for this particle, depends on the + * particle used (normally speed) + * @param force whether to send the particle to players within an extended + * range and encourage their client to render it regardless of + * settings + */ + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, boolean force); + + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be + * randomized positively and negatively by the offset parameters + * on each axis. + * + * @param particle the particle to spawn + * @param x the position on the x axis to spawn at + * @param y the position on the y axis to spawn at + * @param z the position on the z axis to spawn at + * @param count the number of particles + * @param offsetX the maximum random offset on the X axis + * @param offsetY the maximum random offset on the Y axis + * @param offsetZ the maximum random offset on the Z axis + * @param extra the extra data for this particle, depends on the + * particle used (normally speed) + * @param force whether to send the particle to players within an extended + * range and encourage their client to render it regardless of + * settings + */ + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, boolean force); + /** * Find the closest nearby structure of a given {@link StructureType}. * Finding unexplored structures can, and will, block if the world is diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 0be366b8..b9360a7d 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -2134,6 +2134,48 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void spawnParticle(@NotNull Particle.Typed particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be + * randomized positively and negatively by the offset parameters + * on each axis. + * + * @param particle the particle to spawn + * @param location the location to spawn at + * @param count the number of particles + * @param offsetX the maximum random offset on the X axis + * @param offsetY the maximum random offset on the Y axis + * @param offsetZ the maximum random offset on the Z axis + * @param extra the extra data for this particle, depends on the + * particle used (normally speed) + * @param force whether to send the particle to the player in an extended + * range and encourage their client to render it regardless of + * settings + */ + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, boolean force); + + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be + * randomized positively and negatively by the offset parameters + * on each axis. + * + * @param particle the particle to spawn + * @param x the position on the x axis to spawn at + * @param y the position on the y axis to spawn at + * @param z the position on the z axis to spawn at + * @param count the number of particles + * @param offsetX the maximum random offset on the X axis + * @param offsetY the maximum random offset on the Y axis + * @param offsetZ the maximum random offset on the Z axis + * @param extra the extra data for this particle, depends on the + * particle used (normally speed) + * @param force whether to send the particle to the player in an extended + * range and encourage their client to render it regardless of + * settings + */ + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, boolean force); + /** * Return the player's progression on the specified advancement. *