Skip to content

Commit 7f1765e

Browse files
committed
Use ticking thread method instead main thread method
1 parent 7c2def6 commit 7f1765e

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

worldedit-bukkit/adapters/adapter-1_20/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R1/PaperweightFaweWorldNativeAccess.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public synchronized net.minecraft.world.level.block.state.BlockState setBlockSta
138138
} else {
139139
currentTick = MinecraftServer.currentTick;
140140
}
141-
if (Fawe.isMainThread()) {
141+
if (Fawe.isTickThread()) {
142142
return levelChunk.setBlockState(blockPos, blockState,
143143
this.sideEffectSet != null && this.sideEffectSet.shouldApply(SideEffect.UPDATE)
144144
);
@@ -309,7 +309,7 @@ public void run(Object value) {
309309
}
310310
}
311311
};
312-
if (Fawe.isMainThread()) {
312+
if (Fawe.isTickThread()) {
313313
runnableVal.run();
314314
} else {
315315
TaskManager.taskManager().sync(runnableVal);

worldedit-bukkit/adapters/adapter-1_20/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R1/PaperweightPlatformAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public static LevelChunk ensureLoaded(ServerLevel serverLevel, int chunkX, int c
286286
if (nmsChunk != null) {
287287
return nmsChunk;
288288
}
289-
if (Fawe.isMainThread()) {
289+
if (Fawe.isTickThread()) {
290290
return serverLevel.getChunk(chunkX, chunkZ);
291291
}
292292
} else {
@@ -301,7 +301,7 @@ public static LevelChunk ensureLoaded(ServerLevel serverLevel, int chunkX, int c
301301
return nmsChunk;
302302
}
303303
// Avoid "async" methods from the main thread.
304-
if (Fawe.isMainThread()) {
304+
if (Fawe.isTickThread()) {
305305
return serverLevel.getChunk(chunkX, chunkZ);
306306
}
307307
if (FOLIA_SUPPORT) {

worldedit-core/src/main/java/com/fastasyncworldedit/core/util/TaskManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ public void parallel(Collection<Runnable> runnables, @Nullable Integer numThread
173173
@Deprecated
174174
public void runUnsafe(Runnable run) {
175175
QueueHandler queue = Fawe.instance().getQueueHandler();
176-
queue.startUnsafe(Fawe.isMainThread());
176+
queue.startUnsafe(Fawe.isTickThread());
177177
try {
178178
run.run();
179179
} catch (Throwable e) {
180180
e.printStackTrace();
181181
}
182-
queue.endUnsafe(Fawe.isMainThread());
182+
queue.endUnsafe(Fawe.isTickThread());
183183
}
184184

185185
/**

0 commit comments

Comments
 (0)