add message formatting
This commit is contained in:
parent
cf3dbf14b2
commit
4d1a208e23
4 changed files with 68 additions and 71 deletions
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
|
|
@ -17,6 +17,7 @@
|
||||||
</compositeBuild>
|
</compositeBuild>
|
||||||
</compositeConfiguration>
|
</compositeConfiguration>
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="corretto-23" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$/../build-logic" />
|
<option value="$PROJECT_DIR$/../build-logic" />
|
||||||
|
|
|
||||||
1
.idea/vcs.xml
generated
1
.idea/vcs.xml
generated
|
|
@ -2,6 +2,5 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$/../build-logic" vcs="Git" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
105
.idea/workspace.xml
generated
105
.idea/workspace.xml
generated
|
|
@ -5,18 +5,9 @@
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="56c685a1-f609-4ffd-a951-849beb2a7f8d" name="Changes" comment="cleaned up build process">
|
<list default="true" id="56c685a1-f609-4ffd-a951-849beb2a7f8d" name="Changes" comment="cleaned up build process">
|
||||||
<change afterPath="$PROJECT_DIR$/../build-logic/convention/src/main/kotlin/scrow/ScrowPublishConvention.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
|
||||||
<change afterPath="$PROJECT_DIR$/../build-logic/convention/src/main/kotlin/scrow/configureScrowRepo.kt" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/../build-logic/convention/build.gradle.kts" beforeDir="false" afterPath="$PROJECT_DIR$/../build-logic/convention/build.gradle.kts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/../build-logic/convention/src/main/kotlin/scrow/ScrowRepositoryConvention.kt" beforeDir="false" afterPath="$PROJECT_DIR$/../build-logic/convention/src/main/kotlin/scrow/ScrowRepositoryConvention.kt" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/core-bukkit-api/build.gradle.kts" beforeDir="false" afterPath="$PROJECT_DIR$/core-bukkit-api/build.gradle.kts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/core-bukkit-impl/build.gradle.kts" beforeDir="false" afterPath="$PROJECT_DIR$/core-bukkit-impl/build.gradle.kts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/core-lib/build.gradle.kts" beforeDir="false" afterPath="$PROJECT_DIR$/core-lib/build.gradle.kts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/core-velocity-api/build.gradle.kts" beforeDir="false" afterPath="$PROJECT_DIR$/core-velocity-api/build.gradle.kts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/core-velocity-impl/build.gradle.kts" beforeDir="false" afterPath="$PROJECT_DIR$/core-velocity-impl/build.gradle.kts" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/gradle/libs.versions.toml" beforeDir="false" afterPath="$PROJECT_DIR$/gradle/libs.versions.toml" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|
@ -51,58 +42,7 @@
|
||||||
</task>
|
</task>
|
||||||
<projects_view>
|
<projects_view>
|
||||||
<tree_state>
|
<tree_state>
|
||||||
<expand>
|
<expand />
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
<item name="core" type="2d1252cf:ModuleNode" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
<item name="core" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="Tasks" type="e4a08cd1:TasksNode" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
<item name="core" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="Tasks" type="e4a08cd1:TasksNode" />
|
|
||||||
<item name="build" type="c8890929:TasksNode$1" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
<item name="core" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="Tasks" type="e4a08cd1:TasksNode" />
|
|
||||||
<item name="publishing" type="c8890929:TasksNode$1" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
<item name="core" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="core-velocity-impl" type="2d1252cf:ModuleNode" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
<item name="core" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="core-velocity-impl" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="Tasks" type="e4a08cd1:TasksNode" />
|
|
||||||
</path>
|
|
||||||
<path>
|
|
||||||
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
|
|
||||||
<item name="core" type="f1a62948:ProjectNode" />
|
|
||||||
<item name="core" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="core-velocity-impl" type="2d1252cf:ModuleNode" />
|
|
||||||
<item name="Tasks" type="e4a08cd1:TasksNode" />
|
|
||||||
<item name="build" type="c8890929:TasksNode$1" />
|
|
||||||
</path>
|
|
||||||
</expand>
|
|
||||||
<select />
|
<select />
|
||||||
</tree_state>
|
</tree_state>
|
||||||
</projects_view>
|
</projects_view>
|
||||||
|
|
@ -128,6 +68,10 @@
|
||||||
<component name="HighlightingSettingsPerFile">
|
<component name="HighlightingSettingsPerFile">
|
||||||
<setting file="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.projectreactor/reactor-core/3.8.5/ed6c3f423d84bf282e50a4f7432a8d65af321efb/reactor-core-3.8.5-sources.jar!/reactor/core/publisher/Mono.java" root0="SKIP_INSPECTION" />
|
<setting file="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.projectreactor/reactor-core/3.8.5/ed6c3f423d84bf282e50a4f7432a8d65af321efb/reactor-core-3.8.5-sources.jar!/reactor/core/publisher/Mono.java" root0="SKIP_INSPECTION" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="McpProjectServerCommands">
|
||||||
|
<commands />
|
||||||
|
<urls />
|
||||||
|
</component>
|
||||||
<component name="ProblemsViewState">
|
<component name="ProblemsViewState">
|
||||||
<option name="autoscrollToSource" value="true" />
|
<option name="autoscrollToSource" value="true" />
|
||||||
</component>
|
</component>
|
||||||
|
|
@ -165,16 +109,20 @@
|
||||||
"Gradle.core:core-velocity-impl [clean].executor": "Run",
|
"Gradle.core:core-velocity-impl [clean].executor": "Run",
|
||||||
"Gradle.core:core-velocity-impl [shadowJar].executor": "Run",
|
"Gradle.core:core-velocity-impl [shadowJar].executor": "Run",
|
||||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||||
|
"RunOnceActivity.MCP Project settings loaded": "true",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
|
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
|
||||||
"git-widget-placeholder": "master",
|
"git-widget-placeholder": "master",
|
||||||
|
"junie.onboarding.icon.badge.shown": "true",
|
||||||
"kotlin-language-version-configured": "true",
|
"kotlin-language-version-configured": "true",
|
||||||
"last_opened_file_path": "/home/a/src/scrow/core",
|
"last_opened_file_path": "/Users/leonidazgihin/IdeaProjects/core",
|
||||||
"project.structure.last.edited": "Modules",
|
"project.structure.last.edited": "Modules",
|
||||||
"project.structure.proportion": "0.15",
|
"project.structure.proportion": "0.15",
|
||||||
"project.structure.side.proportion": "0.6268199",
|
"project.structure.side.proportion": "0.6268199",
|
||||||
"settings.editor.selected.configurable": "preferences.pluginManager"
|
"settings.editor.selected.configurable": "reference.settingsdialog.project.gradle",
|
||||||
|
"to.speed.mode.migration.done": "true"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}]]></component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
|
|
@ -226,8 +174,11 @@
|
||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="core [a]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
<configuration name="core [a]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
||||||
|
|
@ -248,8 +199,11 @@
|
||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="core [buildEnvironment]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
<configuration name="core [buildEnvironment]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
||||||
|
|
@ -270,8 +224,11 @@
|
||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="core [build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
<configuration name="core [build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
||||||
|
|
@ -292,8 +249,11 @@
|
||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration name="core [publish]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
<configuration name="core [publish]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
|
||||||
|
|
@ -314,8 +274,11 @@
|
||||||
</ExternalSystemSettings>
|
</ExternalSystemSettings>
|
||||||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
|
||||||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
|
||||||
|
<ExternalSystemDebugDisabled>false</ExternalSystemDebugDisabled>
|
||||||
<DebugAllEnabled>false</DebugAllEnabled>
|
<DebugAllEnabled>false</DebugAllEnabled>
|
||||||
<RunAsTest>false</RunAsTest>
|
<RunAsTest>false</RunAsTest>
|
||||||
|
<GradleProfilingDisabled>false</GradleProfilingDisabled>
|
||||||
|
<GradleCoverageDisabled>false</GradleCoverageDisabled>
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="JetRunConfigurationType">
|
<configuration default="true" type="JetRunConfigurationType">
|
||||||
|
|
@ -324,11 +287,6 @@
|
||||||
<option name="Make" enabled="true" />
|
<option name="Make" enabled="true" />
|
||||||
</method>
|
</method>
|
||||||
</configuration>
|
</configuration>
|
||||||
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
|
|
||||||
<module name="core" />
|
|
||||||
<option name="filePath" />
|
|
||||||
<method v="2" />
|
|
||||||
</configuration>
|
|
||||||
<recent_temporary>
|
<recent_temporary>
|
||||||
<list>
|
<list>
|
||||||
<item itemvalue="Gradle.core [publish]" />
|
<item itemvalue="Gradle.core [publish]" />
|
||||||
|
|
@ -339,6 +297,13 @@
|
||||||
</list>
|
</list>
|
||||||
</recent_temporary>
|
</recent_temporary>
|
||||||
</component>
|
</component>
|
||||||
|
<component name="SharedIndexes">
|
||||||
|
<attachedChunks>
|
||||||
|
<set>
|
||||||
|
<option value="bundled-jdk-30f59d01ecdd-2fc7cc6b9a17-intellij.indexing.shared.core-IU-253.31033.145" />
|
||||||
|
</set>
|
||||||
|
</attachedChunks>
|
||||||
|
</component>
|
||||||
<component name="TaskManager">
|
<component name="TaskManager">
|
||||||
<task active="true" id="Default" summary="Default task">
|
<task active="true" id="Default" summary="Default task">
|
||||||
<changelist id="56c685a1-f609-4ffd-a951-849beb2a7f8d" name="Changes" comment="" />
|
<changelist id="56c685a1-f609-4ffd-a951-849beb2a7f8d" name="Changes" comment="" />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
package de.kentoj.scrow.bukkit.listener;
|
||||||
|
|
||||||
|
import io.papermc.paper.event.player.AsyncChatEvent;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
|
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
|
public class ChatFormatEvent implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onChat(AsyncChatEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
Component formattedMessage = formatMessage(player, event.message());
|
||||||
|
|
||||||
|
event.renderer((source, sourceDisplayName, message, viewer) -> formattedMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Component formatMessage(Player player, Component message) {
|
||||||
|
String messageText = PlainTextComponentSerializer.plainText().serialize(message);
|
||||||
|
String playerName = player.getName();
|
||||||
|
|
||||||
|
// EDIT THIS TO CHANGE FORMAT!
|
||||||
|
String FORMAT = "<gray>{player}</gray>: <white>{message}";
|
||||||
|
|
||||||
|
return MiniMessage.miniMessage().deserialize(FORMAT
|
||||||
|
.replace("{player}", playerName)
|
||||||
|
.replace("{message}", messageText));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue