Skip to content

Commit 83808a1

Browse files
committed
Merge branch 'refs/heads/master' into potential-message-fix
2 parents 5c2b6e5 + db99836 commit 83808a1

34 files changed

Lines changed: 325 additions & 445 deletions

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
java-version: '17'
2323
distribution: 'temurin'
2424
- name: Cache Gradle
25-
uses: actions/cache@v4.2.2
25+
uses: actions/cache@v4.2.3
2626
with:
2727
path: ~/.gradle/caches
2828
key: >-
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
arguments: shadowAll
3838
- name: Upload a ChatFormatter Artifact
39-
uses: actions/upload-artifact@v4.6.1
39+
uses: actions/upload-artifact@v4.6.2
4040
with:
4141
name: 'Successfully build ChatFormatter'
4242
path: build/libs/ChatFormatter v*.jar

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
*.iws
55
.idea/
66
.gradle/
7-
out/
87
build/
9-
node_modules/
108
dist/
119
run/
10+
.kotlin
1211

1312
.DS_Store
1413
[Dd]esktop.ini

README.md

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,46 +34,51 @@
3434

3535
## 🔑 Permissions:
3636

37-
| **Permission** | **Access** |
38-
|:------------------------------------------|:------------------------------------------------------------------------|
39-
| `chatformatter.decorations.*` | `<bold>`, `<italic>`, `<underlined>`, `<strikethrough>`, `<obfuscated>` |
40-
| `chatformatter.decorations.bold` | `<bold>` |
41-
| `chatformatter.decorations.italic` | `<italic>` |
42-
| `chatformatter.decorations.underlined` | `<underlined>` |
43-
| `chatformatter.decorations.strikethrough` | `<strikethrough>` |
44-
| `chatformatter.decorations.obfuscated` | `<obfuscated>` |
45-
| `chatformatter.reset` | `<reset>` |
46-
| `chatformatter.gradient` | `<gradient>` |
47-
| `chatformatter.hover` | `<hover>` |
48-
| `chatformatter.click` | `<click>` |
49-
| `chatformatter.insertion` | `<insertion>` |
50-
| `chatformatter.font` | `<font>` |
51-
| `chatformatter.transition` | `<transition>` |
52-
| `chatformatter.translatable` | `<lang>` |
53-
| `chatformatter.selector` | `<selector>` |
54-
| `chatformatter.keybind` | `<key>` |
55-
| `chatformatter.newline` | `<newline>` |
56-
| `chatformatter.rainbow` | `<rainbow>` |
57-
| `chatformatter.color.*` | `<red>`, `<blue>`, etc. |
58-
| `chatformatter.legacycolor` | `&c`, `&4`, `&l`, etc. |
59-
| `chatformatter.color.black` | `<black>` |
60-
| `chatformatter.color.dark_blue` | `<dark_blue>` |
61-
| `chatformatter.color.dark_green` | `<dark_green>` |
62-
| `chatformatter.color.dark_aqua` | `<dark_aqua>` |
63-
| `chatformatter.color.dark_red` | `<dark_red>` |
64-
| `chatformatter.color.dark_purple` | `<dark_purple>` |
65-
| `chatformatter.color.gold` | `<gold>` |
66-
| `chatformatter.color.gray` | `<gray>` |
67-
| `chatformatter.color.dark_gray` | `<dark_gray>` |
68-
| `chatformatter.color.blue` | `<blue>` |
69-
| `chatformatter.color.green` | `<green>` |
70-
| `chatformatter.color.aqua` | `<aqua>` |
71-
| `chatformatter.color.red` | `<red>` |
72-
| `chatformatter.color.light_purple` | `<light_purple>` |
73-
| `chatformatter.color.yellow` | `<yellow>` |
74-
| `chatformatter.color.white` | `<white>` |
75-
| `chatformatter.reload` | `/chatformatter reload` |
76-
| `chatformatter.receiveupdates` | receive update announcements for this plugin |
37+
> **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>`).
38+
39+
| **Permission** | **Access** |
40+
|:------------------------------------------|:------------------------------------------------------------------------------------------------------|
41+
| `chatformatter.decorations.*` | `<bold>`, `<italic>`, `<underlined>`, `<strikethrough>`, `<obfuscated>`, `&l`, `&o`, `&n`, `&m`, `&k` |
42+
| `chatformatter.decorations.bold` | `<bold>`, `<b>`, `&l` |
43+
| `chatformatter.decorations.italic` | `<italic>`, `<i>`, `<em>`, `&o` |
44+
| `chatformatter.decorations.underlined` | `<underlined>`, `&n` |
45+
| `chatformatter.decorations.strikethrough` | `<strikethrough>`, `<st>`, `&m` |
46+
| `chatformatter.decorations.obfuscated` | `<obfuscated>`, `<obf>`, `&k` |
47+
| `chatformatter.reset` | `<reset>`, `&r` |
48+
| `chatformatter.newline` | `<newline>`, `<br>` |
49+
| `chatformatter.shadow` | `<shadow>`, |
50+
| `chatformatter.gradient` | `<gradient>` |
51+
| `chatformatter.rainbow` | `<rainbow>` |
52+
| `chatformatter.pride` | `<pride>` |
53+
| `chatformatter.transition` | `<transition>` |
54+
| `chatformatter.hover` | `<hover>` |
55+
| `chatformatter.click` | `<click>` |
56+
| `chatformatter.insertion` | `<insertion>` |
57+
| `chatformatter.color.*` | All color codes: `<red>`, `<blue>`, `<#a568a9>`, `&c`, `&#a568a9`, etc. |
58+
| `chatformatter.color.black` | `<black>`, `&0` |
59+
| `chatformatter.color.dark_blue` | `<dark_blue>`, `&1` |
60+
| `chatformatter.color.dark_green` | `<dark_green>`, `&2` |
61+
| `chatformatter.color.dark_aqua` | `<dark_aqua>`, `&3` |
62+
| `chatformatter.color.dark_red` | `<dark_red>`, `&4` |
63+
| `chatformatter.color.dark_purple` | `<dark_purple>`, `&5` |
64+
| `chatformatter.color.gold` | `<gold>`, `&6` |
65+
| `chatformatter.color.gray` | `<gray>`, `&7` |
66+
| `chatformatter.color.dark_gray` | `<dark_gray>`, `&8` |
67+
| `chatformatter.color.blue` | `<blue>`, `&9` |
68+
| `chatformatter.color.green` | `<green>`, `&a` |
69+
| `chatformatter.color.aqua` | `<aqua>`, `&b` |
70+
| `chatformatter.color.red` | `<red>`, `&c` |
71+
| `chatformatter.color.light_purple` | `<light_purple>`, `&d` |
72+
| `chatformatter.color.yellow` | `<yellow>`, `&e` |
73+
| `chatformatter.color.white` | `<white>`, `&f` |
74+
| `chatformatter.score` | `<score>` |
75+
| `chatformatter.selector` | `<selector>` |
76+
| `chatformatter.font` | `<font>` |
77+
| `chatformatter.translatable` | `<lang>` |
78+
| `chatformatter.keybind` | `<key>` |
79+
| `chatformatter.nbt` | `<nbt>` |
80+
| `chatformatter.reload` | `/chatformatter reload` |
81+
| `chatformatter.receiveupdates` | receive update announcements for this plugin |
7782

7883
### config.yml
7984

build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,8 @@ tasks.runServer {
8888
minecraftVersion("1.21.4")
8989
dependsOn("shadowAll")
9090
pluginJars = files("/build/libs/ChatFormatter v${project.version}.jar")
91+
// We need to start the server with Java 21, but jar is built with Java 17
92+
javaLauncher.set(javaToolchains.launcherFor {
93+
languageVersion.set(JavaLanguageVersion.of(21))
94+
})
9195
}

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88
}
99

1010
dependencies {
11-
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10")
11+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.21")
1212
implementation("com.github.johnrengelman:shadow:8.1.1")
1313
implementation("net.minecrell:plugin-yml:0.6.0")
1414
}

buildSrc/src/main/kotlin/eternalcode.java.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
group = "com.eternalcode"
6-
version = "1.2.1"
6+
version = "1.3.2"
77

88
repositories {
99
mavenCentral()
@@ -13,6 +13,7 @@ repositories {
1313
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }
1414
maven { url = uri("https://jitpack.io") }
1515
maven { url = uri("https://repo.eternalcode.pl/releases") }
16+
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/")
1617
}
1718

1819
java {

chatformatter-core/build.gradle.kts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ dependencies {
1010
testImplementation("org.spigotmc:spigot-api:$spigotApiVersion")
1111

1212
// Kyori Adventure & MiniMessage
13-
val adventureVersion = "4.3.4"
14-
val miniMessageVersion = "4.19.0"
15-
implementation("net.kyori:adventure-platform-bukkit:$adventureVersion")
13+
val adventureVersion = "4.4.1-SNAPSHOT"
14+
val miniMessageVersion = "4.23.0"
15+
implementation("net.kyori:adventure-api:$miniMessageVersion")
1616
implementation("net.kyori:adventure-text-minimessage:$miniMessageVersion")
17+
implementation("net.kyori:adventure-platform-bukkit:$adventureVersion")
1718
testImplementation("net.kyori:adventure-platform-bukkit:$adventureVersion")
1819
testImplementation("net.kyori:adventure-text-minimessage:$miniMessageVersion")
1920

2021
// CDN Configs
21-
val cdnVersion = "1.14.6"
22+
val cdnVersion = "1.14.9"
2223
implementation("net.dzikoysk:cdn:$cdnVersion")
2324
testImplementation("net.dzikoysk:cdn:$cdnVersion")
2425

@@ -33,11 +34,14 @@ dependencies {
3334
implementation("com.eternalcode:gitcheck:1.0.0")
3435

3536
// JUnit 5
36-
testImplementation("org.junit.jupiter:junit-jupiter-api:5.12.0")
37-
testImplementation("org.junit.jupiter:junit-jupiter-params:5.12.0")
38-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.12.0")
39-
testImplementation("org.mockito:mockito-core:5.16.0")
40-
testImplementation("org.mockito:mockito-junit-jupiter:5.16.0")
37+
testImplementation(platform("org.junit:junit-bom:5.13.3"))
38+
testImplementation("org.junit.jupiter:junit-jupiter-api")
39+
testImplementation("org.junit.jupiter:junit-jupiter-params")
40+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
41+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
42+
43+
testImplementation("org.mockito:mockito-core:5.18.0")
44+
testImplementation("org.mockito:mockito-junit-jupiter:5.18.0")
4145
testImplementation("me.clip:placeholderapi:2.11.6")
4246
testImplementation("org.assertj:assertj-core:3.27.3")
4347
}

chatformatter-core/src/main/java/com/eternalcode/formatter/ChatFormatterPlugin.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import com.eternalcode.formatter.config.PluginConfig;
55
import com.eternalcode.formatter.legacy.LegacyPostProcessor;
66
import com.eternalcode.formatter.legacy.LegacyPreProcessor;
7-
import com.eternalcode.formatter.placeholder.ConfiguredPlaceholderAPIStack;
8-
import com.eternalcode.formatter.placeholder.PlaceholderAPIStack;
7+
import com.eternalcode.formatter.placeholder.ConfiguredReplacer;
8+
import com.eternalcode.formatter.placeholderapi.PlaceholderAPIInitializer;
99
import com.eternalcode.formatter.placeholder.PlaceholderRegistry;
1010
import com.eternalcode.formatter.rank.ChatRankProvider;
11-
import com.eternalcode.formatter.rank.VaultRankProvider;
11+
import com.eternalcode.formatter.rank.VaultInitializer;
1212
import com.eternalcode.formatter.template.TemplateService;
1313
import com.eternalcode.formatter.updater.UpdaterController;
1414
import com.eternalcode.formatter.updater.UpdaterService;
@@ -19,7 +19,6 @@
1919
import org.bstats.bukkit.Metrics;
2020
import org.bukkit.Server;
2121
import org.bukkit.plugin.Plugin;
22-
import org.bukkit.plugin.java.JavaPlugin;
2322

2423
import java.util.concurrent.TimeUnit;
2524

@@ -40,15 +39,11 @@ public ChatFormatterPlugin(Plugin plugin) {
4039
PluginConfig pluginConfig = configManager.getPluginConfig();
4140

4241
this.placeholderRegistry = new PlaceholderRegistry();
43-
44-
PlaceholderAPIStack placeholderAPIStack = new PlaceholderAPIStack();
45-
this.placeholderRegistry.playerStack(new ConfiguredPlaceholderAPIStack(pluginConfig));
46-
this.placeholderRegistry.playerStack(placeholderAPIStack);
47-
this.placeholderRegistry.playerRelationalStack(placeholderAPIStack);
48-
42+
PlaceholderAPIInitializer.initialize(server, this.placeholderRegistry);
43+
this.placeholderRegistry.addReplacer(new ConfiguredReplacer(pluginConfig));
4944

5045
this.templateService = new TemplateService(pluginConfig);
51-
this.rankProvider = new VaultRankProvider(server);
46+
this.rankProvider = VaultInitializer.initialize(server);
5247
UpdaterService updaterService = new UpdaterService(plugin.getDescription());
5348

5449
AudienceProvider audienceProvider = BukkitAudiences.create(plugin);
@@ -58,7 +53,7 @@ public ChatFormatterPlugin(Plugin plugin) {
5853
.build();
5954

6055
// bStats metrics
61-
new Metrics((JavaPlugin) plugin, 15199);
56+
new Metrics(plugin, 15199);
6257

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

0 commit comments

Comments
 (0)