Skip to content

Commit

Permalink
Merge pull request #24 from Boy0000/oraxen-fix
Browse files Browse the repository at this point in the history
Change event used to get OraxenPack
  • Loading branch information
yusshu authored Aug 9, 2024
2 parents 89fdb31 + 831553f commit 9390bbb
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 9390bbb

Please sign in to comment.