34 lines
1.3 KiB
Java
34 lines
1.3 KiB
Java
// This claas was created by JaTiTV
|
|
|
|
package net.t2code.alias.Spigot.system;
|
|
|
|
import net.t2code.alias.Spigot.Main;
|
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
|
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.player.PlayerLoginEvent;
|
|
import org.bukkit.scheduler.BukkitRunnable;
|
|
|
|
public class JoinEvent implements Listener {
|
|
|
|
@EventHandler
|
|
public void onJoinEvent(PlayerLoginEvent event) {
|
|
Player player = event.getPlayer();
|
|
new BukkitRunnable() {
|
|
@Override
|
|
public void run() {
|
|
String publicVersion = UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion;
|
|
if (player.hasPermission("alias.updatemsg") || player.isOp()) {
|
|
if (!Main.version.equals(publicVersion)) {
|
|
if (SelectLibConfig.UpdateCheckOnJoin) {
|
|
UpdateAPI.sendUpdateMsg(Main.prefix, Main.spigot, Main.discord, Main.version, publicVersion, player);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}.runTaskLater(Main.plugin, 200L);
|
|
}
|
|
} |