Solved Im failing at colors xD

Discussion in 'Plugin Development' started by xtext42, Jun 29, 2014.

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

    xtext42

    When the player is sent to spawn it says international server error! But then I tried changing the ChatColor.AQUA to Color.AQUA it worked but said this (Picture Below)
    2014-06-29_17.54.54.png
    Here is the plugins code

    package me.xtext42.Yolo;

    import org.bukkit.Bukkit;
    import org.bukkit.Color;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin{

    public void onEnable() {
    getLogger().info("Plugin Enabled");
    }

    public void onDisable() {
    getLogger().info("Plugin Disabled");
    }

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if(sender instanceof Player) {
    Player player = (Player) sender;
    if(cmd.getName().equalsIgnoreCase("hub")){
    String hub = "spawn " + player.getName();
    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), hub);
    player.sendMessage(ChatColor.AQUA + "You have been teleported to spawn!");

    }
    }

    returnfalse;

    }


    }
     
  2. Offline

    jpjunho

    xtext42
    "returnfalse" should be return false;
     
  3. Offline

    xtext42

    jpjunho Im sorry that paste did not go well here is a picture of the code Screen Shot 2014-06-29 at 6.04.19 PM.png

    some reason it deleted the space when I pasted it
     
  4. Offline

    bdubz4552

    xtext42 You never imported ChatColor. Problem solved.
    Also, don't use org.bukkit.Color... Heck, I don't even know if that's applicable to anything.
     
  5. Offline

    xtext42

    bdubz4552 Yea... I can't import it I don't see the option

    Im using the bukkit 1.7.9 if that helps :p
     
  6. Offline

    bdubz4552

  7. Offline

    teej107

    xtext42 Type it by hand.

    EDIT: Ninja'd xD
     
  8. Offline

    xtext42

  9. Offline

    teej107

    xtext42
     
  10. Offline

    xtext42

    teej107 I did type it by hand :(

    When I am in game and type /hub it say international server error
     
  11. Offline

    Stealth2800

    xtext42 If I recall correctly, Ctrl-shift-O (Cmd-shift-O for Mac?) organizes your imports in Eclipse. Try using that.
     
  12. Offline

    teej107

  13. Offline

    xtext42

    Stealth2800 ok I use a mac and I did it. Imma try running the plugin again

    Stealth2800 International server error.....

    teej107 Stealth2800 the only bukkit thing says change ChatColor to Color org.bukkit

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  14. Offline

    bdubz4552

    xtext42 You are using Bukkit, not CraftBukkit, right?
     
  15. Offline

    teej107

    xtext42
    - import this: org.bukkit.ChatColor
    - Learn Java
     
  16. Offline

    xtext42

    ....... I have no idea

    teej107 I have been trying I hover my mouse of the line of code and it doesn't say import from bukkit or anything

    teej107 Its says stuff like change or create and the only thing from org.bukkit is change to Color instead of ChatColor

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  17. Offline

    teej107

    xtext42 *facepalm* First things first, learn Java, then put the latest version of bukkit in your build, then.......
    and
     
  18. Offline

    xtext42

    teej107 See Screen Shot 2014-06-29 at 6.27.09 PM.png

    Got to go for a minute but see the option is not there!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  19. Offline

    teej107

    xtext42
     
  20. Offline

    bdubz4552

    xtext42 We have so little information right now that we can't tell you anything other than the painfully obvious.
    1. Get rid of org.bukkit.Color. You (probably) won't ever need this.
    2. Import org.bukkit.ChatColor. If you can't get Eclipse to do it for you, do it yourself by typing it in.
    3. If importing doesn't work, make sure you are using Bukkit, NOT CraftBukkit.
    4. If this doesn't work, well, GG.
     
    AoH_Ruthless likes this.
  21. Offline

    teej107

    4. If this doesn't work, well, GG. Learn Java so you would know what is wrong.
    We have told you what is wrong, and you aren't fixing it.
    5. Don't depend 100% on your IDE. You are smarter than the IDE (I hope)
     
    AoH_Ruthless likes this.
  22. Offline

    monster860

    I just realllyyy cannot help but notice and mention this: It's not INTERNATIONAL server error. That would be if the server in every country had an error or something. I don't know. It's INTERNAL server error.
     
    AoH_Ruthless likes this.
  23. Offline

    xtext42

    bdubz4552 CraftBukkit xD

    bdubz4552 Do you know the link to get normal Bukkit

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  24. Offline

    bdubz4552

  25. Offline

    AoH_Ruthless

    bdubz4552
    ChatColor should function on CB, but yes, CB should be avoided wherever possible. However, the Color enum is actually very useful, more so than the ChatColor imo. With ChatColor, you can mostly only change colors of text, and that isn't "useful" per-se. While that criteria also means Color itself isn't very useful, it can be used for things like:

    Wool, Fireworks, Horse coloration, other edits to other animals (like Wolf collars!), and other applications yet that I cannot think of at the top of my head.

    xtext42
    This link would help you better: http://lmgtfy.com/?q=Where+can+I+learn+Java
     
  26. Offline

    xtext42

Thread Status:
Not open for further replies.

Share This Page