fix a few things

This commit is contained in:
Telesphoreo 2022-04-14 17:20:38 -05:00
parent b041f2b2e0
commit f8e65c179b
3 changed files with 13 additions and 8 deletions

View File

@ -29,9 +29,9 @@ dependencies {
compileOnly("org.projectlombok:lombok:1.18.22")
annotationProcessor("org.projectlombok:lombok:1.18.22")
compileOnly("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT")
compileOnly("dev.plex:Plex:1.0.1-SNAPSHOT")
compileOnly("dev.plex:Plex:1.0.2-SNAPSHOT")
compileOnly("me.totalfreedom:BukkitTelnet:4.8") {
exclude("org.spigotmc", "spigot-api")
exclude("org.papermc.paper", "paper-api")
}
}

View File

@ -27,6 +27,11 @@ public class BukkitTelnetModule extends PlexModule
throw new RuntimeException("Plex-BukkitTelnet requires the 'Vault' plugin as well as a Permissions plugin that hooks into 'Vault.' We recommend LuckPerms!");
}
if (!Bukkit.getPluginManager().isPluginEnabled("BukkitTelnet"))
{
throw new RuntimeException("The Plex-BukkitTelnet module requires the BukkitTelnet plugin to work. Please download it from: https://github.com/plexusorg/BukkitTelnet/releases");
}
this.registerListener(new BukkitTelnetListener());
this.bukkitTelnet = BukkitTelnet.getPlugin();
}

View File

@ -5,10 +5,7 @@ import dev.plex.player.PlexPlayer;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexLog;
import me.totalfreedom.bukkittelnet.BukkitTelnet;
import me.totalfreedom.bukkittelnet.api.TelnetCommandEvent;
import me.totalfreedom.bukkittelnet.api.TelnetPreLoginEvent;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.event.EventHandler;
public class BukkitTelnetListener extends PlexListener
@ -18,7 +15,10 @@ public class BukkitTelnetListener extends PlexListener
{
final String ip = event.getIp();
final PlexPlayer player = DataUtils.getPlayerByIP(ip);
if (player == null) return;
if (player == null)
{
return;
}
if (plugin.getSystem().equalsIgnoreCase("ranks"))
{
PlexLog.debug("Plex-BukkitTelnet using ranks check");
@ -27,7 +27,8 @@ public class BukkitTelnetListener extends PlexListener
event.setBypassPassword(true);
event.setName(player.getName());
}
} else if (plugin.getSystem().equalsIgnoreCase("permissions"))
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
PlexLog.debug("Plex-BukkitTelnet using permissions check");
if (BukkitTelnet.getPlugin().handler.hasPermission(player.getName(), "plex.telnet.autoconnect"))
@ -38,5 +39,4 @@ public class BukkitTelnetListener extends PlexListener
}
}
}