Skip to content

Commit

Permalink
Fix AsyncStructureSpawnEvent crash (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Nov 3, 2024
1 parent 78c1bfe commit a9ea988
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.izzel.arclight.common.mixin.bukkit;

import org.bukkit.Bukkit;
import org.bukkit.event.world.AsyncStructureSpawnEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(value = AsyncStructureSpawnEvent.class, remap = false)
public class AsyncStructureSpawnEventMixin {

@ModifyArg(method = "<init>", at = @At(value = "INVOKE", target = "Lorg/bukkit/event/world/WorldEvent;<init>(Lorg/bukkit/World;Z)V"))
private static boolean arclight$async(boolean async) {
return !Bukkit.isPrimaryThread();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"compatibilityLevel": "JAVA_17",
"mixins": [
"AsyncStructureSpawnEventMixin",
"ColouredConsoleSenderMixin",
"CraftAbstractVillagerMixin",
"CraftBlockMixin",
Expand Down

0 comments on commit a9ea988

Please sign in to comment.