From 5514753f3121d81c33b696a47fcb49b1fb6f0013 Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Sat, 2 Jan 2021 02:44:23 +0300 Subject: [PATCH 1/2] add EffectsHelper --- src/main/java/ghast/EffectsHelper.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main/java/ghast/EffectsHelper.java diff --git a/src/main/java/ghast/EffectsHelper.java b/src/main/java/ghast/EffectsHelper.java new file mode 100644 index 0000000..15e21ba --- /dev/null +++ b/src/main/java/ghast/EffectsHelper.java @@ -0,0 +1,16 @@ +package ghast; + +import lombok.experimental.UtilityClass; +import org.bukkit.Location; +import org.bukkit.Sound; +import org.bukkit.SoundCategory; + +@UtilityClass +@SuppressWarnings("unused") +public class EffectsHelper { + + public void playSound(Location location, Sound sound, float pitch) { + location.getWorld().playSound(location, sound, SoundCategory.MASTER, 1.0f, pitch); + } +} + From 6155bb0d422220c05df1952070ec5ee6765529cf Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Sat, 2 Jan 2021 02:51:07 +0300 Subject: [PATCH 2/2] EffectsHelper: add spawn particle --- src/main/java/ghast/EffectsHelper.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/ghast/EffectsHelper.java b/src/main/java/ghast/EffectsHelper.java index 15e21ba..cf6d6ea 100644 --- a/src/main/java/ghast/EffectsHelper.java +++ b/src/main/java/ghast/EffectsHelper.java @@ -2,8 +2,10 @@ package ghast; import lombok.experimental.UtilityClass; import org.bukkit.Location; +import org.bukkit.Particle; import org.bukkit.Sound; import org.bukkit.SoundCategory; +import org.bukkit.util.Vector; @UtilityClass @SuppressWarnings("unused") @@ -12,5 +14,14 @@ public class EffectsHelper { public void playSound(Location location, Sound sound, float pitch) { location.getWorld().playSound(location, sound, SoundCategory.MASTER, 1.0f, pitch); } + + public void particle(Location location, Particle particle, double dx, double dy, double dz, double speed, int amount) { + location.getWorld().spawnParticle(particle, location, amount, dx, dy, dz, speed); + } + + //TODO нужно проверить + public void particle(Location location, Particle particle, Vector vector, double speed, int amount) { + particle(location, particle, vector.getX(), vector.getY(), vector.getZ(), speed, amount); + } }