Skip to content

Commit

Permalink
fix: Primary thread can't call PlayerStorageItemAddEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
blank038 committed Dec 1, 2023
1 parent b370c8f commit 9b1e02a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.Getter;
import lombok.Setter;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.ItemStack;
Expand All @@ -25,7 +26,7 @@ public class PlayerStoreItemAddEvent extends Event {
private ItemStack itemStack;

public PlayerStoreItemAddEvent(UUID uuid, ItemStack itemStack, String reason) {
super(true);
super(!Bukkit.getServer().isPrimaryThread());
this.ownerUniqueId = uuid;
this.itemStack = itemStack;
this.reason = reason;
Expand Down

0 comments on commit 9b1e02a

Please sign in to comment.