Skip to content

Commit

Permalink
fix: OraxenPackGeneratedEvent -> OraxenPackPreUploadEvent to remove n…
Browse files Browse the repository at this point in the history
…eed for scheduler
  • Loading branch information
Boy0000 committed Jul 19, 2024
1 parent 89fdb31 commit 831553f
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import io.th0rgal.oraxen.api.OraxenPack;
import io.th0rgal.oraxen.api.events.OraxenPackGeneratedEvent;
import io.th0rgal.oraxen.api.events.OraxenPackPreUploadEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
Expand Down Expand Up @@ -53,11 +54,8 @@ public void listenForChanges(final @NotNull Plugin plugin, final @NotNull Runnab
requireNonNull(changeListener, "changeListener");
plugin.getServer().getPluginManager().registerEvents(new Listener() {
@EventHandler
public void onGenerated(final @NotNull OraxenPackGeneratedEvent event) {
// todo: change when Oraxen adds an event when they finished writing the pack
// at the moment, we have to wait 1 second to ensure that the pack is written
// (although it's not guaranteed)
plugin.getServer().getScheduler().runTaskLater(plugin, changeListener, 20L);
public void onGenerated(final @NotNull OraxenPackPreUploadEvent event) {
changeListener.run();
}
}, plugin);
}
Expand Down

0 comments on commit 831553f

Please sign in to comment.