|
@@ -12,6 +12,7 @@ import java.util.Random;
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Level;
|
|
|
|
|
|
|
|
+import de.Linus122.Handlers.VanishHandler;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.OfflinePlayer;
|
|
import org.bukkit.OfflinePlayer;
|
|
import org.bukkit.configuration.file.FileConfiguration;
|
|
import org.bukkit.configuration.file.FileConfiguration;
|
|
@@ -40,17 +41,23 @@ public class TelegramChat extends JavaPlugin implements Listener {
|
|
|
|
|
|
private static Data data = new Data();
|
|
private static Data data = new Data();
|
|
public static Telegram telegramHook;
|
|
public static Telegram telegramHook;
|
|
|
|
+ private static TelegramChat instance;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void onEnable() {
|
|
public void onEnable() {
|
|
this.saveDefaultConfig();
|
|
this.saveDefaultConfig();
|
|
cfg = this.getConfig();
|
|
cfg = this.getConfig();
|
|
|
|
+ instance = this;
|
|
Utils.cfg = cfg;
|
|
Utils.cfg = cfg;
|
|
|
|
|
|
Bukkit.getPluginCommand("telegram").setExecutor(new TelegramCmd());
|
|
Bukkit.getPluginCommand("telegram").setExecutor(new TelegramCmd());
|
|
Bukkit.getPluginCommand("linktelegram").setExecutor(new LinkTelegramCmd());
|
|
Bukkit.getPluginCommand("linktelegram").setExecutor(new LinkTelegramCmd());
|
|
Bukkit.getPluginManager().registerEvents(this, this);
|
|
Bukkit.getPluginManager().registerEvents(this, this);
|
|
|
|
|
|
|
|
+ if (Bukkit.getPluginManager().isPluginEnabled("SuperVanish") || Bukkit.getPluginManager().isPluginEnabled("PremiumVanish")) {
|
|
|
|
+ Bukkit.getPluginManager().registerEvents(new VanishHandler(), this);
|
|
|
|
+ }
|
|
|
|
+
|
|
File dir = new File("plugins/TelegramChat/");
|
|
File dir = new File("plugins/TelegramChat/");
|
|
dir.mkdir();
|
|
dir.mkdir();
|
|
data = new Data();
|
|
data = new Data();
|
|
@@ -238,4 +245,9 @@ public class TelegramChat extends JavaPlugin implements Listener {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static TelegramChat getInstance()
|
|
|
|
+ {
|
|
|
|
+ return instance;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|