Git Product home page Git Product logo

chatchat's People

Contributors

blitzoffline avatar darbyjack avatar frcsty avatar funny-cube avatar igabytm avatar jaimss avatar joeyahines avatar kqliber avatar lagclear avatar lichthund avatar lucyydotp avatar m0diis avatar piggypiglet avatar smuddgge avatar wxipwastaken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatchat's Issues

Prbolem with plugins adding § symbols in messages.

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.

[SUGGESTION] Allow multiple toggle-command for channel

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

Add config customizable placeholders.

Add 2 new config options:

format-placeholders:
message-placeholders:

these options would be a String to String map.
We will compile this map to TagResolvers 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.

NoSuchMethodError - adventure components in ChatChatEvent

[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

minimessage issues

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.

Ignore Command

I'd like to see a /ignore command, just like Essentials.
I'm sure you are already planning on this, but just in case!

Async message processing.

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.

Requesting /ignore [player]

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.)

/ignore, only ignores messages from the public chat and not private messages

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:

  • that user can't DM you,
  • you can't DM that user,
  • you won't see public messages from that user
  • they will still see those public messages from you.

Make use the format field from ChatUser

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.

@NotNull Format format();
void format(@NotNull final Format format);

FormatUtils.findFormat(user.player(), plugin.configManager().formats()),

Plugin Hooks Will Occasionally Fail to Register

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

  • ChatChat, DiscordSRV, PlaceholderAPI, ProtocolLib, spark, SuperVanish

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!

Case Sensitive channel types.

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_-].

Issues with messages sent to console.

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.
image

[Suggestion] Delete Messages

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.

Optional values are never actually optional

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:

if (!source.hasChild(path)) {
throw new SerializationException("Required field " + Arrays.toString(path) + " was not present in node");
}

final var radius = nonVirtualNode(node, RADIUS).getInt(-1);

Chatcolor Suggestion

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.

Found out an issue when using build server (or really when just attempting to compile myself)

when attempting to build gave this error:
FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ":api:javadoc".

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

  • Try:

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.

Relational Placeholders

Relational Placeholder support via PAPI is yet to be implemented. Needed for Dchat feature parody.

Add a dump command.

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:

  • Server version
  • Java version
  • ChatChat version
  • Date when it was generated
  • Config files
  • Others?

Ability to register custom mentions

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.

[SUGGESTION] An update command

Hi,
i suggest you the command /chatchat latest for automatically update ChatChat to the latest version available (simple for the next updates)

[Suggestion] Make the expiration time for lastMessageUser configurable.

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.

[SUGGESTION] Per-player mentions toggle command

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.

Proper Storage

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.

Fix Hover tags on 1.19.1

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.

Namecolor Suggestion

A permission based name color option allowing more customizations and supporting gradient.

Permission example:
chatchat.namecolor.11111
chatchat.namecolor.13332_11231

Proper Locale

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)

Possible problem with recipient placeholders

I can't test at this moment but if I understand this right, We're passing an entire string here

.map(part -> replaceRecipientPlaceholder(player, part))
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%"

Mention/Ping Toggle

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.