-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added support for using legacy (&X) codes in chat (they are converted internally to tags). It's toggled off by default - You can now change which formatting is available for players by default
- Loading branch information
Showing
7 changed files
with
63 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 25 additions & 1 deletion
26
src/main/java/eu/pb4/styledchat/config/data/ConfigData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
package eu.pb4.styledchat.config.data; | ||
|
||
import eu.pb4.placeholders.TextParser; | ||
import eu.pb4.styledchat.config.ConfigManager; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class ConfigData { | ||
public int CONFIG_VERSION_DONT_TOUCH_THIS = 1; | ||
public int CONFIG_VERSION_DONT_TOUCH_THIS = ConfigManager.VERSION; | ||
public String _comment = "Before changing anything, see https://github.com/Patbox/StyledChat#configuration"; | ||
public ChatStyleData defaultStyle = ChatStyleData.getDefault(); | ||
public HashMap<String, ChatStyleData> permissionStyles = new HashMap<>(); | ||
public boolean legacyChatFormatting = false; | ||
public HashMap<String, Boolean> defaultEnabledFormatting = getDefaultFormatting(); | ||
|
||
|
||
private static HashMap<String, Boolean> getDefaultFormatting() { | ||
HashMap<String, Boolean> map = new HashMap<>(); | ||
for (String string : TextParser.getRegisteredTags().keySet()) { | ||
map.put(string, false); | ||
} | ||
map.put("item", true); | ||
return map; | ||
} | ||
|
||
public static ConfigData transform(ConfigData configData) { | ||
for (Map.Entry<String, Boolean> entry : getDefaultFormatting().entrySet()) { | ||
configData.defaultEnabledFormatting.putIfAbsent(entry.getKey(), entry.getValue()); | ||
} | ||
return configData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters