1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Simple color show command

Discussion in 'Suggestions' started by MrTokay, Aug 29, 2016.

  1. MrTokay

    MrTokay Member

    Joined:
    Jul 4, 2016
    Messages:
    589
    Likes Received:
    419
    Trophy Points:
    63
    Gender:
    Male
    Occupation:
    Really tired
    Location:
    Jon's house
    Home Page:
    So I wanted to suggest the possibility of adding a simple "/c" command to see the colors you can use a s Donator.
    It would look something like:
    Player: /c
    Console: a b c d e f 1 2 3 4 5 6 7 8 9 0 l k (uh...) o n m

    I thought this would be a pretty perfect Jr. Dev job: quick, easy, and useful.

    @DanOF , @Mintcraftian

    Just to help I tried to write the code for this: (not sure if its right because I haven't done Java in a looooonnngg time)
    Code:
       }
            @Override
            public boolean onCommand (CommandSender sender, Command cmd, CommandLabel, String[] args)
        {
            if (commandLabel.equalsIgnorecase("Colors"))
                toggleColors (sender);
        
            return true;
        }
        private void toggle= Colors (CommandSender sender)
        {
            if ( !enabled((Player)sender) )
            {
                RankedUsers.add((Player) sender);
                ((Player) sender).sendMessage(ChatColor.BLUE + "a + ChatColor.GREEN + 2"   //etc.//);
            
            }
            else
            {
               RankedUsers.remove(Player) sender);
               (Player) sender).sendMessage (ChatColor.RED + "Only + ChatColor.GREY Iron + ChatColor.RESET + and above can use this");
            
            }
            public boolean enabled (Player player)
            {
                 return ColorsUsers.contains(player);
            }
        
        }
        
    Let me know what you think!



     
    Last edited: Aug 30, 2016
    nEuro and hgbf like this.
  2. Steyro

    Steyro Member

    Joined:
    Mar 23, 2016
    Messages:
    1,683
    Likes Received:
    632
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Belgium
  3. Buuuddy

    Buuuddy Member

    Joined:
    Mar 31, 2016
    Messages:
    1,116
    Likes Received:
    1,427
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Belgium
    If you do "/colour f", for example, it says something like "You can only use 1 2 3 4 ...". It would be nice if the letters and nimbers would have the colour they represent.

    I'm sorry for my crappy reply... I'm on my iPad so typing is hard :#
     
  4. xTeleMegax

    xTeleMegax Member

    Joined:
    Jul 28, 2015
    Messages:
    2,454
    Likes Received:
    1,064
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Bansilvania
    Home Page:
    That's a pretty nice and handy suggestion :) +
     
  5. Donald Trump

    Donald Trump Member

    Joined:
    Nov 11, 2015
    Messages:
    3,544
    Likes Received:
    1,503
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    Idek.
    Location:
    Trump Tower
    Nice idea! Now I don't have to refer to the thread :p
     
  6. MagnificentSpam

    MagnificentSpam Member

    Joined:
    Mar 16, 2016
    Messages:
    724
    Likes Received:
    295
    Trophy Points:
    63
    Gender:
    Male
    Might be useful sometimes, I have tabbed out of the game just to find some color code before.
    But your code seems a bit strange to me, what does the ColorUsers list do?
    Wouldn't that allow any user (not just ranks) to use the command, but only every second try?
    Because I have a lot of work to avoid, I made this:
    Code:
        private static String CHAT_COLOURS;
        static {
            CHAT_COLOURS_STRING = "";
            for (ChatColor colour: ChatColor.values()) {
                switch (colour) {
                    case RESET:
                        break;
                    case MAGIC:
                        CHAT_COLOURS_STRING = CHAT_COLOURS_STRING + colour + colour.getChar() + ChatColor.RESET + "(k) ";
                        break;
                    default:
                        CHAT_COLOURS_STRING = CHAT_COLOURS_STRING + colour + colour.getChar() + ChatColor.RESET + " ";
                }
            }
        }
    
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if (cmd.getName().equalsIgnoreCase("c")) {
                if (sender instanceof Player && !getRank((Player) sender).equals("Stone")) {
                    sender.sendMessage(CHAT_COLOURS);
                } else {
                    sender.sendMessage("Rank only feature ¯\\(ツ)/¯");
                }
                return true;
            }
            return false;
        }
    
        private static String getRank(Player player) {
            return "Diamond";
        }
     
    Last edited: Aug 31, 2016
    FalseHonesty likes this.
  7. CattyCat

    CattyCat Member

    Joined:
    Jan 6, 2016
    Messages:
    1,315
    Likes Received:
    171
    Trophy Points:
    63
    Gender:
    Male
    Occupation:
    Programmer, Mathematician
    Location:
    Canada FTW
    Home Page:
    Would be very helpful!
     
  8. Orangeric88

    Orangeric88 Mod Staff Member Moderator

    Joined:
    Apr 22, 2016
    Messages:
    3,075
    Likes Received:
    792
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    -=-+EggWars+ -=-
    Location:
    Planet Orange
    Home Page:
    I like this idea since everytime I want to change a color I have to open up this thread and see what the colors are. But to this point, I think I memorized all of the number codes (eg. &1 Is blue \ &2 is green \ eg..) I'm still working on memorizing codes like &b (If you were wondering that's light blue.)
     
  9. MrTokay

    MrTokay Member

    Joined:
    Jul 4, 2016
    Messages:
    589
    Likes Received:
    419
    Trophy Points:
    63
    Gender:
    Male
    Occupation:
    Really tired
    Location:
    Jon's house
    Home Page:
    So I totally thought of the rank thing, just I figured, why can't everybody see this list?
    There's no reason only ranks can see it.
     
  10. Orangeric88

    Orangeric88 Mod Staff Member Moderator

    Joined:
    Apr 22, 2016
    Messages:
    3,075
    Likes Received:
    792
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    -=-+EggWars+ -=-
    Location:
    Planet Orange
    Home Page:
    For people without a rank, the color code think wont be much of a use. Considering they don't have access to colored chat or colored names that info would be useless to them. Sort of like you buy someone a $1000 computer but have no wifi :D
     
  11. De Supermarkt

    De Supermarkt Member

    Joined:
    Oct 3, 2015
    Messages:
    756
    Likes Received:
    1,202
    Trophy Points:
    93
    Gender:
    Male
    Occupation:
    Still lazy
    Location:
    Westervoort
    Nice & helpfull idea, hope this will be added :)
     
  12. xExcite_

    xExcite_ Member

    Joined:
    Jan 22, 2016
    Messages:
    96
    Likes Received:
    14
    Trophy Points:
    8
    Gender:
    Male
    Yeah, that is very handy. I always forget the colors! :)
     
  13. A Christmas Hangar

    A Christmas Hangar Member

    Joined:
    Sep 15, 2015
    Messages:
    2,535
    Likes Received:
    1,480
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Kepler452B
    Home Page:
    Nice idea!

    I improved a little bit the code, but it was really fast and I didn't even added spaces (and didn't translated to color nodes :/)

    Result = http://gph.is/2cbzMJq


    Code:
    package eu.hangar;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.ChatColor;
    
    public class Colors extends JavaPlugin {
       
        public boolean onCommand (CommandSender sender, Command command, String commandLabel, String[] args){
           Player p = (Player) sender;
           if(commandLabel.equalsIgnoreCase("colors")){
            if(p.hasPermission("cubecraft.color")){
                p.sendMessage(ChatColor.GREEN + "a" + ChatColor.BLUE + "b" + ChatColor.RED +"c" + "etc");
            }else{
                p.sendMessage("You need to be" + ChatColor.GRAY + "Iron" +  ChatColor.RESET + "to use colors");
            }
           }
        return true;
           
           
        }
    }
        
     
    Last edited: Aug 30, 2016
  14. MrTokay

    MrTokay Member

    Joined:
    Jul 4, 2016
    Messages:
    589
    Likes Received:
    419
    Trophy Points:
    63
    Gender:
    Male
    Occupation:
    Really tired
    Location:
    Jon's house
    Home Page:
    Edited the code.
    Thanks for all the support!
     
  15. SenpaiCygni

    SenpaiCygni Member

    Joined:
    Jul 24, 2015
    Messages:
    880
    Likes Received:
    712
    Trophy Points:
    93
    Gender:
    Male
    Occupation:
    Starting a Nano Reef.
    Location:
    a place where everything you touch turns to gold.
    You could play offline games with a $1000 PC :)
     
  16. MrTokay

    MrTokay Member

    Joined:
    Jul 4, 2016
    Messages:
    589
    Likes Received:
    419
    Trophy Points:
    63
    Gender:
    Male
    Occupation:
    Really tired
    Location:
    Jon's house
    Home Page:
    Thats not a good example.
    Its more like saying "I'm giving out $1000 PC's, but if you don't have WiFi i'm not giving it to you, because you can't use it". The people with no WiFi will probably want it anyway
     
    MagnificentSpam likes this.
  17. Orangeric88

    Orangeric88 Mod Staff Member Moderator

    Joined:
    Apr 22, 2016
    Messages:
    3,075
    Likes Received:
    792
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    -=-+EggWars+ -=-
    Location:
    Planet Orange
    Home Page:
    True, but think more about it. A brand new computer with nothing on it. Won't it be useless to you? You can't watch videos, you can't download games, can't play minecraft, can't be on this forums talking you you right now :eek:(You need wifi) I mean the only thing you can do is watch and stare at the background. Or maybe play some games Microsoft gives you from the very beggining of the computer. But again after a while you'll be board of the games.

    For the people that's wants it, a $1000 computer for free of course they will accept it. It's just a matter of will they use it everyday like a phone?

    I'm relating this to the stones since even if they give they gave permissions to the stone to see the color codes, it won't be much of a use to them. (Since again they don't have access to colored chat and colored names. ;))

    EDIT: Very true, but the fact thing is the computer only has certain types of game that you can play without the internet. If your talking about offline games like "Temple Run" it won't work. You will need wifi to download the game I. The first place.
     
  18. MrTokay

    MrTokay Member

    Joined:
    Jul 4, 2016
    Messages:
    589
    Likes Received:
    419
    Trophy Points:
    63
    Gender:
    Male
    Occupation:
    Really tired
    Location:
    Jon's house
    Home Page:
    You're not listening to what I'm saying.
    Nobody would refuse a $1000 PC/color commands unless they were losing something.
    Since they're not over here, I don't see a reason not to give it to them,
     
  19. xTurtleOfficialㅤ

    xTurtleOfficialㅤ Member

    Joined:
    Dec 1, 2015
    Messages:
    5,291
    Likes Received:
    372
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    idk
    Location:
    Earth
    Useful. +1
    I always google it .-.
     
  20. A Christmas Hangar

    A Christmas Hangar Member

    Joined:
    Sep 15, 2015
    Messages:
    2,535
    Likes Received:
    1,480
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Kepler452B
    Home Page:
    :)

    ^^^^
    mhhm