Skip to content

Commit

Permalink
fix hex colors not work in lore
Browse files Browse the repository at this point in the history
  • Loading branch information
NONPLAYT committed Jun 20, 2023
1 parent 6655db2 commit 5a43280
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 74 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h3>Reward players for playing on your server.</h3>

[![License](https://img.shields.io/github/license/BX-Team/NDailyRewards?style=for-the-badge&logo=github)](LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/BX-Team/NDailyRewards/maven.yml?branch=master&style=for-the-badge&logo=GoogleAnalytics&logoColor=ffffff)](https://github.com/BX-Team/NDailyRewards/actions)
[![Build Status](https://img.shields.io/github/actions/workflow/status/BX-Team/NDailyRewards/ci.yml?branch=master&style=for-the-badge&logo=GoogleAnalytics&logoColor=ffffff)](https://github.com/BX-Team/NDailyRewards/actions)
[![Discord](https://img.shields.io/discord/931595732752953375?color=%235865F2&label=Discord&logo=discord&style=for-the-badge&logoColor=ffffff)](https://discord.gg/p7cxhw7E2M)
![MC Version](https://img.shields.io/badge/MC-1.20.1-6047ff?&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAW9yTlQBz6J3mgAAAAFzUkdCAK7OHOkAAAm2SURBVFjDrZd7qOXXVcc/+/F7nHN+53HPvXdmMq8ktaNUWp9UxVZBkIKooShV22goxcFimxDER00h1YoaUPtHTbUhta3VUobSplBrrFRLKlEaJ4/CJJPJzJ3M3Mk87z3nnsfvuX/74R9niGCwNZL97957rc9ee63F+gpe5Xr8xY/Q1f3kpeXWOxtX31N7e0GK5I9+87G/ePrffuGzvOnQna/Knvi/HvyXrb/kJ48cF194/gNv1pL3x1LdsWyroQueWMZnlrb5pBTppwuzd+PuH/lbhBCvDcCjL3yCSfkfBNG/NfjquPHtXZUzR9aSjEhqlFAoIZ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zi1nXP2Uu7DLqrF2zfmBOkomlaqqYlLys6aUI3Tch6KbWPaIyjMavy8z5QNwZrHbWxxtTl6gvS3pDxxr4bXqjfPri59vVjRzZcGmuuT5YUTQuuIVQLducl1nvKpmU87NFNY1rr0FoDkCYxo0HGeNTHuYCtc0yxB0Cvk66iIsQsIB50nk/WrfvvkSyEwFMP3cOiCft2JtNfuj6dv3/76vR7lJR0Ek1ZG4QQJJFmUTYc2FxDDA+ye/lFnj6/g/OBONJEkUZJiRBQlDVKKVprsc61Wbf7j2maPDgab37DNI35zCP/9Mqh9NGHP8xdx+/nzz/4rjdcvjb99TrdvMtMXto4up5iWs+yatidF4yHPUj6bF++zoVJsZoXxKqjhhAIYWVvPBpQNc1TxvoHx2trjyzzfPboN07+77rgZ47fzw5QRhunb/v+t/xu/9Dr3zEc9D6f9dIm68a0zhNrTZZEHM4Cw46mbS3OenwINKZlWdQYEoKQl533fzAcDH+xyWef+uEf/fFXOP+Oyujh3/sVhIwzb/Kfm83zexrT/lgIQYz7HcaDLlf3Cv7hyYuYdlVeSkry2uadjdtOJHb20M+/7a0nnz1zIXz0Uyf+/9Ls1GNf4qEHPsTR224/VOTLX+3E8jdC8Lf30phJYXj8+evUpqWfdV0Sx//auvDRwYFjX3OmqE988UuvnTj9mz+8h8N3fJjLJ977A3VVHp/Ni3dO8mbt1OU5URyfWhsOPu48J4xpdj//1cdfO3H6P9cn7ns34/EoPvnkMz97aXd577wV54JQH/ny17/57Mf+5IO8774/flX2/gtnEWFB1FDO/wAAAABJRU5ErkJggg==&style=for-the-badge&logoColor=ffffff)
</div>
Expand Down Expand Up @@ -55,7 +55,7 @@ View plugin metrics at [bStats.org](https://bstats.org/plugin/bukkit/NDailyRewar
You can download plugin from [releases tab](https://github.com/BX-Team/NDailyRewards/releases/latest) or also from:
- [Modrinth](https://modrinth.com/plugin/ndailyrewards) (fast updates (recommended))

### 👩‍💻 For developers
### 👩‍💻 For developers (outdated)
If you want to download and use NDailyRewards in your project, get it on maven and import to `pom.xml` like this:

```xml
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = gq.bxteam

mcVersion = 1.20-R0.1-SNAPSHOT
version = 2.0
version = 2.0.1

org.gradle.parallel = true
org.gradle.vfs.watch = false
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/gq/bxteam/ndailyrewards/cfg/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ public static void setup(final MyConfig mc) {
}
LogUtil.send("&eLoaded &6" + Config.rewards.size() + " &edaily rewards!", LogType.INFO);
path = "gui.";
String p_title = NDailyRewards.replaceHEXColorCode(cfg.getString(path + "title"));
String g_title = ChatColor.translateAlternateColorCodes('&', p_title);
String g_title = NDailyRewards.replaceHEXColorCode(cfg.getString(path + "title"));
final int g_size = cfg.getInt(path + "size");
final LinkedHashMap<String, GUIItem> g_items = new LinkedHashMap<String, GUIItem>();
for (final String id : cfg.getSection(path + "items")) {
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/gq/bxteam/ndailyrewards/cfg/Lang.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.List;

import gq.bxteam.ndailyrewards.NDailyRewards;
import org.bukkit.ChatColor;

@SuppressWarnings("javadoc")
public enum Lang {
Expand Down Expand Up @@ -37,20 +36,19 @@ public String getMsg() {
}

public String toMsg() {
String pref = NDailyRewards.replaceHEXColorCode(Lang.config.getConfig().getString(this.getPath()));
return pref;
return NDailyRewards.replaceHEXColorCode(Lang.config.getConfig().getString(this.getPath()));
}

public List<String> getList() {
final List<String> list = new ArrayList<String>();
final List<String> list = new ArrayList<>();
for (final String s : Lang.config.getConfig().getStringList(this.getPath())) {
list.add(ChatColor.translateAlternateColorCodes('&', s));
list.add(NDailyRewards.replaceHEXColorCode(s));
}
return list;
}

public static String getCustom(final String path) {
return ChatColor.translateAlternateColorCodes('&', Lang.config.getConfig().getString(path));
return NDailyRewards.replaceHEXColorCode(Lang.config.getConfig().getString(path));
}

public static void setup(final MyConfig config) {
Expand All @@ -64,7 +62,7 @@ private static void load() {
final Lang lang = values[i];
if (Lang.config.getConfig().getString(lang.getPath()) == null) {
if (lang.getMsg().contains("\n")) {
final List<String> list = new ArrayList<String>();
final List<String> list = new ArrayList<>();
final String[] ss = lang.getMsg().split("\n");
String[] array;
for (int length2 = (array = ss).length, j = 0; j < length2; ++j) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void replaceLore(final ItemStack icon, final int day2, final DUser user,
}
if (s.equalsIgnoreCase("%reward-lore%")) {
for (final String s2 : rewa.getLore()) {
lore.add(ChatColor.translateAlternateColorCodes('&', s2.replace("%day%", String.valueOf(day2))));
lore.add(NDailyRewards.replaceHEXColorCode(s2.replace("%day%", String.valueOf(day2))));
}
} else {
String pref = NDailyRewards.replaceHEXColorCode(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void give(final Player p) {
for (final String s : this.cmds) {
ArchUtils.execCmd(s.replace("%day%", String.valueOf(this.day)), p);
}
for (String s : this.msg) {
for (final String s : this.msg) {
String pref = NDailyRewards.replaceHEXColorCode(s);
p.sendMessage(pref.replace("%day%", String.valueOf(this.day)));
}
Expand Down

0 comments on commit 5a43280

Please sign in to comment.