Soon:tm:
helpchat / chatchat Goto Github PK
View Code? Open in Web Editor NEWChatChat - Coming Soon
License: MIT License
ChatChat - Coming Soon
License: MIT License
Hi,
i suggest you the command /chatchat latest
for automatically update ChatChat to the latest version available (simple for the next updates)
If a player has a hex colored item, and runs , it'll display random colors in chat.
As messaging becomes more complex a proper locale would be useful. Having an interface storing Components (like how LuckPerms does it) that loads it from a language file would be very convenient and help set the large message bloat into the interface instead.
LuckPerms Reference: https://github.com/LuckPerms/LuckPerms/blob/master/common/src/main/java/me/lucko/luckperms/common/locale/Message.java
Language File: https://github.com/LuckPerms/LuckPerms/blob/master/common/src/main/resources/luckperms_en.properties
(I'll attempt a PR if this is positively received)
Instead of a one size fits all .block
permission that blocks no matter what, a command to toggle pings or toggle mentions would be good.
This command would require the .block
permission, and then you would not check if they have permission, but if they want to block pings.
I'll PR this if it is received positively
Recently I've just added a dump command in DeluxeMenus and it instantly started being useful. We might want to add one for this plugin as well. We can log stuff like:
Add possibility to use multiple commands in toggle-command option.
Example:
channels:
Global:
channel-prefix: <dark_gray>[<blue>Global<dark_gray>]
message-prefix: ''
toggle-command:
- global
- shout
- g
type: default
Instead of calculating the format a user uses every time a player send a message in chat, we should calculate it on player join and on plugin reload. This would allow other plugins and addons to change the formats of players without us overwriting them. To also make sure we override the format on reload, we should add a ReloadEvent that is called when the plugin is reloaded. This event should not be Cancellable.
ChatChat/api/src/main/java/at/helpch/chatchat/api/User.java
Lines 15 to 17 in 4941d60
Add 2 new config options:
format-placeholders:
message-placeholders:
these options would be a String to String map.
We will compile this map to TagResolver
s using Placeholder.unparsed(key, value)
and basically allow message placeholders to be used in user sent messages and format-placeholders to be sent in formats.
We could also allow PlacholderAPI placeholders in those placeholders, and maybe even allow them to be minimessage strings. We can definitely expand on this idea. Also probably a good idea that the message placeholders to be under permissions.
I noticed during a few restarts of my server that DiscordSRV and SuperVanish integrations would not be working. Sometimes both would work, sometimes one would work, and other times neither would work.
Plugins
Here is my three boot attempts that capture it. 1st boot nothing works, 2nd boot DiscordSRV hook works, 3rd boot both DiscordSRV and Super Vanish work. Server is running on purpur 1.19.1 build 1732.
1st Boot
[18:19:58 INFO]: [ChatChat] Loading ChatChat v1.0-SNAPSHOT-20
[18:19:58 INFO]: Server permissions file permissions.yml is empty, ignoring it
[18:19:58 INFO]: [ProtocolLib] Enabling ProtocolLib v5.0.0-SNAPSHOT-b586
[18:19:58 WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[18:19:58 WARN]: The server will make no attempt to authenticate usernames. Beware.
[18:19:58 WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[18:19:58 WARN]: You will not be offered any support as long as the server allows offline-mode players to join.
[18:19:58 WARN]: To change this, set "online-mode" to "true" in the server.properties file.
[18:19:58 INFO]: Preparing level "world"
[18:19:59 INFO]: Preparing start region for dimension minecraft:overworld
[18:19:59 INFO]: Time elapsed: 98 ms
[18:19:59 INFO]: Preparing start region for dimension minecraft:the_nether
[18:19:59 INFO]: Time elapsed: 63 ms
[18:19:59 INFO]: Preparing start region for dimension minecraft:the_end
[18:19:59 INFO]: Time elapsed: 107 ms
[18:19:59 INFO]: [PlaceholderAPI] Enabling PlaceholderAPI v2.11.2
[18:19:59 INFO]: [PlaceholderAPI] Fetching available expansion information...
[18:19:59 INFO]: [spark] Enabling spark v1.9.33
[18:20:00 INFO]: [spark] Using Paper ServerTickStartEvent for tick monitoring
[18:20:00 INFO]: [PlaceholderAPI] Successfully registered expansion: spark [1.9.33]
[18:20:00 INFO]: [spark] Registered PlaceholderAPI placeholders
[18:20:00 INFO]: [SuperVanish] Enabling SuperVanish v6.2.6
[18:20:00 INFO]: [PlaceholderAPI] Successfully registered expansion: supervanish [6.2.6]
[18:20:00 INFO]: [SuperVanish] Hooked into PlaceholderAPI
[18:20:00 INFO]: [DiscordSRV] Enabling DiscordSRV v1.25.1
[18:20:00 INFO]: [ChatChat] Enabling ChatChat v1.0-SNAPSHOT-20
[18:20:00 INFO]: [PlaceholderAPI] Successfully registered expansion: chatchat [1.0-SNAPSHOT-20]
[18:20:00 INFO]: [ChatChat] Plugin enabled successfully!
2nd Boot
[18:21:54 INFO]: [ChatChat] Loading ChatChat v1.0-SNAPSHOT-20
[18:21:54 INFO]: Server permissions file permissions.yml is empty, ignoring it
[18:21:54 INFO]: [ProtocolLib] Enabling ProtocolLib v5.0.0-SNAPSHOT-b586
[18:21:54 WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[18:21:54 WARN]: The server will make no attempt to authenticate usernames. Beware.
[18:21:54 WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[18:21:54 WARN]: You will not be offered any support as long as the server allows offline-mode players to join.
[18:21:54 WARN]: To change this, set "online-mode" to "true" in the server.properties file.
[18:21:54 INFO]: Preparing level "world"
[18:21:55 INFO]: Preparing start region for dimension minecraft:overworld
[18:21:55 INFO]: Time elapsed: 164 ms
[18:21:55 INFO]: Preparing start region for dimension minecraft:the_nether
[18:21:55 INFO]: Time elapsed: 125 ms
[18:21:55 INFO]: Preparing start region for dimension minecraft:the_end
[18:21:55 INFO]: Time elapsed: 64 ms
[18:21:55 INFO]: [PlaceholderAPI] Enabling PlaceholderAPI v2.11.2
[18:21:56 INFO]: [PlaceholderAPI] Fetching available expansion information...
[18:21:56 INFO]: [spark] Enabling spark v1.9.33
[18:21:56 INFO]: [spark] Using Paper ServerTickStartEvent for tick monitoring
[18:21:56 INFO]: [PlaceholderAPI] Successfully registered expansion: spark [1.9.33]
[18:21:56 INFO]: [spark] Registered PlaceholderAPI placeholders
[18:21:56 INFO]: [SuperVanish] Enabling SuperVanish v6.2.6
[18:21:56 INFO]: [PlaceholderAPI] Successfully registered expansion: supervanish [6.2.6]
[18:21:56 INFO]: [SuperVanish] Hooked into PlaceholderAPI
[18:21:56 INFO]: [DiscordSRV] Enabling DiscordSRV v1.25.1
[18:21:56 INFO]: [ChatChat] Enabling ChatChat v1.0-SNAPSHOT-20
[18:21:56 INFO]: [ChatChat] Enabled the DiscordSRV hook.
[18:21:57 INFO]: [PlaceholderAPI] Successfully registered expansion: chatchat [1.0-SNAPSHOT-20]
[18:21:57 INFO]: [ChatChat] Plugin enabled successfully!
3rd Boot
[18:22:39 INFO]: [ChatChat] Loading ChatChat v1.0-SNAPSHOT-20
[18:22:39 INFO]: Server permissions file permissions.yml is empty, ignoring it
[18:22:39 INFO]: [ProtocolLib] Enabling ProtocolLib v5.0.0-SNAPSHOT-b586
[18:22:39 WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[18:22:39 WARN]: The server will make no attempt to authenticate usernames. Beware.
[18:22:39 WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[18:22:39 WARN]: You will not be offered any support as long as the server allows offline-mode players to join.
[18:22:39 WARN]: To change this, set "online-mode" to "true" in the server.properties file.
[18:22:39 INFO]: Preparing level "world"
[18:22:39 INFO]: Preparing start region for dimension minecraft:overworld
[18:22:40 INFO]: Time elapsed: 118 ms
[18:22:40 INFO]: Preparing start region for dimension minecraft:the_nether
[18:22:40 INFO]: Time elapsed: 63 ms
[18:22:40 INFO]: Preparing start region for dimension minecraft:the_end
[18:22:40 INFO]: Time elapsed: 128 ms
[18:22:40 INFO]: [PlaceholderAPI] Enabling PlaceholderAPI v2.11.2
[18:22:40 INFO]: [PlaceholderAPI] Fetching available expansion information...
[18:22:40 INFO]: [spark] Enabling spark v1.9.33
[18:22:40 INFO]: [spark] Using Paper ServerTickStartEvent for tick monitoring
[18:22:40 INFO]: [PlaceholderAPI] Successfully registered expansion: spark [1.9.33]
[18:22:40 INFO]: [spark] Registered PlaceholderAPI placeholders
[18:22:40 INFO]: [SuperVanish] Enabling SuperVanish v6.2.6
[18:22:40 INFO]: [PlaceholderAPI] Successfully registered expansion: supervanish [6.2.6]
[18:22:40 INFO]: [SuperVanish] Hooked into PlaceholderAPI
[18:22:40 INFO]: [DiscordSRV] Enabling DiscordSRV v1.25.1
[18:22:40 INFO]: [ChatChat] Enabling ChatChat v1.0-SNAPSHOT-20
[18:22:41 INFO]: [ChatChat] Enabled the DiscordSRV hook.
[18:22:41 INFO]: [ChatChat] Enabled the SuperVanish hook.
[18:22:41 INFO]: [PlaceholderAPI] Successfully registered expansion: chatchat [1.0-SNAPSHOT-20]
[18:22:41 INFO]: [ChatChat] Plugin enabled successfully!
Currently, the plugin has this hardcoded to 5 minutes here. I think this would be good to make this timeout configurable (or possibly disable it all together).
I wouldn't mind taking a stab at this if this sounds like something other would want.
P.S. I just wanted to say ChatChat has been working really well overall on our medium sized survival server. We had been using DC for years and switched for our recent reset.
Hi,
Just noticed that any changes in messages.yml aren't reflected when the plugin is in use. I'm assuming that's because they've been defined in https://github.com/HelpChat/ChatChat/blob/main/plugin/src/main/java/at/helpch/chatchat/config/holders/MessagesHolder.java and aren't using the ones from the config instead.
Expected outcome: changes in messages.yml should work
There are some instances where the AsyncPlayerChatEvent isn't actually async which means all the message processing is done on the main thread. I believe this happens when the player's message is sent using the spigot api but possible in other instances as well. We need to detect those instances and execute the code on another thread.
So there's 2 issues currently with messages sent by players when they show in console.
First of all in spigot even if you clear the recipients list, the message will still be sent to the console. You have to completely cancel the event for it to not be sent.
This means since we send the message to the console ourselves there will be a duplicate. And yes at least for the normal ChatChannels the console will always be a target as shown here:
The second issue is that our format just send the message itself but not the formatting part. so no player names, etc.
Mini message is great and all but the fact you can no longer use &f &c etc... it breaks lots of things. For example when creating a rank prefix on luckperms you will only see the good colors in chat but in custom menus and tab and many many many many more plugins that doesn't support minimessage you will only see "MY RANK". Please add support to the old format.
It appears the <hover>
tags are broken on 1.19.1 noticed this while setting up ChatChat on my server.
Looking back through the PRs (#64), it looks like this happened before and was fixed by bumping up the minimesage version.
I can't test at this moment but if I understand this right, We're passing an entire string here
and the parser method will only remove the first 11 characters and append a % at the start then attempt to parse the placeholders.This means in a part that looks something like this "hello, this test %recipient_placeholder-here%" would become " test %%recipient_placeholder-here%"
We need to add proper storage soon.
The ChatUser has a few options already that just reset on every server restart and with the addition of stuff like per player ignore this will really be needed.
We can start with some json storage first and then later add sql and mysql or other remote storage options.
Possibility to link much server tchat with bungee or other methods,
The plugin uses a few methods and events that didn't exist in spigot 1.13.2. I'll make a list of them here and you guys can just check the boxes when they're fixed.
Won't close this as if there's future related problems we'll just add them here.
when attempting to build gave this error:
FAILURE: Build failed with an exception.
Could not resolve all dependencies for configuration ":api:compileClasspath".
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See https://docs.gradle.org/7.4.1/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
Could not find org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/spigot-api-1.18.1-R0.1-SNAPSHOT.pom
- file:/root/.m2/repository/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/maven-metadata.xml
- file:/root/.m2/repository/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/spigot-api-1.18.1-R0.1-SNAPSHOT.pom
Required by:
project :api
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use "--warning-mode all" to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 6s
10 actionable tasks: 10 up-to-date
Build step "Invoke Gradle script" changed build result to FAILURE
Build step "Invoke Gradle script" marked build as failure
[Checks API] No suitable checks publisher found.
Finished: FAILURE
did some digging and found that in ChatChat/build-logic/src/main/kotlin/chatchat.base-conventions.gradle.kts
changing
repositories { mavenCentral() mavenLocal() }
to
repositories { maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") maven("https://repo.maven.apache.org/maven2") }
fixes it and allows the build to succeed. the 2nd repo is the same on as mavenCentral() so it should still be pulling from the same place.
sorry for bad format as i havent done github formatting in awhile and am a bit too lazy to try and fix it unless someone has issues understanding it.
There is no reason for us to call this method every time the plugin is reloaded. The messages and actions are not being cached by triumph-cmds
When a user ignores another user, they will still be able to send and receive private messages to and from that user. This seems like an oversight.
I personally believe that if you ignore a user:
https://img001.prntscr.com/file/img001/w4OIokX0QP6FAorpDYXhgg.png
As seen in the image above, if you /msg or /r to someone, it'll sometimes show the socialspy message last, rather than first. Social spy should always be the first one to send.
So apparently, ItemMeta#hasLocalizedName isn't what we're supposed to use but rather we should get the NamespacedKey from the Material and create a TranslatableComponent with that key.
ChatChat/plugin/src/main/java/at/helpch/chatchat/util/ItemUtils.java
Lines 62 to 64 in 0d6e1b2
Currently channel types are case sensitive. In my opinion they shouldn't be. This has been reported by a user that has tried to register a towny_town
channel but was getting a warning saying that is not an available channel because we currently register the towny_town channels as TOWNY_TOWN
. We should maybe just lowercase all added channel types. Or maybe add an available regex that people can use to register channels and throw an error if they attempt to register using anything else. The pattern I was thinking would be best is [a-z_-]
.
It'd be a great addition to allow "deleting" messages. From what my friend told me, it works by re-sending all the currently viewable messages in chat minus the deleted one.
[20:02:15 ERROR]: Could not pass event ChatChatEvent to ESEmoji v2.0-SNAPSHOT
java.lang.NoSuchMethodError: 'net.kyori.adventure.text.Component at.helpch.chatchat.api.event.ChatChatEvent.message()'
at me.xemor.esemoji.feature.EmojiChatChat.onChat(EmojiChatChat.java:20) ~[original-ESEmoji-2.0-SNAPSHOT.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor135.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:git-Purpur-1732]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at at.helpch.chatchat.util.MessageProcessor.process(MessageProcessor.java:78) ~[ChatChat-1.0-SNAPSHOT.jar:?]
at at.helpch.chatchat.listener.ChatListener.onChat(ChatListener.java:79) ~[ChatChat-1.0-SNAPSHOT.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor111.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:git-Purpur-1732]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:678) ~[purpur-api-1.19-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:195) ~[purpur-1.19.jar:git-Purpur-1732]
at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:67) ~[purpur-1.19.jar:git-Purpur-1732]
at net.minecraft.server.network.ServerGamePacketListenerImpl.chat(ServerGamePacketListenerImpl.java:2384) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.broadcastChatMessage(ServerGamePacketListenerImpl.java:2340) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChat$21(ServerGamePacketListenerImpl.java:2313) ~[?:?]
at java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:757) ~[?:?]
at java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:735) ~[?:?]
at java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2182) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.a(ServerGamePacketListenerImpl.java:2313) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChat$17(ServerGamePacketListenerImpl.java:2210) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Any help? oh I know what the issue will be, it'll be due to the relocation in your build script, it thinks it's a different type of component to the one I have. I built ChatChat using gradle plugin:shadowJar
The message won't be displayed to the user but others that can access the channel can see it
Allowing permission based chat color as well as supporting gradient.
Permission Example:
chatchat.chatcolor.32221
chatchat.chatcolor.33332_11111
This will allow more customization options for server owners as well as removing another needed plugin for changing chat colors quickly.
We need to make the mentions manager public and add the ability for other plugins to register their own mentions and ChatChat to handle them.
As the user's channel is never actually updated, the placeholder results in the user's current active channel. This poses issues when using that placeholder in messages to denote their channel
Add Build # to the version if the environment variable exists
This would be a command like /mentions toggle
or similar which would allow the player to disable being mentioned. If the player happens to be an admin or streamer, getting frequently mentioned would likely become quite annoying.
I'd like to see a /ignore command, just like Essentials.
I'm sure you are already planning on this, but just in case!
The AsyncPlayerChatEvent should probably be canceled if the ChatChatEvent was canceled.
Currently if you have a plugin like ChatColor2, it adds § at the start of the message and when we pass the message thru minimessages it errors out. We might want to kyorify the message before deserializing it.
Just like /chatchat test <format> <message>
I have a plugin that edits the message before ChatChat formats it, but it just strips the colour.
I attempted to rewrite it using Paper's AsyncChatEvent and Adventure Components, and that is fully incompatible.
A permission based name color option allowing more customizations and supporting gradient.
Permission example:
chatchat.namecolor.11111
chatchat.namecolor.13332_11231
The following command will make it so you can ignore another player and make it so you do not see their messages in chat, or private message. Also, the player ignored cannot see your messages either.
Have a permission chatchat.ignore.bypass (Players with this permission CANNOT be ignored.)
Hello,
I used deluxechat before, and there was a toggle for private message
private_message:
enabled: false
So I used another plugin for this, and I want to do the same on chatchat :)
Similar to the item function but for the persons inventory.
When they type inv or inventory it opens a GUI.
Add the ability to put a distance/radius on a chat channel.
For example; I'd like to make a "local" chat channel that's only visible to players that are within a X block radius of the sender.
So, currently the nonVirtualNode methods throw an error if the node is not found but this method is used for optional values like channel radius, channel prefix, etc. Even tho there's an attempt to set a default value the program will never get there as an exception is thrown before its able to do that.
Example with radius:
Relational Placeholder support via PAPI is yet to be implemented. Needed for Dchat feature parody.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.