Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*.iws
.idea/
.gradle/
out/
build/
node_modules/
dist/
run/
.kotlin

.DS_Store
[Dd]esktop.ini
Expand Down
85 changes: 45 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,46 +34,51 @@

## 🔑 Permissions:

| **Permission** | **Access** |
|:------------------------------------------|:------------------------------------------------------------------------|
| `chatformatter.decorations.*` | `<bold>`, `<italic>`, `<underlined>`, `<strikethrough>`, `<obfuscated>` |
| `chatformatter.decorations.bold` | `<bold>` |
| `chatformatter.decorations.italic` | `<italic>` |
| `chatformatter.decorations.underlined` | `<underlined>` |
| `chatformatter.decorations.strikethrough` | `<strikethrough>` |
| `chatformatter.decorations.obfuscated` | `<obfuscated>` |
| `chatformatter.reset` | `<reset>` |
| `chatformatter.gradient` | `<gradient>` |
| `chatformatter.hover` | `<hover>` |
| `chatformatter.click` | `<click>` |
| `chatformatter.insertion` | `<insertion>` |
| `chatformatter.font` | `<font>` |
| `chatformatter.transition` | `<transition>` |
| `chatformatter.translatable` | `<lang>` |
| `chatformatter.selector` | `<selector>` |
| `chatformatter.keybind` | `<key>` |
| `chatformatter.newline` | `<newline>` |
| `chatformatter.rainbow` | `<rainbow>` |
| `chatformatter.color.*` | `<red>`, `<blue>`, etc. |
| `chatformatter.legacycolor` | `&c`, `&4`, `&l`, etc. |
| `chatformatter.color.black` | `<black>` |
| `chatformatter.color.dark_blue` | `<dark_blue>` |
| `chatformatter.color.dark_green` | `<dark_green>` |
| `chatformatter.color.dark_aqua` | `<dark_aqua>` |
| `chatformatter.color.dark_red` | `<dark_red>` |
| `chatformatter.color.dark_purple` | `<dark_purple>` |
| `chatformatter.color.gold` | `<gold>` |
| `chatformatter.color.gray` | `<gray>` |
| `chatformatter.color.dark_gray` | `<dark_gray>` |
| `chatformatter.color.blue` | `<blue>` |
| `chatformatter.color.green` | `<green>` |
| `chatformatter.color.aqua` | `<aqua>` |
| `chatformatter.color.red` | `<red>` |
| `chatformatter.color.light_purple` | `<light_purple>` |
| `chatformatter.color.yellow` | `<yellow>` |
| `chatformatter.color.white` | `<white>` |
| `chatformatter.reload` | `/chatformatter reload` |
| `chatformatter.receiveupdates` | receive update announcements for this plugin |
> **Note:** Each color and decoration permission (e.g., `chatformatter.color.white`, `chatformatter.reset`, `chatformatter.decorations.bold`) grants access to both the legacy code (e.g., `&f`, `&r`, `&l`) and the MiniMessage tag (e.g., `<white>`, `<reset>`, `<bold>`).

| **Permission** | **Access** |
|:------------------------------------------|:------------------------------------------------------------------------------------------------------|
| `chatformatter.decorations.*` | `<bold>`, `<italic>`, `<underlined>`, `<strikethrough>`, `<obfuscated>`, `&l`, `&o`, `&n`, `&m`, `&k` |
| `chatformatter.decorations.bold` | `<bold>`, `<b>`, `&l` |
| `chatformatter.decorations.italic` | `<italic>`, `<i>`, `<em>`, `&o` |
| `chatformatter.decorations.underlined` | `<underlined>`, `&n` |
| `chatformatter.decorations.strikethrough` | `<strikethrough>`, `<st>`, `&m` |
| `chatformatter.decorations.obfuscated` | `<obfuscated>`, `<obf>`, `&k` |
| `chatformatter.reset` | `<reset>`, `&r` |
| `chatformatter.newline` | `<newline>`, `<br>` |
| `chatformatter.shadow` | `<shadow>`, |
| `chatformatter.gradient` | `<gradient>` |
| `chatformatter.rainbow` | `<rainbow>` |
| `chatformatter.pride` | `<pride>` |
| `chatformatter.transition` | `<transition>` |
| `chatformatter.hover` | `<hover>` |
| `chatformatter.click` | `<click>` |
| `chatformatter.insertion` | `<insertion>` |
| `chatformatter.color.*` | All color codes: `<red>`, `<blue>`, `<#a568a9>`, `&c`, `&#a568a9`, etc. |
| `chatformatter.color.black` | `<black>`, `&0` |
| `chatformatter.color.dark_blue` | `<dark_blue>`, `&1` |
| `chatformatter.color.dark_green` | `<dark_green>`, `&2` |
| `chatformatter.color.dark_aqua` | `<dark_aqua>`, `&3` |
| `chatformatter.color.dark_red` | `<dark_red>`, `&4` |
| `chatformatter.color.dark_purple` | `<dark_purple>`, `&5` |
| `chatformatter.color.gold` | `<gold>`, `&6` |
| `chatformatter.color.gray` | `<gray>`, `&7` |
| `chatformatter.color.dark_gray` | `<dark_gray>`, `&8` |
| `chatformatter.color.blue` | `<blue>`, `&9` |
| `chatformatter.color.green` | `<green>`, `&a` |
| `chatformatter.color.aqua` | `<aqua>`, `&b` |
| `chatformatter.color.red` | `<red>`, `&c` |
| `chatformatter.color.light_purple` | `<light_purple>`, `&d` |
| `chatformatter.color.yellow` | `<yellow>`, `&e` |
| `chatformatter.color.white` | `<white>`, `&f` |
| `chatformatter.score` | `<score>` |
| `chatformatter.selector` | `<selector>` |
| `chatformatter.font` | `<font>` |
| `chatformatter.translatable` | `<lang>` |
| `chatformatter.keybind` | `<key>` |
| `chatformatter.nbt` | `<nbt>` |
| `chatformatter.reload` | `/chatformatter reload` |
| `chatformatter.receiveupdates` | receive update announcements for this plugin |

