Switching text color signs!

Discussion in 'Archived: Plugin Requests' started by fatmanjumprope, Dec 14, 2012.

  1. Offline

    fatmanjumprope

    I was wondering if someone might know of or be willing to code a plugin that allows players with the right permissions to use signs that give them access to color text.

    Say you have a sign. Something like this maybe.

    -----------
    TextColor
    Red
    Cost
    $500
    -----------

    When a player with the permission to use the sign right clicks the sign it will take the $500 from their account and give them red text. If you could also code it to work without costing money that would be cool too! It's pesky to have to type out the &4 before every message and I think this plugin would be a cool little feature to add to a server spawn so players can pick a chat color before leaving spawn
     
  2. Offline

    Vandrake

    You got vault?

    Download Link:
    https://www.dropbox.com/s/iaudhmi1kbpq4vq/REQTxtColor.jar
    Usage:
    1- Place a sign.
    2- 1st line: write [txtcolor]
    3- 2nd line: pick a color of these

    Available colors:
    http://www.minecraftwiki.net/wiki/Classic_server_protocol

    4- 3rd line: Write whatever you want.
    5- 4th line: Write the price. It must be above or equal to zero.
    Any problem/suggestion/modification:
    Reply to this thread or tag me

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
    fatmanjumprope likes this.
  3. Offline

    fatmanjumprope

    Plugin's working great! Only problem I can see is that only people with operator status can use the signs. Is there perhaps a list of permissions?

    A suggestion: Could you make it right click instead of left?
     
  4. Offline

    Rprrr

  5. Offline

    Vandrake

    hmmm yes lol I forgot about the permissions. the only one is txt.place. If you want me to change left to right click it will take me a while for I have to change the event but ok hold on

    fatmanjumprope done.
    use the same link to download

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
    fatmanjumprope likes this.
  6. Offline

    fatmanjumprope

    Dude you're epic!

    Hate to keep bothering you about this since you're doing this all for free but I'm getting some errors in the console.
    Show Spoiler
    16.12 11:53:59 [Server] INFO ... 9 more
    16.12 11:53:59 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:339)
    16.12 11:53:59 [Server] INFO at java.lang.reflect.Method.invoke(Unknown Source)
    16.12 11:53:59 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    16.12 11:53:59 [Server] INFO at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
    16.12 11:53:59 [Server] INFO at me.Vandrake.txt.txt.plchat(txt.java:38)
    16.12 11:53:59 [Server] INFO Caused by: java.lang.NullPointerException
    16.12 11:53:59 [Server] INFO at net.minecraft.server.NetworkReaderThread.run(SourceFile:93)
    16.12 11:53:59 [Server] INFO at net.minecraft.server.NetworkManager.c(NetworkManager.java:344)
    16.12 11:53:59 [Server] INFO at net.minecraft.server.NetworkManager.i(NetworkManager.java:208)
    16.12 11:53:59 [Server] INFO at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:44)
    16.12 11:53:59 [Server] INFO at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:812)
    16.12 11:53:59 [Server] INFO at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:840)
    16.12 11:53:59 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459)
    16.12 11:53:59 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
    16.12 11:53:59 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    16.12 11:53:59 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:341)
    16.12 11:53:59 [Server] INFO org.bukkit.event.EventException
    16.12 11:53:59 [Server] SEVERE Could not pass event AsyncPlayerChatEvent to DTxtColor v1
    16.12 11:52:37 [Server] INFO [PLAYER_COMMAND] rawno1997: /f 2
    16.12 11:52:26 [Server] INFO [PLAYER_COMMAND] rawno1997: /f
    16.12 11:52:17 [Server] INFO hardhittez [Rookie] kennytillit226: I JUST HAD A GREAT IDEA
    16.12 11:52:17 [Server] INFO ... 9 more
    16.12 11:52:17 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:339)
    16.12 11:52:17 [Server] INFO at java.lang.reflect.Method.invoke(Unknown Source)
    16.12 11:52:17 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    16.12 11:52:17 [Server] INFO at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
    16.12 11:52:17 [Server] INFO at me.Vandrake.txt.txt.plchat(txt.java:38)
    16.12 11:52:17 [Server] INFO Caused by: java.lang.NullPointerException
    16.12 11:52:17 [Server] INFO at net.minecraft.server.NetworkReaderThread.run(SourceFile:93)
    16.12 11:52:17 [Server] INFO at net.minecraft.server.NetworkManager.c(NetworkManager.java:344)
    16.12 11:52:17 [Server] INFO at net.minecraft.server.NetworkManager.i(NetworkManager.java:208)
    16.12 11:52:17 [Server] INFO at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:44)
    16.12 11:52:17 [Server] INFO at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:812)
    16.12 11:52:17 [Server] INFO at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:840)
    16.12 11:52:17 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459)
    16.12 11:52:17 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
    16.12 11:52:17 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    16.12 11:52:17 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:341)
    16.12 11:52:17 [Server] INFO org.bukkit.event.EventException
    16.12 11:52:17 [Server] SEVERE Could not pass event AsyncPlayerChatEvent to DTxtColor v1


    That error runs every 10 seconds or so in the console.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  7. Offline

    Vandrake

    fixed.
    Use the same download link. Also, it's ok to report any kind of error lol. We learn from our mistakes :3
     
  8. Offline

    zeustehalmighty

    I have found a couple typos I guess. Dark Purple is just Purple and "Gray" is spelled Grey :p
    EDIT: Also can't seem to put down Indigo.
     
  9. Offline

    Vandrake

    Code:
    if(OriName.equalsIgnoreCase("green")){OriName = "§aGREEN";}
            else if(OriName.equalsIgnoreCase("aqua")){OriName = "§bAQUA";}
            else if(OriName.equalsIgnoreCase("red")){OriName = "§cRED";}
            else if(OriName.equalsIgnoreCase("pink")){OriName = "§dLIGHT PURPLE";}
            else if(OriName.equalsIgnoreCase("yellow")){OriName = "§eYELLOW";}
            else if(OriName.equalsIgnoreCase("white")){OriName = "§fWHITE";}
            else if(OriName.equalsIgnoreCase("black")){OriName = "§0BLACK";}
            else if(OriName.equalsIgnoreCase("dark blue")){OriName = "§1DARK BLUE";}
            else if(OriName.equalsIgnoreCase("dark green")){OriName = "§2DARK GREEN";}
            else if(OriName.equalsIgnoreCase("dark aqua")){OriName = "§3DARK AQUA";}
            else if(OriName.equalsIgnoreCase("dark red")){OriName = "§4DARK RED";}
            else if(OriName.equalsIgnoreCase("dark purple")){OriName = "§5DARK PURPLE";}
            else if(OriName.equalsIgnoreCase("gold")){OriName = "§6GOLD";}
            else if(OriName.equalsIgnoreCase("gray")){OriName = "§7GRAY";}
            else if(OriName.equalsIgnoreCase("dark gray")){OriName = "§8DARK GRAY";}
            else if(OriName.equalsIgnoreCase("dark aqua")){OriName = "§9DARK AQUA";}
            else
            {
                OriName = "§4§lXXXXXXXXXXX";
            }
    this is the code. I may have changed a few things and forgot to tell you but I think you get the gist of it



    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  10. Offline

    zeustehalmighty

    Ok. Well now I have another bug. :p
    When I buy the chat color Light Purple it says
    [Txtcolor] You have bought the color XXXXXXXXXXXXXX for 1.
    then when i talk it says [Group] Player : XXXXXXXXXXXXXXHi Sorry if I'm this is just too much since you are doing this for free :)
     

Share This Page