Skip to content

Commit b1a4a2a

Browse files
committed
fix: init native library first
1 parent e48a095 commit b1a4a2a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/org/eu/smileyik/luaInMinecraftBukkitII/LuaInMinecraftBukkit.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ public void reload() {
116116

117117
// load native library.
118118
getScheduler().runTaskAsynchronously(this, () -> {
119-
CompletableFuture<Object> future = new CompletableFuture<>();
120-
getScheduler().runTaskAsynchronously(this, () -> {
121-
asyncInit(config);
122-
future.complete(null);
123-
});
124-
125119
if (LOADED_NATIVES.compareAndSet(false, true)) {
126120
getLogger().info("Loading lua native libraries...");
127121
try {
@@ -133,6 +127,12 @@ public void reload() {
133127
getLogger().info("Successfully loaded lua native libraries, lua version: " +
134128
LuaState.LUA_VERSION);
135129
}
130+
131+
CompletableFuture<Object> future = new CompletableFuture<>();
132+
getScheduler().runTaskAsynchronously(this, () -> {
133+
asyncInit(config);
134+
future.complete(null);
135+
});
136136
// after loaded then init plugin.
137137
try {
138138
future.get();

0 commit comments

Comments
 (0)