Skip to content

Commit

Permalink
Updated ChatColorHandler to 4.0.0 (#171)
Browse files Browse the repository at this point in the history
* Updated ChatColorHandler to v2.5.2

* Updated ChatColorHandler to v2.5.3

* Updated ChatColorHandler to 4.0.0
  • Loading branch information
OakLoaf authored Sep 26, 2024
1 parent 18d6710 commit e705aca
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 38 deletions.
4 changes: 2 additions & 2 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ dependencies {
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("de.oliver.FancyAnalytics:logger:${findProperty("fancyLoggerVersion")}")

implementation("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
implementation("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}

tasks {
shadowJar {
archiveClassifier.set("")

relocate("me.dave.chatcolorhandler", "de.oliver.fancynpcs.libs.chatcolorhandler")
relocate("org.lushplugins.chatcolorhandler", "de.oliver.fancynpcs.libs.chatcolorhandler")
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import de.oliver.fancynpcs.api.FancyNpcsPlugin;
import de.oliver.fancynpcs.api.actions.NpcAction;
import de.oliver.fancynpcs.api.actions.executor.ActionExecutionContext;
import me.dave.chatcolorhandler.ChatColorHandler;
import me.dave.chatcolorhandler.parsers.custom.PlaceholderAPIParser;
import org.lushplugins.chatcolorhandler.ChatColorHandler;
import org.lushplugins.chatcolorhandler.parsers.ParserTypes;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
* Represents a console command action that can be executed for an NPC.
*/
Expand All @@ -35,7 +33,7 @@ public void execute(@NotNull ActionExecutionContext context, String value) {
command = value.replace("{player}", context.getPlayer().getName());
}

String finalCommand = ChatColorHandler.translate(command, context.getPlayer(), List.of(PlaceholderAPIParser.class));
String finalCommand = ChatColorHandler.translate(command, context.getPlayer(), ParserTypes.placeholder());

FancyNpcsPlugin.get().getScheduler().runTask(null, () -> {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import de.oliver.fancynpcs.api.actions.NpcAction;
import de.oliver.fancynpcs.api.actions.executor.ActionExecutionContext;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import org.jetbrains.annotations.NotNull;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
import de.oliver.fancynpcs.api.FancyNpcsPlugin;
import de.oliver.fancynpcs.api.actions.NpcAction;
import de.oliver.fancynpcs.api.actions.executor.ActionExecutionContext;
import me.dave.chatcolorhandler.ChatColorHandler;
import me.dave.chatcolorhandler.parsers.custom.PlaceholderAPIParser;
import org.lushplugins.chatcolorhandler.ChatColorHandler;
import org.lushplugins.chatcolorhandler.parsers.ParserTypes;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
* Represents a player command action that can be executed when triggered by an NPC interaction.
*/
Expand All @@ -33,7 +31,7 @@ public void execute(@NotNull ActionExecutionContext context, String value) {
return;
}

String command = ChatColorHandler.translate(value, context.getPlayer(), List.of(PlaceholderAPIParser.class));
String command = ChatColorHandler.translate(value, context.getPlayer(), ParserTypes.placeholder());

if (command.toLowerCase().startsWith("server")) {
String[] args = value.split(" ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
import de.oliver.fancynpcs.api.FancyNpcsPlugin;
import de.oliver.fancynpcs.api.actions.NpcAction;
import de.oliver.fancynpcs.api.actions.executor.ActionExecutionContext;
import me.dave.chatcolorhandler.ChatColorHandler;
import me.dave.chatcolorhandler.parsers.custom.PlaceholderAPIParser;
import org.lushplugins.chatcolorhandler.ChatColorHandler;
import org.lushplugins.chatcolorhandler.parsers.ParserTypes;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
* PlayerCommandAsOpAction is a npc action that allows a player to execute a command as an operator when triggered by an NPC interaction.
*/
Expand All @@ -33,7 +31,7 @@ public void execute(@NotNull ActionExecutionContext context, String value) {
return;
}

String command = ChatColorHandler.translate(value, context.getPlayer(), List.of(PlaceholderAPIParser.class));
String command = ChatColorHandler.translate(value, context.getPlayer(), ParserTypes.placeholder());

if (command.toLowerCase().startsWith("server")) {
String[] args = value.split(" ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import com.google.gson.JsonParser;
import de.oliver.fancylib.UUIDFetcher;
import de.oliver.fancynpcs.api.FancyNpcsPlugin;
import me.dave.chatcolorhandler.ChatColorHandler;
import me.dave.chatcolorhandler.parsers.custom.PlaceholderAPIParser;
import org.lushplugins.chatcolorhandler.ChatColorHandler;
import org.lushplugins.chatcolorhandler.parsers.ParserTypes;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.ApiStatus;
Expand Down Expand Up @@ -37,7 +37,7 @@ private SkinFetcher() {
*/
public static CompletableFuture<SkinData> fetchSkin(String identifier) {
return CompletableFuture.supplyAsync(() -> {
String parsedIdentifier = ChatColorHandler.translate(identifier, List.of(PlaceholderAPIParser.class));
String parsedIdentifier = ChatColorHandler.translate(identifier, ParserTypes.placeholder());

// try to get skin from cache
if (skinCache.containsKey(parsedIdentifier)) {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ allprojects {
mavenCentral()
maven(url = "https://repo.papermc.io/repository/maven-public/")
maven(url = "https://repo.fancyplugins.de/releases")
maven(url = "https://repo.smrt-1.com/releases")
maven(url = "https://repo.lushplugins.org/releases")
}
}

Expand All @@ -46,7 +46,7 @@ dependencies {
implementation(project(":implementation_1_19_4", configuration = "reobf"))

implementation("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
implementation("de.oliver.FancyAnalytics:api:${findProperty("fancyAnalyticsVersion")}")
implementation("de.oliver.FancyAnalytics:logger:${findProperty("fancyLoggerVersion")}")
implementation("org.incendo:cloud-core:${findProperty("cloudCoreVersion")}")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fancyLibVersion=1.0.31
fancyAnalyticsVersion=0.0.8
fancyLoggerVersion=0.0.5
plotsquaredVersion=7.2.0
chatcolorhandlerVersion=v2.5.3
chatcolorhandlerVersion=4.0.0
cloudCoreVersion=2.0.0-rc.2
cloudPaperVersion=2.0.0-beta.8
cloudAnnotationsVersion=2.0.0-rc.2
2 changes: 1 addition & 1 deletion implementation_1_19_4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

compileOnly(project(":api"))
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import de.oliver.fancynpcs.api.utils.NpcEquipmentSlot;
import io.papermc.paper.adventure.PaperAdventure;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.game.*;
Expand Down
2 changes: 1 addition & 1 deletion implementation_1_20/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

compileOnly(project(":api"))
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}


Expand Down
2 changes: 1 addition & 1 deletion implementation_1_20_1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

compileOnly(project(":api"))
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import de.oliver.fancynpcs.api.utils.NpcEquipmentSlot;
import io.papermc.paper.adventure.PaperAdventure;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import net.minecraft.Optionull;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
Expand Down
2 changes: 1 addition & 1 deletion implementation_1_20_2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

compileOnly(project(":api"))
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import de.oliver.fancynpcs.api.utils.NpcEquipmentSlot;
import io.papermc.paper.adventure.PaperAdventure;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import net.minecraft.Optionull;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
Expand Down
2 changes: 1 addition & 1 deletion implementation_1_20_4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

compileOnly(project(":api"))
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import de.oliver.fancynpcs.api.utils.NpcEquipmentSlot;
import io.papermc.paper.adventure.PaperAdventure;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import net.minecraft.Optionull;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
Expand Down
2 changes: 1 addition & 1 deletion implementation_1_20_6/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {

compileOnly(project(":api"))
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import de.oliver.fancynpcs.api.events.NpcSpawnEvent;
import de.oliver.fancynpcs.api.utils.NpcEquipmentSlot;
import io.papermc.paper.adventure.PaperAdventure;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import net.minecraft.Optionull;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
Expand Down
2 changes: 1 addition & 1 deletion implementation_1_21_1/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {

compileOnly(project(":api"))
compileOnly("de.oliver:FancyLib:${findProperty("fancyLibVersion")}")
compileOnly("me.dave:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
compileOnly("org.lushplugins:ChatColorHandler:${findProperty("chatcolorhandlerVersion")}")
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import de.oliver.fancynpcs.api.events.NpcSpawnEvent;
import de.oliver.fancynpcs.api.utils.NpcEquipmentSlot;
import io.papermc.paper.adventure.PaperAdventure;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import net.minecraft.Optionull;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.BuiltInRegistries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import de.oliver.fancynpcs.FancyNpcs;
import de.oliver.fancynpcs.api.Npc;
import de.oliver.fancynpcs.api.events.NpcModifyEvent;
import me.dave.chatcolorhandler.ModernChatColorHandler;
import org.lushplugins.chatcolorhandler.ModernChatColorHandler;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentIteratorType;
import net.kyori.adventure.text.event.ClickEvent;
Expand Down

0 comments on commit e705aca

Please sign in to comment.