Add Java version to pom.xml
- Implement PreSendLoginEvent in paper
This commit is contained in:
parent
e5124a83b0
commit
aeca3de73b
7
pom.xml
7
pom.xml
@ -9,6 +9,11 @@
|
||||
<packaging>pom</packaging>
|
||||
<version>1.1.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>16</maven.compiler.source>
|
||||
<maven.compiler.target>16</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
@ -36,7 +41,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.3.0-SNAPSHOT</version>
|
||||
<version>3.3.1-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
|
@ -9,6 +9,11 @@
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>16</maven.compiler.source>
|
||||
<maven.compiler.target>16</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<artifactId>proxy</artifactId>
|
||||
|
||||
<repositories>
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.glyart.authmevelocity.spigot.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PreSendLoginEvent extends PlayerEvent implements Cancellable {
|
||||
private static final HandlerList HANDLERS = new HandlerList();
|
||||
private boolean isCancelled;
|
||||
|
||||
public PreSendLoginEvent(@NotNull Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return isCancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.isCancelled = cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return HANDLERS;
|
||||
}
|
||||
}
|
@ -1,7 +1,12 @@
|
||||
package com.glyart.authmevelocity.spigot.listeners;
|
||||
|
||||
import com.glyart.authmevelocity.spigot.AuthMeVelocityPlugin;
|
||||
import com.glyart.authmevelocity.spigot.events.PreSendLoginEvent;
|
||||
|
||||
import fr.xephi.authme.events.LoginEvent;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
@ -14,6 +19,11 @@ public class AuthMeListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onLogin(LoginEvent event) {
|
||||
plugin.sendLoginToProxy(event.getPlayer());
|
||||
Player player = event.getPlayer();
|
||||
PreSendLoginEvent sendloginevent = new PreSendLoginEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(sendloginevent);
|
||||
if(!sendloginevent.isCancelled()){
|
||||
plugin.sendLoginToProxy(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user