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; package me.adrianed.authmevelocity.api.paper.event;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent; import org.bukkit.event.player.PlayerEvent;
@ -20,7 +19,7 @@ public final class LoginByProxyEvent extends PlayerEvent {
* @param who the player to be logged in * @param who the player to be logged in
*/ */
public LoginByProxyEvent(@NotNull Player who) { public LoginByProxyEvent(@NotNull Player who) {
super(who, !Bukkit.isPrimaryThread()); super(who);
} }
@Override @Override
@ -28,4 +27,13 @@ public final class LoginByProxyEvent extends PlayerEvent {
return HANDLER_LIST; 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; package me.adrianed.authmevelocity.api.paper.event;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList; import org.bukkit.event.HandlerList;
@ -17,10 +16,10 @@ public final class PreSendLoginEvent extends PlayerEvent implements Cancellable
/** /**
* Creates a new PreSendLoginEvent * Creates a new PreSendLoginEvent
* @param player the player to be sended * @param player the player to be sent
*/ */
public PreSendLoginEvent(@NotNull Player player) { public PreSendLoginEvent(@NotNull Player player) {
super(player, !Bukkit.isPrimaryThread()); super(player);
} }
@Override @Override
@ -42,6 +41,7 @@ public final class PreSendLoginEvent extends PlayerEvent implements Cancellable
* Obtain the handlerlist of this event * Obtain the handlerlist of this event
* @return the handlerlist * @return the handlerlist
*/ */
@SuppressWarnings("unused")
public static @NotNull HandlerList getHandlerList() { public static @NotNull HandlerList getHandlerList() {
return HANDLERS; return HANDLERS;
} }

View File

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