Skip to content

Commit 4a391e8

Browse files
committed
fix: correct HTML entity references in JavaDoc comments
1 parent 6e53f7d commit 4a391e8

9 files changed

Lines changed: 106 additions & 151 deletions

File tree

src/main/java/io/github/pluginlangcore/language/LanguageManager.java

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Main language management system for Minecraft plugins.
2222
* <p>
2323
* This class provides comprehensive internationalization (i18n) support with features including:
24+
* </p>
2425
* <ul>
2526
* <li>Multiple language file types (messages, GUI, formatting, items)</li>
2627
* <li>Automatic file creation and merging with defaults</li>
@@ -30,17 +31,11 @@
3031
* <li>Entity and material name formatting</li>
3132
* <li>Number formatting with locale-specific patterns</li>
3233
* </ul>
33-
* </p>
3434
* <p>
3535
* The LanguageManager supports multiple language file types through the {@link LanguageFileType} enum,
3636
* allowing for organized separation of different types of translatable content.
3737
* </p>
38-
*
39-
* @author PluginLangCore Team
40-
* @version 1.0.0
41-
* @since 1.0.0
42-
*
43-
* @example
38+
* <b>Usage Example:</b>
4439
* <pre>{@code
4540
* // Basic initialization
4641
* LanguageManager langManager = new LanguageManager(plugin);
@@ -54,6 +49,10 @@
5449
* // Reload language files
5550
* langManager.reloadLanguages();
5651
* }</pre>
52+
*
53+
* @author PluginLangCore Team
54+
* @version 1.0.0
55+
* @since 1.0.0
5756
*/
5857
public class LanguageManager {
5958
private final JavaPlugin plugin;
@@ -91,15 +90,13 @@ public class LanguageManager {
9190

9291
/**
9392
* Enum representing the different language file types supported by the language manager.
94-
* <p>
9593
* Each file type serves a specific purpose:
9694
* <ul>
9795
* <li><b>MESSAGES</b> - Contains player messages, notifications, and command responses</li>
9896
* <li><b>GUI</b> - Contains GUI titles, item names and lore for inventory interfaces</li>
9997
* <li><b>FORMATTING</b> - Contains formatting rules for numbers, entity names, etc.</li>
10098
* <li><b>ITEMS</b> - Contains vanilla and custom item names and lore</li>
10199
* </ul>
102-
* </p>
103100
*/
104101
@Getter
105102
public enum LanguageFileType {
@@ -132,15 +129,13 @@ public enum LanguageFileType {
132129

133130
/**
134131
* Constructs a LanguageManager with all file types enabled.
135-
* <p>
136132
* This constructor:
137133
* <ul>
138134
* <li>Reads the default locale from plugin config (defaults to "en_US")</li>
139135
* <li>Enables all language file types</li>
140136
* <li>Initializes all caches with default capacities</li>
141137
* <li>Loads and caches the default locale</li>
142138
* </ul>
143-
* </p>
144139
*
145140
* @param plugin The JavaPlugin instance using this language manager
146141
*/
@@ -158,7 +153,6 @@ public LanguageManager(JavaPlugin plugin) {
158153
* @param plugin The JavaPlugin instance using this language manager
159154
* @param fileTypes Specific file types to load (e.g., only MESSAGES and GUI)
160155
*
161-
* @example
162156
* <pre>{@code
163157
* // Only load messages and GUI files
164158
* LanguageManager langManager = new LanguageManager(
@@ -196,14 +190,12 @@ public LanguageManager(JavaPlugin plugin, LanguageFileType... fileTypes) {
196190

197191
/**
198192
* Loads language files for the default locale.
199-
* <p>
200193
* This method:
201194
* <ul>
202195
* <li>Creates the language directory if it doesn't exist</li>
203196
* <li>Loads all active file types for the default locale</li>
204197
* <li>Merges default values with user configuration</li>
205198
* </ul>
206-
* </p>
207199
*/
208200
public void loadLanguages() {
209201
loadLanguages(activeFileTypes.toArray(new LanguageFileType[0]));
@@ -258,7 +250,6 @@ private void cacheDefaultLocaleData() {
258250
* <li>Re-caches the default locale</li>
259251
* </ul>
260252
* Call this method after changing language files or the default locale.
261-
* </p>
262253
*/
263254
public void reloadLanguages() {
264255
// Clear all caches first to avoid using stale data
@@ -1053,7 +1044,6 @@ public List<String> getItemLoreWithMultilinePlaceholders(String key, Map<String,
10531044
* <li>1,000,000,000 → 1B</li>
10541045
* <li>1,000,000,000,000 → 1T</li>
10551046
* </ul>
1056-
* </p>
10571047
*
10581048
* @param number The number to format
10591049
* @return The formatted number string

src/main/java/io/github/pluginlangcore/language/LocaleData.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,11 @@
1313
* <li><b>formatting</b> - Number formatting, entity names, and text transformations</li>
1414
* <li><b>items</b> - Vanilla and custom item names and lore</li>
1515
* </ul>
16-
* </p>
1716
* <p>
1817
* Being a record, this class is immutable and provides automatic implementations
1918
* of equals(), hashCode(), and toString() methods.
20-
* </p>
21-
*
22-
* @param messages Configuration containing player messages and system notifications
23-
* @param gui Configuration containing GUI-related text (titles, item names, lore)
24-
* @param formatting Configuration containing formatting rules for numbers, names, etc.
25-
* @param items Configuration containing item names and lore definitions
26-
*
27-
* @author PluginLangCore Team
28-
* @version 1.0.0
29-
* @since 1.0.0
30-
*
31-
* @example
19+
* <p>
20+
* Example usage:
3221
* <pre>{@code
3322
* YamlConfiguration messages = YamlConfiguration.loadConfiguration(new File("messages.yml"));
3423
* YamlConfiguration gui = YamlConfiguration.loadConfiguration(new File("gui.yml"));
@@ -38,6 +27,15 @@
3827
* LocaleData localeData = new LocaleData(messages, gui, formatting, items);
3928
* String prefix = localeData.messages().getString("prefix");
4029
* }</pre>
30+
*
31+
* @param messages Configuration containing player messages and system notifications
32+
* @param gui Configuration containing GUI-related text (titles, item names, lore)
33+
* @param formatting Configuration containing formatting rules for numbers, names, etc.
34+
* @param items Configuration containing item names and lore definitions
35+
*
36+
* @author PluginLangCore Team
37+
* @version 1.0.0
38+
* @since 1.0.0
4139
*/
4240
public record LocaleData(
4341
YamlConfiguration messages,

src/main/java/io/github/pluginlangcore/language/MessageService.java

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,11 @@
2525
* <li>Console logging with color stripping</li>
2626
* <li>Placeholder replacement</li>
2727
* </ul>
28-
* </p>
2928
* <p>
3029
* The service caches key existence checks to improve performance and provides
3130
* methods for both player and console message delivery.
32-
* </p>
33-
*
34-
* @author PluginLangCore Team
35-
* @version 1.0.0
36-
* @since 1.0.0
37-
*
38-
* @example
31+
* <p>
32+
* Example usage:
3933
* <pre>{@code
4034
* LanguageManager langManager = new LanguageManager(plugin);
4135
* MessageService messageService = new MessageService(plugin, langManager);
@@ -51,6 +45,10 @@
5145
* // Send a console message
5246
* messageService.sendConsoleMessage("server_started");
5347
* }</pre>
48+
*
49+
* @author PluginLangCore Team
50+
* @version 1.0.0
51+
* @since 1.0.0
5452
*/
5553
@RequiredArgsConstructor
5654
public class MessageService {
@@ -101,15 +99,13 @@ public void sendMessage(Player player, String key) {
10199

102100
/**
103101
* Sends a message to a Player with placeholders.
104-
* <p>
105102
* Automatically handles player-specific features:
106103
* <ul>
107104
* <li>Chat messages</li>
108105
* <li>Titles and subtitles</li>
109106
* <li>Action bar messages</li>
110107
* <li>Sound effects</li>
111108
* </ul>
112-
* </p>
113109
*
114110
* @param player The player to receive the message
115111
* @param key The message key from the language files
@@ -131,7 +127,6 @@ public void sendMessage(Player player, String key, Map<String, String> placehold
131127
* @param key The message key from the language files
132128
* @param placeholders Map of placeholders to replace in the message
133129
*
134-
* @example
135130
* <pre>{@code
136131
* Map<String, String> placeholders = new HashMap<>();
137132
* placeholders.put("amount", "100");
@@ -203,18 +198,17 @@ public void sendConsoleMessage(String key) {
203198
* This method retrieves the message, applies placeholders, strips all
204199
* color codes, and logs it to the console. Useful for server logging
205200
* and administrative notifications.
206-
* </p>
207-
*
208-
* @param key The message key from the language files
209-
* @param placeholders Map of placeholders to replace in the message
210-
*
211-
* @example
201+
* <p>
202+
* Example usage:
212203
* <pre>{@code
213204
* Map<String, String> placeholders = new HashMap<>();
214205
* placeholders.put("player", "Steve");
215206
* placeholders.put("reason", "Flying");
216207
* messageService.sendConsoleMessage("player_kicked", placeholders);
217208
* }</pre>
209+
*
210+
* @param key The message key from the language files
211+
* @param placeholders Map of placeholders to replace in the message
218212
*/
219213
public void sendConsoleMessage(String key, Map<String, String> placeholders) {
220214
// Validate the message key exists

src/main/java/io/github/pluginlangcore/language/package-info.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* <li>Player message delivery with titles, sounds, and action bars</li>
99
* <li>Console logging with color code stripping</li>
1010
* </ul>
11-
* </p>
1211
*
1312
* @see io.github.pluginlangcore.language.LanguageManager
1413
* @see io.github.pluginlangcore.language.MessageService

src/main/java/io/github/pluginlangcore/updater/LanguageUpdater.java

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,12 @@
2626
* <li>Support for multiple languages</li>
2727
* <li>Smart detection of meaningful changes</li>
2828
* </ul>
29-
* </p>
3029
* <p>
3130
* The updater adds a {@code language_version} key to each language file to track versions.
3231
* When the plugin version increases, it automatically merges new keys while preserving
3332
* user modifications.
34-
* </p>
35-
*
36-
* @author PluginLangCore Team
37-
* @version 1.0.0
38-
* @since 1.0.0
39-
*
40-
* @example
33+
* <p>
34+
* Example usage:
4135
* <pre>{@code
4236
* public class MyPlugin extends JavaPlugin {
4337
* @Override
@@ -55,6 +49,10 @@
5549
* }
5650
* }
5751
* }</pre>
52+
*
53+
* @author PluginLangCore Team
54+
* @version 1.0.0
55+
* @since 1.0.0
5856
*/
5957
public class LanguageUpdater {
6058
private final String currentVersion;
@@ -111,7 +109,6 @@ public enum LanguageFileType {
111109
* @param plugin The JavaPlugin instance
112110
* @param supportedLanguages List of language codes to support (e.g., "en_US", "vi_VN")
113111
*
114-
* @example
115112
* <pre>{@code
116113
* // Update all file types for English and Vietnamese
117114
* new LanguageUpdater(this, Arrays.asList("en_US", "vi_VN"));
@@ -126,13 +123,8 @@ public LanguageUpdater(JavaPlugin plugin, List<String> supportedLanguages) {
126123
* <p>
127124
* Use this constructor when you only want to update certain file types,
128125
* which can improve performance and reduce unnecessary file operations.
129-
* </p>
130-
*
131-
* @param plugin The JavaPlugin instance
132-
* @param supportedLanguages List of language codes to support
133-
* @param fileTypes Specific file types to update
134-
*
135-
* @example
126+
* <p>
127+
* Example usage:
136128
* <pre>{@code
137129
* // Only update messages and GUI files
138130
* new LanguageUpdater(
@@ -142,6 +134,10 @@ public LanguageUpdater(JavaPlugin plugin, List<String> supportedLanguages) {
142134
* LanguageFileType.GUI
143135
* );
144136
* }</pre>
137+
*
138+
* @param plugin The JavaPlugin instance
139+
* @param supportedLanguages List of language codes to support
140+
* @param fileTypes Specific file types to update
145141
*/
146142
public LanguageUpdater(JavaPlugin plugin, List<String> supportedLanguages, LanguageFileType... fileTypes) {
147143
this.plugin = plugin;
@@ -153,7 +149,6 @@ public LanguageUpdater(JavaPlugin plugin, List<String> supportedLanguages, Langu
153149

154150
/**
155151
* Checks and updates all language files for all supported languages.
156-
* <p>
157152
* This method:
158153
* <ul>
159154
* <li>Creates language directories if they don't exist</li>
@@ -162,11 +157,8 @@ public LanguageUpdater(JavaPlugin plugin, List<String> supportedLanguages, Langu
162157
* <li>Preserves user customizations</li>
163158
* <li>Creates backups when necessary</li>
164159
* </ul>
165-
* </p>
166-
* <p>
167160
* This method is called automatically in the constructor but can be called
168161
* manually to force a re-check and update.
169-
* </p>
170162
*/
171163
public void checkAndUpdateLanguageFiles() {
172164
for (String language : supportedLanguages) {
@@ -196,7 +188,6 @@ public void checkAndUpdateLanguageFiles() {
196188
* <li>Merges new keys with user values</li>
197189
* <li>Saves updated file</li>
198190
* </ol>
199-
* </p>
200191
*
201192
* @param language The language code (e.g., "en_US")
202193
* @param languageFile The file to update
@@ -366,12 +357,8 @@ private boolean hasConfigDifferences(Map<String, Object> userValues, FileConfigu
366357
* <p>
367358
* This method converts a nested YAML structure into a flat map where
368359
* keys are dot-separated paths and values are the leaf values.
369-
* </p>
370-
*
371-
* @param config The configuration section to flatten
372-
* @return A map of path to value
373-
*
374-
* @example
360+
* <p>
361+
* Example usage:
375362
* <pre>{@code
376363
* // YAML:
377364
* // player:
@@ -384,6 +371,9 @@ private boolean hasConfigDifferences(Map<String, Object> userValues, FileConfigu
384371
* // "player.level": 5
385372
* // }
386373
* }</pre>
374+
*
375+
* @param config The configuration section to flatten
376+
* @return A map of path to value
387377
*/
388378
private Map<String, Object> flattenConfig(ConfigurationSection config) {
389379
Map<String, Object> result = new HashMap<>();

0 commit comments

Comments
 (0)