mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 18:46:15 +00:00
refactor: change custom chat default format (not tested but should work)
This commit is contained in:
parent
2f7b1268c6
commit
117f52583b
1 changed files with 31 additions and 4 deletions
|
|
@ -1,6 +1,9 @@
|
|||
package land.chipmunk.chipmunkmod.config;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.event.ClickEvent;
|
||||
import net.kyori.adventure.text.event.HoverEvent;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
@ -77,9 +80,33 @@ public class Configuration {
|
|||
@ConfigSerializable
|
||||
public static class CustomChat {
|
||||
public @NotNull Component format =
|
||||
Component.translatable("chat.type.text",
|
||||
Component.selector("@s"),
|
||||
Component.text("MESSAGE")
|
||||
);
|
||||
// chipmunk's custom chat format
|
||||
// §8[§7Chat§8] §aUSERNAME§8 › §7MESSAGE
|
||||
// but with `Chat` replaced with `ChipmunkMod`
|
||||
// and click events and hover events added
|
||||
Component
|
||||
.translatable("[%s] %s › %s", NamedTextColor.DARK_GRAY,
|
||||
Component.text("ChipmunkMod", NamedTextColor.GREEN)
|
||||
.hoverEvent(
|
||||
HoverEvent.showText(
|
||||
Component.text(
|
||||
"Click here to open the ChipmunkMod source code (chayapak's fork)",
|
||||
NamedTextColor.GREEN
|
||||
)
|
||||
)
|
||||
)
|
||||
.clickEvent(ClickEvent.openUrl("https://code.chipmunk.land/ChomeNS/chipmunkmod")),
|
||||
Component.selector("@s").color(NamedTextColor.GREEN),
|
||||
Component.text("MESSAGE", NamedTextColor.GRAY)
|
||||
.hoverEvent(
|
||||
HoverEvent.showText(
|
||||
Component.text(
|
||||
"Click here to copy the message to your clipboard",
|
||||
NamedTextColor.GREEN
|
||||
)
|
||||
)
|
||||
)
|
||||
.clickEvent(ClickEvent.copyToClipboard("MESSAGE"))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue