Pārlūkot izejas kodu

Support calling SkillActivationPerkEvent off the main thread

This event was never considered as to if it would be called off the main thread,
this event should NOT be designed to signify that a skill activation is occuring,
just providing a means to manipulate those values by other plugins, etc
Shane Freeder 4 gadi atpakaļ
vecāks
revīzija
bd9794e744

+ 2 - 1
src/main/java/com/gmail/nossr50/events/skills/SkillActivationPerkEvent.java

@@ -1,5 +1,6 @@
 package com.gmail.nossr50.events.skills;
 
+import org.bukkit.Bukkit;
 import org.bukkit.entity.Player;
 import org.bukkit.event.Event;
 import org.bukkit.event.HandlerList;
@@ -16,7 +17,7 @@ public class SkillActivationPerkEvent extends Event {
     private final int maxTicks;
 
     public SkillActivationPerkEvent(Player player, int ticks, int maxTicks) {
-
+        super(!Bukkit.isPrimaryThread());
         this.player = player;
         this.ticks = ticks;
         this.maxTicks = maxTicks;