Skip to content

Commit

Permalink
La création du monde doit se faire sur le thread global
Browse files Browse the repository at this point in the history
  • Loading branch information
Euphillya committed Jan 16, 2024
1 parent 414ebbd commit 585c207
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 17 deletions.
8 changes: 0 additions & 8 deletions .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/sonarlint/securityhotspotstore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
public class WorldNMS {

public static WorldFeedback.FeedbackWorld createWorld(WorldCreator creator) {
io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("World create can be done only on global tick thread");
CraftServer craftServer = (CraftServer) Bukkit.getServer();
DedicatedServer console = craftServer.getServer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
public class WorldNMS {

public static WorldFeedback.FeedbackWorld createWorld(WorldCreator creator) {
io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("World create can be done only on global tick thread");
CraftServer craftServer = (CraftServer) Bukkit.getServer();
DedicatedServer console = craftServer.getServer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
public class WorldNMS {

public static WorldFeedback.FeedbackWorld createWorld(WorldCreator creator) {
io.papermc.paper.threadedregions.RegionizedServer.ensureGlobalTickThread("World create can be done only on global tick thread");
CraftServer craftServer = (CraftServer) Bukkit.getServer();
DedicatedServer console = craftServer.getServer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import fr.euphyllia.skyfolia.api.InterneAPI;
import fr.euphyllia.skyfolia.managers.world.WorldsManager;
import org.bukkit.Bukkit;

public class Managers {

Expand All @@ -15,7 +16,7 @@ public Managers(InterneAPI interneAPI) {

public void init() {
if (this.worldsManager != null) {
this.worldsManager.initWorld();
Bukkit.getGlobalRegionScheduler().run(this.api.getPlugin(), task -> this.worldsManager.initWorld());
}
}
}

0 comments on commit 585c207

Please sign in to comment.