Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- import java.util.ArrayList;
- import org.bukkit.Bukkit;
- import org.bukkit.command.ConsoleCommandSender;
- import org.bukkit.configuration.InvalidConfigurationException;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.plugin.java.JavaPlugin;
- import de.devfeuer.skypvp.Utis.MySQL;
- import de.devfeuer.skypvp.Utis.user;
- import de.devfeuer.skypvp.command.command_ChatClear;
- import de.devfeuer.skypvp.command.command_Clan;
- import de.devfeuer.skypvp.command.command_Clear;
- import de.devfeuer.skypvp.command.command_Gamemode;
- import de.devfeuer.skypvp.command.command_GiveAll;
- import de.devfeuer.skypvp.command.command_GlobalMute;
- import de.devfeuer.skypvp.command.command_Hub;
- import de.devfeuer.skypvp.command.command_Kick;
- import de.devfeuer.skypvp.command.command_ME;
- import de.devfeuer.skypvp.command.command_MSG;
- import de.devfeuer.skypvp.command.command_Reload;
- import de.devfeuer.skypvp.command.command_Rename;
- import de.devfeuer.skypvp.command.command_Repair;
- import de.devfeuer.skypvp.command.command_Report;
- import de.devfeuer.skypvp.command.command_SetSpawn;
- import de.devfeuer.skypvp.command.command_Spawn;
- import de.devfeuer.skypvp.command.command_Spenden;
- import de.devfeuer.skypvp.command.command_Stack;
- import de.devfeuer.skypvp.command.command_Support;
- import de.devfeuer.skypvp.command.command_Team;
- import de.devfeuer.skypvp.command.command_TeamChat;
- import de.devfeuer.skypvp.command.command_Test;
- import de.devfeuer.skypvp.command.command_TpAll;
- import de.devfeuer.skypvp.command.command_Umfrage;
- import de.devfeuer.skypvp.command.command_Warp;
- import de.devfeuer.skypvp.command.command_XP;
- import de.devfeuer.skypvp.command.command_ban;
- import de.devfeuer.skypvp.command.command_delwarp;
- import de.devfeuer.skypvp.command.command_fly;
- import de.devfeuer.skypvp.command.command_home;
- import de.devfeuer.skypvp.command.command_kopf;
- import de.devfeuer.skypvp.command.command_list;
- import de.devfeuer.skypvp.command.command_money;
- import de.devfeuer.skypvp.command.command_mute;
- import de.devfeuer.skypvp.command.command_ping;
- import de.devfeuer.skypvp.command.command_rang;
- import de.devfeuer.skypvp.command.command_setHome;
- import de.devfeuer.skypvp.command.command_setHub;
- import de.devfeuer.skypvp.command.command_setShop;
- import de.devfeuer.skypvp.command.command_setwarp;
- import de.devfeuer.skypvp.command.command_stats;
- import de.devfeuer.skypvp.command.command_tempBan;
- import de.devfeuer.skypvp.command.command_tp;
- import de.devfeuer.skypvp.command.command_ts;
- import de.devfeuer.skypvp.command.command_unBan;
- import de.devfeuer.skypvp.command.command_vote;
- import de.devfeuer.skypvp.command.command_warps;
- import de.devfeuer.skypvp.events.event_FreeSchilder;
- import de.devfeuer.skypvp.events.event_Join;
- import de.devfeuer.skypvp.events.event_Tod;
- import de.devfeuer.skypvp.events.event_chat;
- import de.devfeuer.skypvp.events.event_mute;
- import de.devfeuer.skypvp.events.event_tausch;
- import de.devfeuer.skypvp.events.event_vote;
- import de.devfeuer.skypvp.shop.Shop_NoDamage;
- public class main extends JavaPlugin {
- public static ConsoleCommandSender console = Bukkit.getConsoleSender();
- @Override
- public void onEnable() {
- registerclass();
- console.sendMessage("§a[§3Sky§7-§6PvP§a] §bIst nun §aOnline§b. §3System by §cDasGunter");
- user.GlobalMute = false;
- command_XP.xps = false;
- auto();
- clearlag();
- userrangcfg();
- // Commands
- this.getCommand("spawn").setExecutor(new command_Spawn(this));
- this.getCommand("fix").setExecutor(new command_Repair());
- this.getCommand("TempBan").setExecutor(new command_tempBan());
- this.getCommand("me").setExecutor(new command_ME());
- this.getCommand("money").setExecutor(new command_money());
- this.getCommand("ping").setExecutor(new command_ping());
- this.getCommand("ja").setExecutor(new command_Umfrage(this));
- this.getCommand("nein").setExecutor(new command_Umfrage(this));
- this.getCommand("umfrage").setExecutor(new command_Umfrage(this));
- this.getCommand("tp").setExecutor(new command_tp());
- this.getCommand("kopf").setExecutor(new command_kopf());
- this.getCommand("report").setExecutor(new command_Report());
- this.getCommand("clear").setExecutor(new command_Clear());
- this.getCommand("tp").setExecutor(new command_tp());
- this.getCommand("setShop").setExecutor(new command_setShop());
- this.getCommand("list").setExecutor(new command_list());
- this.getCommand("ts").setExecutor(new command_ts());
- this.getCommand("Team").setExecutor(new command_Team());
- this.getCommand("rl").setExecutor(new command_Reload());
- this.getCommand("reload").setExecutor(new command_Reload());
- this.getCommand("spenden").setExecutor(new command_Spenden());
- this.getCommand("delwarp").setExecutor(new command_delwarp());
- this.getCommand("setwarp").setExecutor(new command_setwarp());
- this.getCommand("warp").setExecutor(new command_Warp(this));
- this.getCommand("warps").setExecutor(new command_warps());
- this.getCommand("stack").setExecutor(new command_Stack());
- this.getCommand("msg").setExecutor(new command_MSG());
- this.getCommand("tell").setExecutor(new command_MSG());
- this.getCommand("gl").setExecutor(new command_GlobalMute());
- this.getCommand("rename").setExecutor(new command_Rename());
- this.getCommand("fly").setExecutor(new command_fly());
- this.getCommand("gamemode").setExecutor(new command_Gamemode());
- this.getCommand("gm").setExecutor(new command_Gamemode());
- this.getCommand("setspawn").setExecutor(new command_SetSpawn());
- this.getCommand("cc").setExecutor(new command_ChatClear());
- this.getCommand("kick").setExecutor(new command_Kick());
- this.getCommand("giveall").setExecutor(new command_GiveAll());
- this.getCommand("clan").setExecutor(new command_Clan());
- this.getCommand("stats").setExecutor(new command_stats());
- this.getCommand("tpall").setExecutor(new command_TpAll());
- this.getCommand("sethome").setExecutor(new command_setHome());
- this.getCommand("test").setExecutor(new command_Test());
- this.getCommand("TC").setExecutor(new command_TeamChat());
- this.getCommand("vote").setExecutor(new command_vote());
- this.getCommand("rang").setExecutor(new command_rang());
- this.getCommand("xp").setExecutor(new command_XP(this));
- this.getCommand("hub").setExecutor(new command_Hub(this));
- this.getCommand("sethub").setExecutor(new command_setHub());
- this.getCommand("ban").setExecutor(new command_ban());
- this.getCommand("unban").setExecutor(new command_unBan());
- this.getCommand("mute").setExecutor(new command_mute());
- this.getCommand("support").setExecutor(new command_Support(this));
- this.getCommand("home").setExecutor(new command_home(this));
- loadBan();
- MySQL.connect();
- MySQL.update("CREATE TABLE IF NOT EXISTS Stats(Spieler VARCHAR(100), Tokens INT, kills INT, tode INT);");
- }
- @Override
- public void onDisable() {
- MySQL.disconnect();
- }
- public static ConsoleCommandSender getConsole() {
- return console;
- }
- private void loadBan(){
- File file = new File("plugins/SkyPvP/ban.yml");
- YamlConfiguration cfg = new YamlConfiguration().loadConfiguration(file);
- if(!file.exists()){
- try {
- cfg.save(file);
- file.createNewFile();
- cfg.set("Ban.list", new ArrayList<>());
- } catch (IOException e) {}
- }
- }
- private void registerclass(){
- Bukkit.getPluginManager().registerEvents(new event_FreeSchilder(), this);
- Bukkit.getPluginManager().registerEvents(new event_Join(), this);
- Bukkit.getPluginManager().registerEvents(new event_Tod(), this);
- Bukkit.getPluginManager().registerEvents(new event_mute(), this);
- Bukkit.getPluginManager().registerEvents(new command_tempBan(), this);
- Bukkit.getPluginManager().registerEvents(new event_chat(this), this);
- Bukkit.getPluginManager().registerEvents(new event_tausch(), this);
- Bukkit.getPluginManager().registerEvents(new command_GlobalMute(), this);
- Bukkit.getPluginManager().registerEvents(new Shop_NoDamage(), this);
- Bukkit.getPluginManager().registerEvents(new event_vote(), this);
- Bukkit.getPluginManager().registerEvents(new command_Support(this), this);
- }
- private void userrangcfg(){
- File f = new File("plugins/SkyPvP/rang.yml");
- YamlConfiguration cfg = new YamlConfiguration().loadConfiguration(f);
- if(!f.exists()){
- try {
- f.createNewFile();
- cfg.save(f);
- } catch (IOException e) {}
- }else{
- cfg = YamlConfiguration.loadConfiguration(f);
- }
- }
- private String msg = user.prefix+"Unser Server ist in der beta.";
- private String msg1 = user.prefix+"Du willst einen Clan ? §3/clan";
- private String msg2 = user.prefix+"Du willst bessere respawn items ? §3/warp kit";
- private String msg3 = user.prefix+"Du willst verzaubern ? /warp verzaubern";
- private String msg4 = user.prefix+"Du hast einen Hacker gefunden ? §3/report <name> <grund>";
- private String msg5 = user.prefix+"Du willst Spenden ? §3/spenden";
- public static int msgnr = 1;
- private void auto(){
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable()
- {
- public void run()
- {
- switch (msgnr)
- {
- case 1:
- Bukkit.broadcastMessage(msg1);
- break;
- case 2:
- Bukkit.broadcastMessage(msg2);
- break;
- case 3:
- Bukkit.broadcastMessage(msg3);
- break;
- case 4:
- Bukkit.broadcastMessage(msg4);
- break;
- case 5:
- Bukkit.broadcastMessage(msg5);
- break;
- default:
- Bukkit.broadcastMessage(msg1);msgnr = 1;
- }
- msgnr += 1;
- }
- }, 300*20, 300*20);
- }
- private void clearlag(){
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable()
- {
- public void run()
- {
- Bukkit.getServer().broadcastMessage(user.prefix+"Die Items auf den Boden wurden Entfernt.");
- Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "/remove items -1");
- Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "remove items -1");
- }
- }, 300*20, 300*20);
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable()
- {
- public void run()
- {
- Bukkit.getServer().broadcastMessage(user.prefix+"Die Items werden in §31§b Minute auf den Boden Entfernt.");
- }
- }, 240*20, 240*20);
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable()
- {
- public void run()
- {
- Bukkit.getServer().broadcastMessage(user.prefix+"§3Du willst eine Clan base oder ein zuhause in einer pvp welt ? mach doch /warp pvp");
- }
- }, 120*20, 120*20);
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable()
- {
- public void run()
- {
- Bukkit.getServer().broadcastMessage(user.prefix+"§3Du willst fly und tolle Items mache /vote und vote für uns.");
- }
- }, 70*20, 70*20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement