Made particles rotate based on initial player rotation if they aren't relative to the player, and current player rotation if they are
This commit is contained in:
@@ -16,18 +16,20 @@ public class FrameSpawnerLocation extends BukkitRunnable {
|
||||
private final List<Frame> frames;
|
||||
private Iterator<Frame> iterator;
|
||||
private final Location location;
|
||||
public FrameSpawnerLocation(int amount, int repeatDelay, List<Frame> frames, Location location) {
|
||||
private final float rotation;
|
||||
public FrameSpawnerLocation(int amount, int repeatDelay, List<Frame> frames, Location location, float rotation) {
|
||||
this.amount = amount;
|
||||
this.repeatDelay = (repeatDelay * 1000L) / 20;
|
||||
this.frames = frames;
|
||||
this.iterator = frames.iterator();
|
||||
this.location = location;
|
||||
this.rotation = rotation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (iterator.hasNext())
|
||||
iterator.next().spawn(location);
|
||||
iterator.next().spawn(location, rotation);
|
||||
else if (amount != 0) {
|
||||
iterator = frames.iterator();
|
||||
amount--;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class FrameSpawnerPlayer extends BukkitRunnable {
|
||||
return;
|
||||
}
|
||||
if (iterator.hasNext())
|
||||
iterator.next().spawn(player.getLocation());
|
||||
iterator.next().spawn(player.getLocation(), player.getLocation().getYaw());
|
||||
else if (amount != 0) {
|
||||
iterator = frames.iterator();
|
||||
amount--;
|
||||
|
||||
Reference in New Issue
Block a user