Development Assistance CONSOLE ERRORS!?! (Scroll All The Way Down)

Discussion in 'Plugin Help/Development/Requests' started by SergeantBud, Feb 6, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    SergeantBud

    READ BELOW! MORE RECENT CODE FROM MY PLUGIN IS BELOW! EDITING SO IT CAN NOT BE STOLEN!
     
    Last edited: Feb 8, 2015
  2. Offline

    Skionz

    @SergeantBud Your logic is wrong. Your checking if it exists then copying the defaults and saving it. Its also pointless to have the YAML file in your jar unless your reading it as a stream and writing it to the disk, or invoking JavaPlugin#saveDefaultConfig() which basically does that.
     
  3. Offline

    SergeantBud

    And I fix this how....? I've been googling, and looking at github, and youtube tuts, and other websites, and resources here, for about 45 minutes and can't find anything. Much helpful reply.
     
  4. Offline

    Minesuchtiiii

    Try something like...

    Code:
    File file = new File("plugins/[YourPlugins]", "config.yml");
    YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
    
    
    public void onEnable() {
    
    if(!(file.exists)) {
    
    try {
    
    file.createNewFile();
    addStuff();
    loadConfig();
    
    } catch(NullPointerException e) {
    e.printStackTrace();
    }
    
    }
    } else {
    addStuff();
    loadConfig();
    }
    
    
    public void loadConfig() {
    
    cfg.options().copyDefaults(true);
    this.saveConfig();
    
    }
    
    
    public void addStuff() {
    
    cfg.addDefault("Path.1", "Value.1");
    cfg.addDefault("Path.2", "Value.2");
    this.saveConfig();
    
    }
    Something like this maybe could work, I'm not sure just a lil hint for u
    There may be some errors, I did not write it in eclipse..
     
  5. @Minesuchtiiii Not even that, just the line saveDefaultConfig(); will do great.
     
  6. Offline

    SergeantBud

    Hey Guys! TY For The Help! I Did A Lot Of Googling, But 1 Issue.
    Code:
    READ BELOW! MORE RECENT CODE FROM MY PLUGIN IS BELOW! EDITING SO IT CAN NOT BE STOLEN!
    -*-
    The bug:
    When you type /cc or /cca;
    it says "An internal error occurred while attempting to perform this command"
     
    Last edited: Feb 8, 2015
  7. Offline

    Lolmewn

    And what's the exception in your console?
     
  8. Offline

    SergeantBud

  9. Offline

    TGRHavoc

    @SergeantBud
    And this, kids, is why you should follow the Java Naming Conventions.

    You've named your string "ClearChat" which, is the name of your Class. So, when you do ClearChat.replaceAll (BTW it should just be replace( originalString, replacementString) ) Java thinks you're referring to the class and not the string.

    Code I'm referring to:
     
  10. Offline

    SergeantBud

    .... Ty I feel stupid xD | How do I initialize the variable? It says when I hover over "ClearChat"
    Code:
    READ BELOW! MORE RECENT CODE FROM MY PLUGIN IS BELOW! EDITING SO IT CAN NOT BE STOLEN!
    That "The local variable ClearChat may not have been initialized" And there are 0 quick fixes! Help?
     
    Last edited: Feb 8, 2015
  11. Offline

    SuperOriginal

    @SergeantBud Read the naming conventions link in my signature.
     
  12. Offline

    SergeantBud

    ....So
    Code:
     READ BELOW! MORE RECENT CODE FROM MY PLUGIN IS BELOW! EDITING SO IT CAN NOT BE STOLEN!
     
    Last edited: Feb 8, 2015
  13. Offline

    TGRHavoc

    Nope. The thing is Java is case sensitive, so "ClearChat" the class is seen to be the exact same as "ClearChat" the string.
    Rename "ClearChat" the string to something like "clearChatString".

    Edit: Please learn Java before trying to code using the Bukkit API, it'll help out a lot!
     
  14. Offline

    SuperOriginal

    @SergeantBud Did you even read it? Where does it say to make the string null?? The point is to fix your variable naming conventions
     
  15. :(
    Code:java
    1. final File f = new File(getDataFolder(), "config.yml");
    2. if (!f.exists()) {
    3. getConfig().options().header("Hi! Please Bare With Me As I Add More Support! ");
    4. this.getConfig().addDefault("ClearChatAnonymous", "[ClearChat] Message Here");
    5. this.getConfig().addDefault("ClearChat", "[ClearChat] Message Here");
    6. String ClearChatAnonymous = getConfig().getString("ClearChatAnonymous");
    7. ClearChatAnonymous = ClearChatAnonymous.replaceAll("&", "§");
    8. saveDefaultConfig();
    9. }


    :)
    Code:java
    1. saveDefaultConfig();


    You only need that one line, as I said before. Just have your plugin.yml in your jar and you are sorted.
     
  16. Offline

    SergeantBud

    ..... :)?
    Code:
    READ BELOW! MORE RECENT CODE FROM MY PLUGIN IS BELOW! EDITING SO IT CAN NOT BE STOLEN!
    
    And I'll move the plugin.yml around now >^<
    ----
    WOW TY Works Great! But, How do I stop /cc from showing when typed, and how do I set out the config so it can be like:
    Code:
     READ BELOW! MORE RECENT CODE FROM MY PLUGIN IS BELOW! EDITING SO IT CAN NOT BE STOLEN! 
    .............
    And COnsole Error:
    Code:
    07.02 19:01:23 [Multicraft] Updating config config.yml: True, Config file updated.
    07.02 19:01:13 [Server] INFO at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:684) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_05]
    07.02 19:01:13 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_05]
    07.02 19:01:13 [Server] INFO at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:918) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1083) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:643) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at me.SergeantBud.ClearChatTest.onCommand(ClearChatTest.java:71) [ClearChat.jar:?]
    07.02 19:01:13 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:157) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:183) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:180) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:169) ~[craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:226) ~[craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    07.02 19:01:13 [Server] INFO ^
    07.02 19:01:13 [Server] INFO ClearChatAnonymous: &5[EagleCraft]&6 Chat Has Been Cle ...
    07.02 19:01:13 [Server] INFO in 'string', line 2, column 23:
    07.02 19:01:13 [Server] INFO expected alphabetic or numeric character, but found [(91)
    07.02 19:01:13 [Server] INFO ^
    07.02 19:01:13 [Server] INFO ClearChatAnonymous: &5[EagleCraft]&6 Chat Has Been C ...
    07.02 19:01:13 [Server] INFO in 'string', line 2, column 21:
    07.02 19:01:13 [Server] INFO org.bukkit.configuration.InvalidConfigurationException: while scanning an anchor
    07.02 19:01:13 [Server] ERROR Cannot load plugins/ClearChatTest/config.yml
    07.02 19:01:13 [Multicraft] Skipped 69 lines due to rate limit (30/s)
    07.02 19:01:11 [Server] ERROR Error occurred while enabling ClearChatTest v1.0 (Is it up to date?)
    07.02 19:01:11 [Server] INFO Enabling ClearChatTest v1.0
    
    
     
    Last edited: Feb 8, 2015
  17. Offline

    RenditionsRule

    To be honest, strings in a configuration file need to be encased in '' to be recognised. (I think...)
     
  18. Offline

    SergeantBud

    Right ok; I need to fix THIS error:
    Code:
     
    07.02 19:01:13 [Server] INFO ^07.02 19:01:13 [Server] INFO ClearChatAnonymous: &5[EagleCraft]&6 Chat Has Been Cle ...
    07.02 19:01:13 [Server] INFO in 'string', line 2, column 
    23:07.02 19:01:13 [Server] INFO expected alphabetic or numeric character, but found [(91)
    07.02 19:01:13 [Server] INFO ^
    
    [​IMG]
    Any idea's?
     
  19. Offline

    timtower Administrator Administrator Moderator

    @SergeantBud Try to put the string between single quotes
     
  20. Offline

    SergeantBud

    Wow TY! 90% Working.... except a lot of console errors ;n;!
    ./cca: Working!
    ./cc: Working!
    ./ccr: Working!
    Console Errors: (Gotta lov' them | Don't know if it's all my plugin though!)
    Code:
    08.02 09:47:43 [Server] INFO Chat Has Been Cleared!
    08.02 09:47:42 [Server] INFO Chat Has Been Cleared By SergeantBud!
    08.02 09:47:42 [Multicraft] Skipped 19 lines due to rate limit (30/s)
    08.02 09:47:41 [Server] INFO Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning an anchor; expected alphabetic or numeric character, but found [(91);  in 'string', line 5, column 21:
    08.02 09:47:41 [Server] INFO at java.lang.Thread.run(Unknown Source) [?:1.8.0_05]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:528) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:625) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:684) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_05]
    08.02 09:47:41 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_05]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:918) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1083) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:643) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at me.SergeantBud.ClearChatTest.onCommand(ClearChatTest.java:82) [ClearChat.jar:?]
    08.02 09:47:41 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:209) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:41 [Server] INFO ^
    08.02 09:47:41 [Server] INFO ClearChatMessage: &6[ClearChat] &eChat Has Been Clea ...
    08.02 09:47:41 [Server] INFO in 'string', line 5, column 21:
    08.02 09:47:41 [Server] INFO expected alphabetic or numeric character, but found [(91)
    08.02 09:47:41 [Server] INFO ^
    08.02 09:47:41 [Server] INFO ClearChatMessage: &6[ClearChat] &eChat Has Been Cl ...
    08.02 09:47:41 [Server] INFO in 'string', line 5, column 19:
    08.02 09:47:41 [Server] INFO org.bukkit.configuration.InvalidConfigurationException: while scanning an anchor
    08.02 09:47:41 [Server] ERROR Cannot load configuration from jar
    08.02 09:47:41 [Multicraft] Skipped 94 lines due to rate limit (30/s)
    08.02 09:47:26 [Server] INFO at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:684) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_05]
    08.02 09:47:26 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_05]
    08.02 09:47:26 [Server] INFO at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:918) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1083) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:643) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at me.SergeantBud.ClearChatTest.onCommand(ClearChatTest.java:60) [ClearChat.jar:?]
    08.02 09:47:26 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:157) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:183) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:180) [craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:169) ~[craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:226) ~[craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[craftbukkit_beta.jar:git-Spigot-"ddfe270"]
    08.02 09:47:26 [Server] INFO ^
    08.02 09:47:26 [Server] INFO ClearChatMessage: &6[ClearChat] &eChat Has Been Clea ...
    08.02 09:47:26 [Server] INFO in 'string', line 5, column 21:
    08.02 09:47:26 [Server] INFO expected alphabetic or numeric character, but found [(91)
    08.02 09:47:26 [Server] INFO ^
    08.02 09:47:26 [Server] INFO ClearChatMessage: &6[ClearChat] &eChat Has Been Cl ...
    08.02 09:47:26 [Server] INFO in 'string', line 5, column 19:
    08.02 09:47:26 [Server] INFO org.bukkit.configuration.InvalidConfigurationException: while scanning an anchor
    08.02 09:47:26 [Server] ERROR Cannot load plugins/ClearChatTest/config.yml
    
    config.yml:
    Code:
    # Please Only Use The Following Characters (You can also use this letters in lowercase or in caps)
    # A B C D E F G H I J K L M N O P Q R S T U V W X Y Z &a &b &c &d &e &f &1 &2 &3 &4 &5 &6 &7 &8 &9
    # %p - Player Name (Only Works On ClearChatMessage)
    # DO NOT TYPE /CC IN CONSOLE!!!!!!!!!!
    
    ClearChatMessage: '&6[ClearChat] &eChat Has Been Cleared By %p!'
    ClearChatAnonymous: '&5[EagleCraft] &6Chat Has Been Cleared!'
    
    plugin.yml:
    Code:
    name: ClearChatTest
    version: 1.0
    main: me.SergeantBud.ClearChatTest
    description: A Simple ClearChat Plugin
    
    commands:
        cc:
            usage: /<command>
            description: Clear Chat!
        cca:
            usage: /<command>
            description: Clear Chat Anonymously!
        ccr:
            usage: /<command>
            description: Reload The config file!
    permissions:
        ClearChat.Use:
            description: Clear Chat
            default: op
        ClearChat.Anonymous:
            description: Clear Chat Anonymously
            default: op
        ClearChat.Reload:
            description: Reload The ClearChat Config File!
            default: op
    
    Actual Code:
    Code:
    package me.SergeantBud;
    
    import java.io.File;
    
    
    
    
    
    
    
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.configuration.file.FileConfiguration;
    import org.bukkit.event.Listener;
    import org.bukkit.permissions.Permission;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class ClearChatTest extends JavaPlugin implements Listener {
     
        FileConfiguration config;
        File cfile;
        @Override
        public void onEnable() {
            final File f = new File(getDataFolder(), "config.yml");
            if (!f.exists()) {
                this.getLogger().info("[ClearChat] Generating config.yml....");
                this.saveDefaultConfig();
            }
            if (f.exists()) {
                this.saveDefaultConfig();
                  saveDefaultConfig();
            }
             
            }
     
    
    
        public Permission playerPermission = new Permission("ClearChat.Use");
        public Permission playerPermission1 = new Permission("ClearChat.Anonymous");
        public Permission playerPermission2 = new Permission("ClearChat.Reload");
     
        @Override
        public void onDisable() {
     
        }
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
         
            if (cmd.getName().equalsIgnoreCase("cc")) {
                if (!sender.hasPermission("ClearChat.Use")) {
                    sender.sendMessage(ChatColor.GREEN + "[ClearChat]" + ChatColor.YELLOW + " You Have Been Denied Access To This Command! " + ChatColor.BLUE + " Plugin By SergeantBud!" );
                }
                if (sender.hasPermission("ClearChat.Use")) {
                    for(int i = 0; i < 150; i++){
                    Bukkit.broadcastMessage("");
                    }
                    Bukkit.broadcastMessage(this.getConfig().getString("ClearChatMessage").replaceAll("%p", sender.getName()).replaceAll("&a", ChatColor.GREEN + "").replaceAll("&b", ChatColor.AQUA + "").replaceAll("&c", ChatColor.RED + "").replaceAll("&d", ChatColor.LIGHT_PURPLE + "").replaceAll("&e", ChatColor.YELLOW + "").replaceAll("&f", ChatColor.WHITE + "").replaceAll("&1", ChatColor.DARK_BLUE + "").replaceAll("&2", ChatColor.DARK_GREEN + "").replaceAll("&3", ChatColor.DARK_AQUA  + "").replaceAll("&4", ChatColor.DARK_RED + "").replaceAll("&5", ChatColor.DARK_PURPLE + "").replaceAll("&6", ChatColor.GOLD + "").replaceAll("&7", ChatColor.GRAY + "").replaceAll("&8", ChatColor.DARK_GRAY + "").replaceAll("&9", ChatColor.BLUE + ""));
                }
         
            }
            if (cmd.getName().equalsIgnoreCase("cca")) {
                if (!sender.hasPermission("ClearChat.Anonymous")) {
                    sender.sendMessage(ChatColor.GREEN + "[ClearChat]" + ChatColor.YELLOW + " You Have Been Denied Access To This Command! " + ChatColor.BLUE + " Plugin By SergeantBud!" );
                }
                if (sender.hasPermission("ClearChat.Anonymous")) {
                    for(int i = 0; i < 150; i++){
                    Bukkit.broadcastMessage("");
                    }
                    Bukkit.broadcastMessage(this.getConfig().getString("ClearChatAnonymous").replaceAll("&a", ChatColor.GREEN + "").replaceAll("&b", ChatColor.AQUA + "").replaceAll("&c", ChatColor.RED + "").replaceAll("&d", ChatColor.LIGHT_PURPLE + "").replaceAll("&e", ChatColor.YELLOW + "").replaceAll("&f", ChatColor.WHITE + "").replaceAll("&1", ChatColor.DARK_BLUE + "").replaceAll("&2", ChatColor.DARK_GREEN + "").replaceAll("&3", ChatColor.DARK_AQUA  + "").replaceAll("&4", ChatColor.DARK_RED + "").replaceAll("&5", ChatColor.DARK_PURPLE + "").replaceAll("&6", ChatColor.GOLD + "").replaceAll("&7", ChatColor.GRAY + "").replaceAll("&8", ChatColor.DARK_GRAY + "").replaceAll("&9", ChatColor.BLUE + ""));
                }
         
            }
            if (cmd.getName().equalsIgnoreCase("ccr")) {
                if (!sender.hasPermission("ClearChat.Reload")) {
                    sender.sendMessage(ChatColor.GREEN + "[ClearChat]" + ChatColor.YELLOW + " You Have Been Denied Access To This Command! " + ChatColor.BLUE + " Plugin By SergeantBud!" );
                }
                if (sender.hasPermission("ClearChat.Reload")) {
                    sender.sendMessage(ChatColor.GREEN + "[ClearChat]" + ChatColor.YELLOW + " You Have Reloaded The Config File!");
                    this.reloadConfig();
                }
         
            }
            if (cmd.getName().equalsIgnoreCase("Sgt")) {
                    sender.sendMessage(ChatColor.GOLD + "A SergeantBud Plugin");
                }
       
         
            return false;
            }
         
        }
    
    
    How do I get rid of them lovable console errors? <3
     
    Last edited: Feb 8, 2015
  21. Offline

    timtower Administrator Administrator Moderator

    Moved to Bukkit alternatives.
     
  22. Offline

    SergeantBud

    --*--
    BOOST
    --*--
     
Thread Status:
Not open for further replies.

Share This Page