### config.yml

Expand Down
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,8 @@ tasks.runServer {
minecraftVersion("1.21.4")
dependsOn("shadowAll")
pluginJars = files("/build/libs/ChatFormatter v${project.version}.jar")
// We need to start the server with Java 21, but jar is built with Java 17
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(21))
})
}
16 changes: 10 additions & 6 deletions chatformatter-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ dependencies {

// Kyori Adventure & MiniMessage
val adventureVersion = "4.4.0"
val miniMessageVersion = "4.21.0"
implementation("net.kyori:adventure-platform-bukkit:$adventureVersion")
val miniMessageVersion = "4.23.0"
implementation("net.kyori:adventure-api:$miniMessageVersion")
implementation("net.kyori:adventure-text-minimessage:$miniMessageVersion")
implementation("net.kyori:adventure-platform-bukkit:$adventureVersion")
testImplementation("net.kyori:adventure-platform-bukkit:$adventureVersion")
testImplementation("net.kyori:adventure-text-minimessage:$miniMessageVersion")

// CDN Configs
val cdnVersion = "1.14.8"
val cdnVersion = "1.14.9"
implementation("net.dzikoysk:cdn:$cdnVersion")
testImplementation("net.dzikoysk:cdn:$cdnVersion")

Expand All @@ -33,9 +34,12 @@ dependencies {
implementation("com.eternalcode:gitcheck:1.0.0")

// JUnit 5
testImplementation("org.junit.jupiter:junit-jupiter-api:5.13.1")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.13.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.13.1")
testImplementation(platform("org.junit:junit-bom:5.13.1"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")

testImplementation("org.mockito:mockito-core:5.18.0")
testImplementation("org.mockito:mockito-junit-jupiter:5.18.0")
testImplementation("me.clip:placeholderapi:2.11.6")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
import com.eternalcode.formatter.config.PluginConfig;
import com.eternalcode.formatter.legacy.LegacyPostProcessor;
import com.eternalcode.formatter.legacy.LegacyPreProcessor;
import com.eternalcode.formatter.placeholder.ConfiguredPlaceholderAPIStack;
import com.eternalcode.formatter.placeholder.PlaceholderAPIStack;
import com.eternalcode.formatter.placeholder.ConfiguredReplacer;
import com.eternalcode.formatter.placeholderapi.PlaceholderAPIInitializer;
import com.eternalcode.formatter.placeholder.PlaceholderRegistry;
import com.eternalcode.formatter.rank.ChatRankProvider;
import com.eternalcode.formatter.rank.VaultRankProvider;
import com.eternalcode.formatter.rank.VaultInitializer;
import com.eternalcode.formatter.template.TemplateService;
import com.eternalcode.formatter.updater.UpdaterController;
import com.eternalcode.formatter.updater.UpdaterService;
import com.google.common.base.Stopwatch;
import net.kyori.adventure.platform.AudienceProvider;
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
import org.bstats.bukkit.Metrics;
import org.bukkit.Server;
import org.bukkit.plugin.Plugin;
Expand All @@ -40,15 +41,11 @@ public ChatFormatterPlugin(Plugin plugin) {
PluginConfig pluginConfig = configManager.getPluginConfig();

this.placeholderRegistry = new PlaceholderRegistry();

PlaceholderAPIStack placeholderAPIStack = new PlaceholderAPIStack();
this.placeholderRegistry.playerStack(new ConfiguredPlaceholderAPIStack(pluginConfig));
this.placeholderRegistry.playerStack(placeholderAPIStack);
this.placeholderRegistry.playerRelationalStack(placeholderAPIStack);

PlaceholderAPIInitializer.initialize(server, this.placeholderRegistry);
this.placeholderRegistry.addReplacer(new ConfiguredReplacer(pluginConfig));

this.templateService = new TemplateService(pluginConfig);
this.rankProvider = new VaultRankProvider(server);
this.rankProvider = VaultInitializer.initialize(server);
UpdaterService updaterService = new UpdaterService(plugin.getDescription());

AudienceProvider audienceProvider = BukkitAudiences.create(plugin);
Expand All @@ -58,7 +55,7 @@ public ChatFormatterPlugin(Plugin plugin) {
.build();

// bStats metrics
new Metrics((JavaPlugin) plugin, 15199);
new Metrics(plugin, 15199);

this.chatHandler = new ChatHandlerImpl(miniMessage, pluginConfig, this.rankProvider, this.placeholderRegistry, this.templateService);

Expand Down
Loading
Loading