fix: Fixed Spigot and Paper <1.14 compatibility

This commit is contained in:
Adrian 2023-01-11 11:10:09 -05:00
parent affab83f03
commit 1daa00d97c
3 changed files with 14 additions and 6 deletions

View File

@ -1,6 +1,5 @@
package me.adrianed.authmevelocity.api.paper.event;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
@ -20,12 +19,21 @@ public final class LoginByProxyEvent extends PlayerEvent {
* @param who the player to be logged in
*/
public LoginByProxyEvent(@NotNull Player who) {
super(who, !Bukkit.isPrimaryThread());
super(who);
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLER_LIST;
}
/**
* Obtain the handlerlist of this event
* @return the handlerlist
*/
@SuppressWarnings("unused")
public static @NotNull HandlerList getHandlerList() {
return HANDLER_LIST;
}
}

View File

@ -1,6 +1,5 @@
package me.adrianed.authmevelocity.api.paper.event;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
@ -17,10 +16,10 @@ public final class PreSendLoginEvent extends PlayerEvent implements Cancellable
/**
* Creates a new PreSendLoginEvent
* @param player the player to be sended
* @param player the player to be sent
*/
public PreSendLoginEvent(@NotNull Player player) {
super(player, !Bukkit.isPrimaryThread());
super(player);
}
@Override
@ -42,6 +41,7 @@ public final class PreSendLoginEvent extends PlayerEvent implements Cancellable
* Obtain the handlerlist of this event
* @return the handlerlist
*/
@SuppressWarnings("unused")
public static @NotNull HandlerList getHandlerList() {
return HANDLERS;
}

View File

@ -1,5 +1,5 @@
group = me.adrianed.authmevelocity
version = 3.0.3
version = 3.0.4-SNAPSHOT
description = AuthMeReloaded Support for Velocity
url = https://modrinth.com/plugin/authmevelocity
id = authmevelocity