Skip to content

Commit

Permalink
Fixed the scheduler errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
LoginException committed Jun 25, 2024
1 parent ce84f6f commit d6e2073
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@

<dependencies>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<groupId>dev.folia</groupId>
<artifactId>folia-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/me/hsgamer/yatpa/teleport/TeleportManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import me.hsgamer.yatpa.YATPA;
import me.hsgamer.yatpa.event.PostTeleportEvent;
import me.hsgamer.yatpa.request.RequestEntry;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;

Expand Down Expand Up @@ -62,7 +63,7 @@ public boolean getAsBoolean() {
if (teleportFuture == null) {
teleportFuture = teleport.teleport(player, targetLocation);
PostTeleportEvent event = new PostTeleportEvent(requestEntry);
plugin.getServer().getPluginManager().callEvent(event);
plugin.getServer().getGlobalRegionScheduler().run(plugin, consumer -> Bukkit.getServer().getPluginManager().callEvent(event));
return true;
} else {
return !teleportFuture.isDone();
Expand Down

0 comments on commit d6e2073

Please sign in to comment.