Skip to content

Commit

Permalink
use FoliaLib in FireworkMechanic
Browse files Browse the repository at this point in the history
  • Loading branch information
CJCrafter committed Jun 13, 2024
1 parent 6457fbc commit 1adb579
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.scheduler.BukkitRunnable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -230,12 +229,10 @@ public void playFor(CastData cast, List<Player> viewers) {
}

// Schedule a task to explode the firework later.
new BukkitRunnable() {
public void run() {
fakeEntity.playEffect(EntityEffect.FIREWORK_EXPLODE);
fakeEntity.remove();
}
}.runTaskLater(MechanicsCore.getPlugin(), flightTime);
MechanicsCore.getPlugin().getFoliaScheduler().runNextTick((ignore) -> {
fakeEntity.playEffect(EntityEffect.FIREWORK_EXPLODE);
fakeEntity.remove();
});
}

@Override
Expand Down

0 comments on commit 1adb579

Please sign in to comment.