Inactive [CHAT] iChat 2.4.4 - Custom Chat Formatting [1337]

Discussion in 'Inactive/Unsupported Plugins' started by Drakia, Feb 24, 2011.

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

    Drakia

    iChat 2.x - Custom Chat Formatting
    Version: 2.4.4
    CraftBukkit: 1337

    Plugin Support:
    PermissionsBukkit
    bPermissions
    Permissions 2.x
    Permissions 3.x

    If you are requesting help, post your entire server log (From the time it opens, until somebody talks), your entire Permission config file (As well as what it's named), and iChat config files. This information is REQUIRED for me to help you.
    http://pastebin.com/ <-- Post configs there when asking for help

    =============
    Description
    =============
    Custom chat formatting.
    Based on the idea of iChat v1.5 by Nijikokun.
    Includes code and concepts from mChat by MiracleM4n <https://github.com/MiracleM4n/mChat/>

    Before downloading: iChat 2.4.x has quite a few changes over the 2.3.x branches. All permissions plugins are handled in one plugin, and they all operate in relatively the same way now. This means you WILL need to redo your configs.
    Download (Direct JAR): http://thedgtl.net/bukkit/iChat.jar
    Source: https://github.com/TheDgtl/iChat

    =============
    Features
    =============
    Supports Permissions (Both 2.0 and 2.1), and SuperPerms handlers (PermissionsBukkit, bPermissions, and PermissionsEx).
    Allows you to specify a prefix/suffix/variable for users and groups on a per-world or global basis.
    A user-specific prefix/suffix/variable will take priority over a group prefix/suffix/variable, a world-based prefix/suffix/variable will take priority over a global prefix/suffix/variable.
    Unlimited amount of custom variables for use in chat format.
    Colors are supported in all parts of the formatting and chat text.
    Usable health bar and health amount in the formatting.
    Support for formatting of /me

    =============
    Formatting
    =============
    Message formatting is defined in the file plugins/iChat/config.yml
    The message formats can contain characters, color codes, and variables.
    To use colors use the standard Minecraft color codes found here: http://www.minecraftwiki.net/wiki/Classic_Server_Protocol#Color_Codes

    Available variables:
    +prefix - The prefix for this user, or this users group if they don't have one defined.
    +suffix - The suffix for this user, or this users group if they don't have one defined.
    +name - The users name
    +displayname - The users display name (Set by plugins such as Towny)
    +iname - The iChat formatted player name (Defined by iname-format)
    +group - The users group
    +healthbar - A visual health bar for this user
    +health - The users current health value (Between 0 and 20)
    +message - The message the player typed
    +world - What world the player is currently in
    +time - Timestamp, configurable in config.yml. Uses the format for SimpleDateFormat - http://bit.ly/dscw40

    Example (Default):
    Code:
    iname-format: '[+prefix+group+suffix&f] +displayname'
    message-format: '+iname: +message'
    me-format: '* +name +message'
    date-format: 'HH:mm:ss'
    handle-me: true
    Example date-format (Default):
    date-format: 'HH:mm:ss'

    As of iChat 2.4.0 there have been a few changes in the way variables and groups are handled.

    ==========
    Groups
    ==========
    As of iChat 2.4.3 native groups are supported in Permissions 2.x/3.x, PermissionsBukkit, bPermissions, and PermissionsEx.

    ==========
    Variables
    ==========
    Variables are now defined in variables.yml in the iChat directory. This includes prefixes, suffixes, and custom variables.
    You can define an unlimited number of custom variables for groups and users, if these variables contain the static variables such as +prefix,
    +suffix, +health, etc then those variables will be replaced with their respective values.
    If a variable does not exist then it will be replaced with a blank string.

    As of iChat 2.4.4 you can now specify world-specific variables. To specify a per-world group or user variable (Prefix, suffix, or variable) you just specify it under the world as shown in the 'world' example in the default variables.yml below. Anything specified in the parent 'users' or 'groups' nodes will be considered global for all worlds.

    Default variables.yml:
    ---------------------
    Code:
    # iChat Variable Config
    # This is now the only method for defining variables
    users:
        Drakia:
            prefix: '&e'
    groups:
        Admin:
            prefix: '&c'
            suffix: ''
        Default:
            prefix: ''
            suffix: ''
    world:
      users:
        Drakia:
          prefix: '&a'
    Default config.yml:
    ---------------------
    Code:
    handle-me: true
    date-format: HH:mm:ss
    message-format: '+iname: +message'
    me-format: '* +name +message'
    iname-format: '[+prefix+group+suffix&f] +displayname'
    =============
    Examples
    =============
    To make a group colored:
    variables.yml:
    Code:
    groups:
        Default:
            prefix: '&4'
            suffix: ''
    config.yml:
    Code:
    message-format: '[+prefix+group&f] +name: +message'
    To make a single username colored:
    variables.yml:
    Code:
    users:
        Drakia:
            prefix: ''
            suffix: '&1'
    Config:
    Code:
    message-format: '[+prefix+group&f] +suffix+name&f: +message'
    As you can see, suffixes and prefixes can be used anywhere, in any combination. In this example we use prefix as a method for coloring group names, while suffix is used to color individual users. On our server we have prefixes such as "&f[&2Mod&f] " so that we can have custom tags per group instead of just the groups name. There is no end to the combination of things you can do, please TRY things before you come asking for someone else to do it for you. There are too many combinations of things for me to answer every question about how to color specific things.
    I will not be offering answers to questions such as "How do I color names?" or really anything else to do with specifics of formatting. It's pretty straightforward what you can do, and if you can't take the time to experiment then I'm not going to take the time to answer your questions.

    =============
    Configuration
    =============
    iname-format - The format used for +iname (Default: '[+prefix+group+suffix&f] +displayname')
    message-format - The format used for basic chat (Default: '+iname: +message')
    date-format - The format used for +date (Default: 'HH:mm:ss')
    me-format - The format used for /me commands (Default: '* +name +message')
    handle-me - Whether to handle /me commands (Default: true)

    =============
    Permissions
    =============
    ichat.color - Allow this group/user to use color in their chat messages.
    ichat.reload - Allow this group/user to use "/ichat reload"

    =============
    Commands
    =============
    /ichat reload - Reload the iChat config file

    =============
    F.A.Q.
    =============
    Q) Why is my custom message format not working? I just get the default output. Or output with no variables filled in.
    A) If you're using Permissions 2.1, make sure your Permissions config file is named "{worldname}.yml" where {worldname} is the name of your world. If you're using Permissions 2.0, make sure your Permissions config is named config.yml

    Q) How do I set the brackets color to the same as the group?
    A) Normally you have the brackets in the message-format variable, but you can just as easily move them into prefix/suffix and that way they can be per-group colored!

    Q) Why is my entire string colored? I just put a color code beside +name!
    A) A color code will persists until another color code is encountered, or the end of the line is reached. To change the line back to white use &f after the variable/string you want colored.

    Q) Why are my OPs names red?
    A) Essentials has this functionality built in. Change "ops-name-color" to 'none' in your Essentials config file.

    Q) Why does {PluginX} not work with iChat?
    A) There's a good chance it does, but you need to use +displayname instead of +name.

    Q) Why does Towny not work with iChat?
    A) iChat no longer uses %1$s for the player name, it uses player.getName() and player.getDisplayName(), until such a time that Towny is updated to use the proper method of setting a players name (Set their displayName) it will not work with iChat.

    =============
    Changes
    =============
    [Version 2.4.4]
    - Updated to new FileConfiguration class
    - Fixed bypass exploit for colors in messages
    - Multi-world support for variables.yml
    - Resolved an issue with /me not reloading player variables
    [Version 2.4.3]
    - Permissions overhaul. No longer require group.{name} node unless not using a permissions handler
    [Version 2.4.2]
    - Fixed issue with inheritance in Permissions
    - Implemented start of online time variable. Need output format.
    [Version 2.4.1]
    - Remove plugin-specific group referencing. All groups are now managed via group.* nodes,
    the exception being pure Permissions 2.x/3.x
    - Fixed /ichat reload not reloading variables.yml
    - Updated /me to use BroadcastMessage
    [Version 2.4.0-final]
    - Took out variable caching, there's no hook for PermissionChange.
    - Updated README to include info on group.* nodes
    [Version 2.4.0-beta]
    - Merged all branches into one
    - Supports Perms 2.x/3.x, SuperPerms, GroupManager
    - Added a more advanded API based on the mChat API
    - Massive thanks to MiracleM4n for code and concepts
    - All variables are now retrieved from variables.yml instead of Permissions
    - Removed censor code
    [Version 2.3.2-p3]
    - Set Permissions as a dependency in plugin.yml
    - Added Permissions 3 support to the -p3 jar
    [Version 2.3.1]
    - Added iChat.ichat.parseChat(Player, String, Format) API
    - Added hook for /me chat formatting using the "me-format" config option
    [Version 2.3.0]
    - Added external iChat.ichat.parseChat(Player, String) API
    [Version 2.2.3]
    - Added +displayname/+d for player.getDisplayName()
    [Version 2.2.2]
    - Updated to latest RB
    [Version 2.2.1]
    - Updated how Permissions is loaded
    [Version 2.2.0]
    - Added the ability to have an unlimited amount of variables in message-format
    - Changed versioning scheme
    [Version 2.11]
    - Now uses per-world permissions information
    [Version 2.10]
    - Allow admins to enable color on a permissions basis
    [Version 2.09]
    - Another small update to Permissions (Returned false when I should have returned true)
    [Version 2.08]
    - Pushes PacketCollisions PermVersion change. Fixes issues with 2.5.2
    [Version 2.07]
    - Added +time tag
    [Version 2.06]
    - Added +world tag
    [Version 2.05]
    - Ignore whether the plugin is GM, just treat everything as Permissions! Means you need FakePermissions.
    [Version 2.04]
    - Added the ability to use variables in the suffix and prefix (More customizeable messages)
    [Version 2.03]
    - Verify that all available variables aren't null before calling parse
    - Fixed crash caused by color code at end of message (Basic fix, added a space)
    [Version 2.02]
    - Fix for possible NPE
    [Version 2.01]
    - There's a bug in Permissions 2.1 in getPermissionString, switched to getUserPermissionString
    [Version 2.00]
    - Initial re-write of Niji's plugin.
    - Added Permissions 2.0/2.1, and GroupManager support.[/b]
     
    FFS2309, Lolmewn, wassilij and 12 others like this.
  2. Offline

    Jandalf

    yes when ur default world is World1
     
  3. Offline

    Puremin0rez

    Would it be possible to adjust the censor system? It will block a word only if its by itself, not if you add "ing" or anything like that. Thanks!
     
  4. Offline

    Xtreme_Machine

    Thank you for this fix! Could have thought of that myself :p

    I have been playing with your source-code all night last night just to get into (Craft)Bukkit plugin development. This must have been a GroupManager issue.. your code was right. I could not get the GroupManager plugin to compile correctly, otherwise i would have tried to fix that ;)
     
  5. Offline

    TheDaddyPeanut

    Do this work also for Permissions 2.4???
     
  6. Offline

    Jandalf

    yes it does
     
  7. Offline

    TheDaddyPeanut

    Ok i dont remember good but yesterday the PLAYER_CHAT error message came up idk wich versions i was using.
    Lets try it now
     
  8. Offline

    xxxfakaxxx

    Hey guys, i have a problem!
    a have a "B" before all groups' name
    [​IMG]
    i checked Permissions and iChat config, all is good.
    How to fix?
     
  9. Offline

    Jandalf

    could u copy both configs to pastebin.com?
     
  10. Offline

    xxxfakaxxx

  11. Offline

    Jandalf

  12. Offline

    xxxfakaxxx

    ok, i fixed colored text, but i still have B before group's name.
     
  13. Offline

    Draconicus

  14. Offline

    Jandalf

    hm, delete the +preffix, try again, then only delete the +group and try. maybe the B is only in one of them...
     
  15. Offline

    Cool12309

    Build 454 and above breaks this plugin due to the removal of onCommand

    Error (open)
    [SEVERE] PLAYER_COMMAND loading iChat v2.05 (Is it up to date?)
    java.lang.NoSuchFieldError: PLAYER_COMMAND
    at com.nijikokun.bukkit.Permissions.Permissions.registerEvents(Permissions.java:117)
    at com.nijikokun.bukkit.Permissions.Permissions.onEnable(Permissions.java:107)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:117)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:414)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
    at net.TheDgtl.iChat.iChat.setupPermissions(iChat.java:96)
    at net.TheDgtl.iChat.iChat.onEnable(iChat.java:41)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:117)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:414)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:187)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     
  16. Offline

    Thanks4trying

    "when i type it does this"
    [SEVERE] Could not pass event PLAYER_CHAT to iChat
    while parsing a block mapping
    in "<reader>", line 55, column 7:
    default: false
    ^
    expected <block end>, but found BlockMappingStart
    in "<reader>", line 60, column 9:
    inheritance:
    ^
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:576)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
    at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
    at org.bukkit.util.config.Configuration.load(Configuration.java:73)
    at com.nijiko.permissions.Control.load(Control.java:144)
    at com.nijiko.permissions.Control.loadWorld(Control.java:108)
    at com.nijiko.permissions.Control.getUserPermissionString(Control.java:923)
    at com.nijiko.permissions.Control.getUserPermissionString(Control.java:1119)
    at net.TheDgtl.iChat.iChat.getPrefix(iChat.java:198)
    at net.TheDgtl.iChat.playerListener.onPlayerChat(playerListener.java:21)
    at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:160)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:225)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:591)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:578)
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:70)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:338)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:252)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
     
  17. Offline

    Jandalf

  18. Offline

    Thanks4trying

    thanks jan. i switched over to groupmanager and it works fine now
     
  19. Offline

    Jandalf

    :D thats not what i meant, but ok.
     
  20. Offline

    Drakia

    @Cool12309 that is permissions that is broken, not iChat. I don't use onCommand
     
  21. Offline

    5*stunner

    ichat loads properly, but whenever someone types something to say I get teh following error in the logs.




    saw someone had the same error above. nvm this post.
     
  22. Offline

    icuttu

    I downloaded this and I'm using it with permissions 2.4, and everything loads up accordingly. In-game however, no colours are showing up at all. Can anyone help me? Thank you.

    My permissions config file:

    # System is no longer used, but may become used in the future
    # Copies is for multiple-world support
    # Put the name of the world you wish for it to be a clone of, otherwise leave it empty.
    # Does not work for the default world.
    # Example: copies: Derp - This will clone the permissions of the world Derp
    plugin:
    permissions:
    system: default
    copies:

    # Groups can contain inheritance.
    # To make a group inherit the permissions from another
    # group simply place the groups name in the "inheritance:" like so:
    #
    # Example:
    # inheritance:
    # - Default
    ##
    # All permissions including the asterisks must be placed in single quotes.
    # like so:
    #
    # - 'general.spawn'
    #
    # Otherwise errors will happen!
    ##
    # Globalized Permission settings:
    #
    # If a permission contains periods (.) you can denote a globalized parameter:
    #
    # - 'general.*'
    #
    # This will allow you to use all general commands.
    #
    ##
    # Single Asterisk denotes all commands:
    #
    # - '*'
    ##
    # To exempt a node use the - prefix like so:
    # - '-general.time'
    ##
    groups:
    Default:
    default: true
    info:
    prefix: ''
    suffix: ''
    build: true
    inheritance:
    permissions:
    - 'foo.bar'
    Admins:
    default: false
    info:
    prefix: '&1[&3Admin&1]&2'
    suffix: '&4'
    build: true
    inheritance:
    - Default
    permissions:
    - '*'

    ##
    # Users denote which users are included in which group.
    # TheNo1Yeti is in the Admin group
    # Herpina is a member of the Default group but also has access
    # to the herp.derp permissions
    # Derpina is a member of the admin group but does not have access
    # to the derp.derp permission node
    ##
    users:
    icuttu:
    group: Admins
    permissions:
    Herpina:
    group: Default
    permissions:
    - 'herp.derp'
    Derpina:
    group: Admins
    permissions:
    - '-derp.derp'

    My iChat config file:

    message-format: '[+prefix+group+suffix&f] +name: +message'

    [edit] The spaces are not showing up correctly, however they are spaced out accordingly.
     
  23. Offline

    Drakia

    @icuttu Post it on pastebin so we can actually see the spacing, that's why I specifically said in my first post to post to pastebin.com You could very well have messed up spacing somewhere.

    @xxxfakaxxx Make sure you don't have any other chat plugins installed, looks like another plugin may be interfering with this one.
     
  24. Offline

    icuttu

    Okay, sorry about that. Here you go:
    http://pastebin.com/bUG2c5jP
     
  25. Offline

    Jdog653

    Hey all,

    I'm using pheonix permissions 2.4 and ichat 2.05. I have set up the prefix and suffix correctly but whenever i chat it looks like this "[] Jdog653: test message". I renamed my config.yml to my defualt world but when i reloaded the server it just created a new config.yml in it's place.
    My iChat config: http://pastebin.com/SYhVr3Ab
    My Permissions config: http://pastebin.com/BSbV02C2

    Please help as i am increasingly annoying my players because they have no idea what class they are in.
     
  26. Offline

    TuRmoiLxx

    EDIT: NVM.
     
  27. Offline

    mint90

    how to i edit the ichat msg format to &1[&7Owner&6]&1 when i put in permission
     
  28. Offline

    Jandalf

    delete one space before dapina
    --- merged: Feb 28, 2011 2:53 PM ---
    ichat config seams ok, but ur permission file is... isnt there any error when u try to use a command, for that u need permissions? (in the server log)
    --- merged: Feb 28, 2011 2:56 PM ---
    i dont know what excectly u want but:
    message-format: '&1[+prefix+group+suffix]&1+name:&f +message'
    prefix: '&7'
    suffix: '&6'
     
  29. Offline

    bugonstick

    Can you please change the way data.yml saves? Having it all default to one line is REALLY annoying, I have to constantly keep a backup in place just so I can read it.
    Also can you have it auto-add users to the list at the bottom? please and thank you.
     
  30. Offline

    Jdog653

    My commands work fine for me. I'm not sure what you're gettin at tho. Is my permissions file way skrewed up? Please tell me what is happening

    EDIT: I'm the only one that can use any commands, regardless of ranking in permissions.
    My config.yml (Pheonix Permissions): http://pastebin.com/BWs2mC8b
     
  31. Offline

    tension69

    Drakia, this works fine with build#478;) (iChat2.04 , Permissions 2.4)
     
Thread Status:
Not open for further replies.

Share This Page