Filled ItemChat (Link Items In Chat)

Discussion in 'Plugin Requests' started by Dark_Serpent, Dec 22, 2015.

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

    Dark_Serpent

    Plugin category: Role Playing

    Suggested name: ItemChat

    What I want: I want to make it so when a player types in @ITEM in chat, it will be replaced with the name of the item surrounded by white brackets. When hovering over the item with your mouse, the item name, enchantments, lore, and damage (if applicable) will be shown. This will be included in the player's message, so they may say other things.

    i.e. "Hey, check out my item! @ITEM"

    This will make trading using a "trade chat" easier, and also allow players to brag about their items without people refusing to believe them or having a gremlin run off with their items.

    I've seen a few plugins floating around and I've tested all of them, but they do not work properly with a 1.7.10 build.

    Ideas for commands: None needed

    When I'd like it by: Before Christmas, if possible. Loads of thanks for whoever takes up this project!

    Additional Information: It must be able to work properly in Minecraft Version 1.7.10.
     
    Last edited: Dec 22, 2015
  2. Offline

    pie_flavor

    @Dark_Serpent Hello again! I will make this.
    Can you tell me your exact version of Bukkit? It is important.
     
  3. Offline

    Dark_Serpent

    Hello again! I'm running 1.7.9-R0.2 currently.
     
  4. Offline

    WolfMage1

    because you're going to use packets?

    here:

    Code:
            public Class<?> getNMSClass(String name) {
                    // org.bukkit.craftbukkit.v1_8_R3...
                    String version = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
                    try {
                            return Class.forName("net.minecraft.server." + version + "." + name);
                    }
                   
                    catch (ClassNotFoundException e) {
                            e.printStackTrace();
                            return null;
                    }
            }
    
     
  5. Offline

    pie_flavor

    @Dark_Serpent Another question: Do you use any other chat-modifying plugins?
     
  6. Online

    timtower Administrator Administrator Moderator

    @WolfMage1 That code only works if class names and methods stay the same.
    Abstraction is a better accepted method.
     
  7. Offline

    Dark_Serpent

    Essentials and Factions. I'm not sure if either of them qualify as a chat-modifying plugin off the top of my head, but other than that no other plugins I use involves the chat in any other way.
     
  8. Offline

    WolfMage1

    how likely is it that they're going to bother changing the name of the class? xD
     
  9. Offline

    pie_flavor

    @Dark_Serpent Well, I am almost completely certain that this will break somehow. Probably with Factions. But who knows? ItemChat.jar
    If this works, I might use it as a public plugin. This was a good plugin idea.
     
  10. Offline

    Dark_Serpent

    Well good news! It works! XD Sorry for the late reply by the way, I was out when you replied.

    If you don't mind, there are some things I think would make the plugin better.

    With the brackets, if the item has a colored name, the later bracket gets changed into whatever colors and fonts the item is. Could you make the brackets both by default white?

    Also, is it possible to add something that registers if multiples of the same item are being held, and add it at the end of the name of the item?

    i.e. A single sand block: [Sand]
    A stack of sand blocks: [Sand x64]

    Thanks again!
     
  11. Offline

    pie_flavor

    @Dark_Serpent Fixed the one, added the other. Redownload.
    Also, sorry about the jar size, since you don't have Spigot I had to package GSON with it, as it is required by the message formatter.

    Also, I was wrong earlier about the server version being important. I am using Fanciful for the chat formatting, and the latest version I knew about needed it, but the actual latest version doesn't appear to. Although I did have to use some reflection hackery to get the standard Minecraft item names. Feel free to update the server if needed, nothing should break.
     
    Last edited: Dec 22, 2015
  12. Offline

    Dark_Serpent

    @pie_flavor
    Sorry! I made a huge mistake. I actually am running Spigot 1.7.9-R0.2, not Craftbukkit. I apologize for that! I don't mind the file size though.

    I have two more things to bring up if you don't mind, sorry for asking!

    Whenever a player who isn't in a faction uses "@ITEM", [FACTION] is displayed next to their name, since they aren't in a faction. Do you think you can fix this somehow?

    Also, is there any chance you could make the brackets color code b? Thanks!
     
  13. Offline

    pie_flavor

  14. Offline

    Dark_Serpent

    @pie_flavor
    The @ITEM command isn't working for some reason. It just states "This player isn't online or you just typed the @ symbol! Ignoring." Which is from another plugin IIRC. It wasn't doing this before.
     
  15. Offline

    pie_flavor

    @Dark_Serpent IDK, I didn't change anything. Can you post your plugin list?
     
  16. Offline

    Dark_Serpent

    I just disabled the plugin that was causing that. Now @ITEM returns nothing. Here's the error in my console:
    Show Spoiler

    [​IMG]

    I wasn't aware I had bChatManager until now. I suppose it comes packaged with bPermissions?
     
  17. Offline

    pie_flavor

    @Dark_Serpent say what now
    NoClassDefFoundException?
    [​IMG]
    It's right there... what?
    Hang on, you have another one from bPermissions. I think something screwed up there. Have you tried restarting your server and trying again, and if that fails redownloading? Because it's saying I didn't put something in my jar, when I clearly did. So it's probably a problem with Bukkit's classloader, or somehow it got deleted inside the jar.
     
  18. Offline

    Dark_Serpent

    @pie_flavor
    I redownloaded and that fixed it. It seems it was deleted inside the jar somehow, as when I compared the two files, the one from the download is 256 KB while the one I had in the server was only 26 KB, even though I faintly remember it being more than that.
    Now that it works, I guess this is filled. Thank you for your help! :D
     
  19. Offline

    pie_flavor

    @Dark_Serpent I have no idea how in the hell that happened. Wow.
     
Thread Status:
Not open for further replies.

Share This Page