Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Fr3akzCode;
- import Commands.ChatClear;
- import Commands.Entsperre;
- import Commands.GiveAll;
- import Commands.Kick;
- import Commands.List;
- import Commands.Skype;
- import Commands.Sperre;
- import Commands.TS;
- import Commands.XpallsetClass;
- import java.io.PrintStream;
- import org.bukkit.GameMode;
- import org.bukkit.Server;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.command.PluginCommand;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.entity.Player;
- import org.bukkit.event.Listener;
- import org.bukkit.plugin.PluginManager;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main
- extends JavaPlugin
- implements Listener, CommandExecutor
- {
- public static Main plugin;
- public static String KeineRechte = "§cDu hast keine Rechte für diesen Befehl";
- public static String Tag = "§8[§bSkyCloud§8] ";
- public YamlConfiguration config;
- public String seperator = " ";
- public void onEnable()
- {
- registerCommands();
- registerEvents();
- System.out.println("=======================================================");
- System.out.println("| |");
- System.out.println("| SkyCloud (C)2014 by Fr3akzCode |");
- System.out.println("| |");
- System.out.println("| This program is not free software! |");
- System.out.println("| You are not allowed to use, modify or spread |");
- System.out.println("| it without the agreement of the copyright holder. |");
- System.out.println("| |");
- System.out.println("| |");
- System.out.println("| |");
- System.out.println("=======================================================");
- }
- public void registerCommands()
- {
- getCommand("chatclear").setExecutor(new ChatClear(this));
- getCommand("kick").setExecutor(new Kick());
- getCommand("giveall").setExecutor(new GiveAll());
- getCommand("sperre").setExecutor(new Sperre());
- getCommand("entsperre").setExecutor(new Entsperre());
- getCommand("List").setExecutor(new List());
- getCommand("ts").setExecutor(new TS());
- getCommand("skype").setExecutor(new Skype());
- getCommand("Xpallset").setExecutor(new XpallsetClass());
- }
- public void registerEvents()
- {
- getServer().getPluginManager().registerEvents(new TabDeco(), this);
- getServer().getPluginManager().registerEvents(this, this);
- }
- public String replaceColor(String string)
- {
- return string.replaceAll("(?i)&([a-f0-9])", "§$1");
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
- {
- if (cmd.getName().equalsIgnoreCase("gm"))
- {
- if (!(sender instanceof Player))
- {
- System.out.println("Dieser Befehl ist nur fuer Spieler!");
- return true;
- }
- Player player = (Player)sender;
- if (player.hasPermission("mc.gm"))
- {
- if (args.length > 0) {
- return false;
- }
- if (args.length == 0)
- {
- if (player.getGameMode() == GameMode.SURVIVAL)
- {
- player.setGameMode(GameMode.CREATIVE);
- sender.sendMessage("§8[§bSkyCloud§8] §cDu hast dein GameMode auf Creative gesetzt!");
- return true;
- }
- if (player.getGameMode() == GameMode.CREATIVE)
- {
- player.setGameMode(GameMode.SURVIVAL);
- sender.sendMessage("§8[§bSkyCloud§8] §cDu hast dein GameMode auf Survival gesetzt!");
- return true;
- }
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement