Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.lolermc;
- import java.io.File;
- import java.util.ArrayList;
- import org.bukkit.Bukkit;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.entity.Player;
- import org.bukkit.event.Listener;
- import org.bukkit.plugin.RegisteredServiceProvider;
- import org.bukkit.plugin.java.JavaPlugin;
- import de.Herbystar.TTA.TTA_Methods;
- import net.milkbowl.vault.economy.Economy;
- public class Main extends JavaPlugin implements Listener{
- public static Economy economy = null;
- int messages_anzahl = 6;
- ArrayList<String> particles = new ArrayList<>();
- File Config = new File("plugins/System", "config.yml");
- FileConfiguration config = YamlConfiguration.loadConfiguration(Config);
- File Players = new File("plugins/System", "players.yml");
- FileConfiguration players = YamlConfiguration.loadConfiguration(Players);
- File Lang = new File("plugins/System", "language.yml");
- FileConfiguration lang = YamlConfiguration.loadConfiguration(Lang);
- File Friends = new File("plugins/System", "friends.yml");
- FileConfiguration friends = YamlConfiguration.loadConfiguration(Friends);
- public void onEnable(){
- this.setupEconomy();
- this.getServer().getPluginManager().registerEvents(this, this);
- System.out.println("<-------DISCLAIMER------->");
- System.out.println("System - By LolerMC");
- System.out.println("Version: 4.0");
- System.out.println("<-------DISCLAIMER------->");
- Bukkit.broadcastMessage("§c<§e--------§cCREDITS§e-----------§c>");
- Bukkit.broadcastMessage("§cAuthor: §eLolerMC");
- Bukkit.broadcastMessage("§cVersion: §e4.0");
- Bukkit.broadcastMessage("§cCodename: de-lolermc-plexed-system-4.0-release");
- Bukkit.broadcastMessage("§cCodename2: de-lolermc-plexed-system-friendsystem-1.0-beta");
- Bukkit.broadcastMessage("§c<§e---------------------------§c>");
- Bukkit.broadcastMessage("§8[§cSystem§8] §aErfolgreich neugeladen!");
- registerEvents();
- registerCommands();
- makeConfig();
- runAutoMessage();
- }
- private void runAutoMessage() {
- getServer().getScheduler().runTaskTimerAsynchronously(this, new Runnable(){
- @Override
- public void run() {
- if(messages_anzahl <= 6){
- if(messages_anzahl > 1){
- messages_anzahl--;
- for(Player players : Bukkit.getOnlinePlayers()){
- TTA_Methods.sendActionBar(players, config.getString("AutoMessage." + messages_anzahl));
- }
- }else{
- messages_anzahl = 6;
- }
- }else{
- messages_anzahl = 6;
- }
- }
- }, 3*20, 5*20);
- }
- public void registerEvents(){
- new ChatSystem(this);
- new Motd(this);
- new PremiumJoin(this);
- new InfoBoard(this);
- new Tablist(this);
- new Join(this);
- new Jumppads(this);
- new Particles(this);
- new Commands(this);
- new LobbyItems(this);
- new LobbyItemsGadgets(this);
- new LobbyItemNavigator(this);
- new WarnBanSystem(this);
- new FriendSystem(this);
- new Build(this);
- Bukkit.broadcastMessage("§8[§bPlexed§8] §aEvents geladen!");
- }
- public void registerCommands(){
- getCommand("system").setExecutor(new Commands(this));
- getCommand("system").setExecutor(new Motd(this));
- getCommand("day").setExecutor(new Commands(this));
- getCommand("noon").setExecutor(new Commands(this));
- getCommand("night").setExecutor(new Commands(this));
- getCommand("storm").setExecutor(new Commands(this));
- getCommand("sun").setExecutor(new Commands(this));
- getCommand("gamemode").setExecutor(new Commands(this));
- getCommand("sethub").setExecutor(new SpawnAndHub(this));
- getCommand("hub").setExecutor(new SpawnAndHub(this));
- getCommand("spawn").setExecutor(new SpawnAndHub(this));
- getCommand("friend").setExecutor(new FriendSystem(this));
- getCommand("ban").setExecutor(new WarnBanSystem(this));
- getCommand("unban").setExecutor(new WarnBanSystem(this));
- getCommand("warn").setExecutor(new WarnBanSystem(this));
- getCommand("kick").setExecutor(new WarnBanSystem(this));
- getCommand("unwarn").setExecutor(new WarnBanSystem(this));
- getCommand("playerinfo").setExecutor(new Commands(this));
- getCommand("tracer").setExecutor(new Commands(this));
- getCommand("build").setExecutor(new Build(this));
- getCommand("kits").setExecutor(new Commands(this));
- getCommand("adminpanel").setExecutor(new AdminPanel(this));
- Bukkit.broadcastMessage("§8[§bPlexed§8] §aCommands geladen!");
- }
- public void makeConfig(){
- if (Config.exists() == false){
- try{
- config.set("max_normal_players", 150);
- config.set("motd", "§b§lPlexed §8- §aMinigames | §bVersion§a [1.8-1.10]\n§cKeine Motd eingestellt!");
- config.set("wartungsmodus", "off");
- config.set("AutoMessage.1", "§cDas ist die §e1. §cNachricht!");
- config.set("AutoMessage.2", "§cDas ist die §e2. §cNachricht!");
- config.set("AutoMessage.3", "§cDas ist die §e3. §cNachricht!");
- config.set("AutoMessage.4", "§cDas ist die §e4. §cNachricht!");
- config.set("AutoMessage.5", "§cDas ist die §e5. §cNachricht!");
- config.save(Config);
- }catch(Exception e){
- System.err.println("[System] Konnte 'config.yml' nicht erstellen!");
- }
- }
- if(Players.exists() == false){
- try{
- players.save(Players);
- }catch(Exception e){
- System.err.println("[System] Konnte 'players.yml' nicht erstellen!");
- }
- }
- if(Friends.exists() == false){
- try{
- friends.save(Friends);
- }catch(Exception e){
- System.err.println("[System] Konnte 'friends.yml' nicht erstellen!");
- }
- }
- }
- private boolean setupEconomy()
- {
- RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
- if (economyProvider != null) {
- economy = economyProvider.getProvider();
- }
- return (economy != null);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement