Fixed arrow particles when using Redstone particle closes #119

This commit is contained in:
HexedHero 2020-09-11 20:12:41 +01:00
parent 8834210463
commit 9855be1928

View File

@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.api;
import org.bukkit.Color;
import org.bukkit.Particle;
import org.bukkit.Particle.DustOptions;
import org.bukkit.entity.Arrow;
import org.bukkit.scheduler.BukkitRunnable;
@ -42,6 +43,9 @@ public class ArrowParticles extends BukkitRunnable {
}
if (color != null)
if (particle.getDataType() == DustOptions.class)
arrow.getWorld().spawnParticle(particle, arrow.getLocation().add(0, .25, 0), amount, offset, offset, offset, new Particle.DustOptions(color, 1));
else
arrow.getWorld().spawnParticle(particle, arrow.getLocation().add(0, .25, 0), amount, offset, offset, offset, color);
else
arrow.getWorld().spawnParticle(particle, arrow.getLocation().add(0, .25, 0), amount, offset, offset, offset, speed);