jmhertlein / MCTowns

A versatile and powerful town plugin using WorldGuard and the Bukkit API for Minecraft.
http://dev.bukkit.org/server-mods/mctowns/
GNU General Public License v3.0
8 stars 3 forks source link

Chat prefix #71

Open Troydesante opened 9 years ago

Troydesante commented 9 years ago

Hi, Can you please add a chat prefix for essentials chat? like [Town1]playername: A lot of my players ask for this and it would be really helpfull for admins on my server. Now when we give help we always need to ask like what is your town name...

Regards, Troy

Troydesante commented 9 years ago

Sorry I mean like [Townname]playername: [message]

jmhertlein commented 9 years ago

Sounds good, slating this for 2.5.0

jmhertlein commented 9 years ago

I did a little work on this in 23626e7d89ff4d99d40d0071ef7c90a8b0daaaeb

There does not appear to be any way to just add a single thing into someone's chat prefix in a way that I can manage it at all. I could just inject it into their prefix at a certain spot, but it would be very difficult to remove it reliably without messing up the rest of their prefix.

I could also "hijack" the entire format of the chat message, but that would be majorly incompatible with all other chat plugins, or it could just get overwritten if another plugin has higher priority.

I tried dynamically making permission groups for each town, since that's something I've been meaning to look into for a while, and as it turns out Vault doesn't offer API for creating or deleting permission groups. Apparently, some permission systems will let you make new groups by just adding players to that group and it'll make it if it doesn't exist, but then since creating and adding groups are the same thing, it's then possible to add players to the "Admin" group by making a town named Admin. This could be worked around, but it makes me nervous.

Anyway, this needs more research, and I need to track down a Vault guy to ask their opinion.