Moved more artifact math to separate thread

This commit is contained in:
Auxilor 2021-09-16 20:07:39 +01:00
parent 9cda787d0c
commit 172157c3fc

View File

@ -108,6 +108,7 @@ public abstract class Artifact extends EcoEnchant {
return;
}
this.getPlugin().getScheduler().runAsync(() -> {
Vector point1 = player.getLocation().getDirection().clone();
point1.rotateAroundY(Math.toRadians(90));
point1.multiply(1.2);
@ -120,6 +121,7 @@ public abstract class Artifact extends EcoEnchant {
player.getWorld().spawnParticle(particle, location1, 1, 0, 0, 0, 0, extra, true);
player.getWorld().spawnParticle(particle, location2, 1, 0, 0, 0, 0, extra, true);
});
}
@Override
@ -178,6 +180,6 @@ public abstract class Artifact extends EcoEnchant {
bukkitRunnable.cancel();
}
projectile.getLocation().getWorld().spawnParticle(particle, projectile.getLocation(), 1, 0, 0, 0, finalColor, extra, true);
}).runTaskTimer(4, ticks);
}).runTaskTimerAsynchronously(4, ticks);
}
}