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
This commit is contained in:
Shane Freeder 2021-01-21 12:09:24 +00:00
parent f72497532f
commit bd9794e744

View File

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