Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion AdvancedCore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
<repository>
<id>nickuc-repo</id>
<url>https://repo.nickuc.com/maven-releases/</url>
</repository>
</repositories>
<dependencies>
<dependency>
Expand Down Expand Up @@ -313,6 +317,12 @@
<version>5.18.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.nickuc.login</groupId>
<artifactId>api</artifactId>
<version>10.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
<profiles>
<profile>
Expand Down Expand Up @@ -491,4 +501,4 @@
</build>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import com.bencodez.advancedcore.listeners.*;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandMap;
Expand Down Expand Up @@ -56,12 +57,6 @@
import com.bencodez.advancedcore.command.CommandLoader;
import com.bencodez.advancedcore.command.executor.ValueRequestInputCommand;
import com.bencodez.advancedcore.data.ServerData;
import com.bencodez.advancedcore.listeners.AuthMeLogin;
import com.bencodez.advancedcore.listeners.LoginSecurityLogin;
import com.bencodez.advancedcore.listeners.PlayerJoinEvent;
import com.bencodez.advancedcore.listeners.PlayerShowListener;
import com.bencodez.advancedcore.listeners.PluginUpdateVersionEvent;
import com.bencodez.advancedcore.listeners.WorldChangeEvent;
import com.bencodez.advancedcore.logger.Logger;
import com.bencodez.simpleapi.command.TabCompleteHandle;
import com.bencodez.simpleapi.command.TabCompleteHandler;
Expand Down Expand Up @@ -105,6 +100,9 @@ public static void setInstance(AdvancedCorePlugin plugin) {
@Getter
private boolean authMeLoaded = false;

@Getter
private boolean nLoginLoaded = false;

@Getter
private boolean loginSecurityLoaded = false;

Expand Down Expand Up @@ -583,6 +581,12 @@ public void log(String log) {
authMeLoaded = true;
Bukkit.getPluginManager().registerEvents(new AuthMeLogin(this), this);
}

if (Bukkit.getPluginManager().getPlugin("nLogin") != null) {
nLoginLoaded = true;
Bukkit.getPluginManager().registerEvents(new NLoginAuthenticate(this), this);
}

if (Bukkit.getPluginManager().getPlugin("LoginSecurity") != null) {
loginSecurityLoaded = true;
Bukkit.getPluginManager().registerEvents(new LoginSecurityLogin(this), this);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.bencodez.advancedcore.listeners;

import com.bencodez.advancedcore.AdvancedCorePlugin;
import com.bencodez.advancedcore.api.misc.PlayerManager;
import com.nickuc.login.api.event.bukkit.auth.AuthenticateEvent;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class NLoginAuthenticate implements Listener {
private AdvancedCorePlugin plugin;

public NLoginAuthenticate(AdvancedCorePlugin plugin) {
this.plugin = plugin;
}

@EventHandler
public void nLoginLogin(AuthenticateEvent event) {

plugin.getBukkitScheduler().runTaskLaterAsynchronously(plugin, () -> {
if (event.getPlayer() != null) {
if (plugin.getOptions().isWaitUntilLoggedIn()) {
plugin.debug("nLogin Login: " + event.getPlayer().getName() + " ("
+ PlayerManager.getInstance().getUUID(event.getPlayer().getName()) + ")");
AdvancedCoreLoginEvent login = new AdvancedCoreLoginEvent(event.getPlayer());
Bukkit.getPluginManager().callEvent(login);
}
}
}, 2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void run() {
try {
if (plugin != null && plugin.isEnabled()) {
TabCompleteHandler.getInstance().onLogin();
if ((plugin.isAuthMeLoaded() || plugin.isLoginSecurityLoaded())
if ((plugin.isAuthMeLoaded() || plugin.isLoginSecurityLoaded() || plugin.isNLoginLoaded())
&& plugin.getOptions().isWaitUntilLoggedIn()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void onJoin(PlayerShowEvent event) {
@Override
public void run() {
if (plugin != null && plugin.isEnabled()) {
if (plugin.isAuthMeLoaded() && plugin.getOptions().isWaitUntilLoggedIn()) {
if ((plugin.isAuthMeLoaded() || plugin.isNLoginLoaded()) && plugin.getOptions().isWaitUntilLoggedIn()) {
return;
}

Expand Down