Skip to content

Commit 9e913c2

Browse files
committed
Added @SInCE for JavaDocs
1 parent 6a37b8f commit 9e913c2

File tree

14 files changed

+80
-2
lines changed

14 files changed

+80
-2
lines changed

pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@
4949
<relocations>
5050
<relocation>
5151
<pattern>org.bstats</pattern>
52-
<shadedPattern>net.lewmc.foundry</shadedPattern>
52+
<shadedPattern>net.lewmc.foundry.external</shadedPattern>
53+
</relocation>
54+
<relocation>
55+
<pattern>io.papermc</pattern>
56+
<shadedPattern>net.lewmc.foundry.external</shadedPattern>
5357
</relocation>
5458
</relocations>
5559
</configuration>
@@ -85,6 +89,12 @@
8589
<version>1.21.8-R0.1-SNAPSHOT</version>
8690
<scope>provided</scope>
8791
</dependency>
92+
<dependency>
93+
<groupId>io.papermc</groupId>
94+
<artifactId>paperlib</artifactId>
95+
<version>1.0.7</version>
96+
<scope>compile</scope>
97+
</dependency>
8898
</dependencies>
8999

90100
<distributionManagement>

src/main/java/net/lewmc/foundry/Files.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class Files {
2626
/**
2727
* The constructor for the Files class.
2828
* @param plugin Reference to the main plugin class.
29+
* @since 1.0.0
2930
*/
3031
public Files(FoundryConfig config, JavaPlugin plugin) {
3132
this.plugin = plugin;
@@ -38,6 +39,7 @@ public Files(FoundryConfig config, JavaPlugin plugin) {
3839
* Creates a file.
3940
* @param path String - Path to the file.
4041
* @return boolean - If the file and directories (if required) were created successfully.
42+
* @since 1.0.0
4143
*/
4244
public boolean create(String path) {
4345
File createFile = new File(this.plugin.getDataFolder(), this.parseFileName(path));
@@ -63,6 +65,7 @@ public boolean create(String path) {
6365
* Checks if a file exists.
6466
* @param path - Path to the file.
6567
* @return boolean - If the file exists
68+
* @since 1.0.0
6669
*/
6770
public boolean exists(String path) {
6871
File file = new File(this.plugin.getDataFolder(), this.parseFileName(path));
@@ -73,6 +76,7 @@ public boolean exists(String path) {
7376
* Opens a configuration file.
7477
* @param path String - Path to the file
7578
* @return boolean - If the operation was successful
79+
* @since 1.0.0
7680
*/
7781
public boolean load(String path) {
7882
if (!this.isOpen()) {
@@ -105,6 +109,7 @@ public boolean load(String path) {
105109
* Opens a configuration file from root (without checking format).
106110
* @param path String - Path to the file
107111
* @return boolean - If the operation was successful
112+
* @since 1.0.0
108113
*/
109114
public boolean loadNoReformat(String path) {
110115
if (!this.isOpen()) {
@@ -137,6 +142,7 @@ public boolean loadNoReformat(String path) {
137142
* Opens a configuration file from root (without checking format).
138143
* @param file File - Instance of the file.
139144
* @return boolean - If the operation was successful
145+
* @since 1.0.0
140146
*/
141147
public boolean loadNoReformat(File file) {
142148
if (!this.isOpen()) {
@@ -168,6 +174,7 @@ public boolean loadNoReformat(File file) {
168174
* Deletes a file.
169175
* @param path String - The path of the file
170176
* @return boolean - If the operation was successful
177+
* @since 1.0.0
171178
*/
172179
public boolean delete(String path) {
173180
try {
@@ -184,6 +191,7 @@ public boolean delete(String path) {
184191
* Saves and closes the current configuration file to a custom location.
185192
* @param file String - The file.
186193
* @return boolean - If the operation was successful
194+
* @since 1.0.0
187195
*/
188196
public boolean save(File file) {
189197
if (this.isOpen()) {
@@ -205,6 +213,7 @@ public boolean save(File file) {
205213
/**
206214
* Saves and closes the current configuration file.
207215
* @return boolean - If the operation was successful
216+
* @since 1.0.0
208217
*/
209218
public boolean save() {
210219
if (this.isOpen()) {
@@ -232,6 +241,7 @@ public boolean save() {
232241
* @param key The location of the value.
233242
* @param value The value to set.
234243
* @return boolean - If the operation was successful
244+
* @since 1.0.0
235245
*/
236246
public boolean set(String key, Object value) {
237247
if (this.isOpen()) {
@@ -250,6 +260,7 @@ public boolean set(String key, Object value) {
250260
* Gets an object from the configuration file.
251261
* @param key The location of the value.
252262
* @return Object - the value.
263+
* @since 1.0.0
253264
*/
254265
public Object get(String key) {
255266
if (this.isOpen()) {
@@ -264,6 +275,7 @@ public Object get(String key) {
264275
* Gets a boolean from the configuration file.
265276
* @param key The location of the value.
266277
* @return boolean - the value.
278+
* @since 1.0.0
267279
*/
268280
public boolean getBoolean(String key) {
269281
if (this.isOpen()) {
@@ -278,6 +290,7 @@ public boolean getBoolean(String key) {
278290
* Gets a string from the configuration file.
279291
* @param key The location of the value.
280292
* @return String - the value.
293+
* @since 1.0.0
281294
*/
282295
public String getString(String key) {
283296
if (this.isOpen()) {
@@ -292,6 +305,7 @@ public String getString(String key) {
292305
* Gets an integer from the configuration file.
293306
* @param key The location of the value.
294307
* @return int - the value.
308+
* @since 1.0.0
295309
*/
296310
public int getInt(String key) {
297311
if (this.isOpen()) {
@@ -306,6 +320,7 @@ public int getInt(String key) {
306320
* Gets a double from the configuration file.
307321
* @param key The location of the value.
308322
* @return double - the value.
323+
* @since 1.0.0
309324
*/
310325
public double getDouble(String key) {
311326
if (this.isOpen()) {
@@ -320,6 +335,7 @@ public double getDouble(String key) {
320335
* Gets a String List from the configuration file.
321336
* @param key The location of the value.
322337
* @return List - the value.
338+
* @since 1.0.0
323339
*/
324340
public List<String> getStringList(String key) {
325341
if (this.isOpen()) {
@@ -334,6 +350,7 @@ public List<String> getStringList(String key) {
334350
* Gets a List from the configuration file if is root.
335351
* @param deep Should do deep search?
336352
* @return List - the value.
353+
* @since 1.0.0
337354
*/
338355
public Set<String> getKeys(boolean deep) {
339356
if (this.isOpen()) {
@@ -349,6 +366,7 @@ public Set<String> getKeys(boolean deep) {
349366
* @param section The section of the file.
350367
* @param deep Should do deep search?
351368
* @return List - the value.
369+
* @since 1.0.0
352370
*/
353371
public Set<String> getKeys(String section, boolean deep) {
354372
if (this.isOpen()) {
@@ -368,6 +386,7 @@ public Set<String> getKeys(String section, boolean deep) {
368386
* Closes the configuration file without saving it.
369387
* Not needed if save() has been used.
370388
* @return boolean - If the operation was successful
389+
* @since 1.0.0
371390
*/
372391
public boolean close() {
373392
if (this.isOpen()) {
@@ -383,6 +402,7 @@ public boolean close() {
383402
/**
384403
* Checks if a file is open.
385404
* @return boolean - If a file is open
405+
* @since 1.0.0
386406
*/
387407
public boolean isOpen() {
388408
return this.config != null && this.file != null;
@@ -392,6 +412,7 @@ public boolean isOpen() {
392412
* Return the location of the player's data file from an instance of the player.
393413
* @param player Player - The player.
394414
* @return The data file URI inside the /plugin/essence folder.
415+
* @since 1.0.0
395416
*/
396417
public String playerDataFile(Player player) {
397418
return "data/players/"+player.getUniqueId()+".yml";
@@ -401,6 +422,7 @@ public String playerDataFile(Player player) {
401422
* Return the location of the player's data file from an instance of the player.
402423
* @param offlinePlayer OfflinePlayer - The player.
403424
* @return The data file URI inside the /plugin/essence folder.
425+
* @since 1.0.0
404426
*/
405427
public String playerDataFile(OfflinePlayer offlinePlayer) {
406428
return "data/players/"+offlinePlayer.getUniqueId()+".yml";
@@ -410,6 +432,7 @@ public String playerDataFile(OfflinePlayer offlinePlayer) {
410432
* Return the location of the player's data file from the player's UUID.
411433
* @param uuid UUID - The player's UUID.
412434
* @return The data file URI inside the /plugin/essence folder.
435+
* @since 1.0.0
413436
*/
414437
public String playerDataFile(UUID uuid) {
415438
return "data/players/"+uuid+".yml";
@@ -419,6 +442,7 @@ public String playerDataFile(UUID uuid) {
419442
* Parses the filename to ensure leading slashes are correct.
420443
* @param fileName String - The name of the file to be opened.
421444
* @return The correctly parsed filename.
445+
* @since 1.0.0
422446
*/
423447
private String parseFileName(String fileName) {
424448
if (fileName != null) {
@@ -437,6 +461,7 @@ private String parseFileName(String fileName) {
437461
* Removes a key and it's associated data.
438462
* @param key String - The item to remove.
439463
* @return If the operation was successful
464+
* @since 1.0.0
440465
*/
441466
public boolean remove(String key) {
442467
if (this.isOpen()) {

src/main/java/net/lewmc/foundry/Foundry.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class Foundry extends JavaPlugin {
99

1010
/**
1111
* This function runs when Foundry is enabled.
12+
* @since 1.0.0
1213
*/
1314
@Override
1415
public void onEnable() {

src/main/java/net/lewmc/foundry/FoundryConfig.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class FoundryConfig {
2424
/**
2525
* Sets up the FoundryConfig class.
2626
* @param plugin Plugin - The parent plugin.
27+
* @since 1.0.0
2728
*/
2829
public FoundryConfig(JavaPlugin plugin) {
2930
this.plugin = plugin;
@@ -33,6 +34,7 @@ public FoundryConfig(JavaPlugin plugin) {
3334
/**
3435
* Sets if Foundry should be verbose.
3536
* @param verbose boolean - true/false
37+
* @since 1.0.0
3638
*/
3739
public void setVerbose(boolean verbose) {
3840
this.verbose = verbose;
@@ -41,6 +43,7 @@ public void setVerbose(boolean verbose) {
4143
/**
4244
* Overwrites Foundry's preset Plugin ID.
4345
* @param pluginId String - Plugin ID
46+
* @since 1.0.0
4447
*/
4548
public void setPluginId(String pluginId) {
4649
this.pluginId = pluginId.toLowerCase();

src/main/java/net/lewmc/foundry/FoundryModule.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ abstract public class FoundryModule {
2121
* Executes all other functions.
2222
* @param plugin Reference to the main plugin class.
2323
* @param reg The Foundry Registry.
24+
* @since 1.0.0
2425
*/
2526
public FoundryModule(@NotNull JavaPlugin plugin, @NotNull Registry reg) {
2627
this.plugin = plugin;
@@ -33,16 +34,19 @@ public FoundryModule(@NotNull JavaPlugin plugin, @NotNull Registry reg) {
3334

3435
/**
3536
* Where commands to be registered should be placed.
37+
* @since 1.0.0
3638
*/
3739
public abstract void registerCommands();
3840

3941
/**
4042
* Where events to be registered should be placed.
43+
* @since 1.0.0
4144
*/
4245
public abstract void registerEvents();
4346

4447
/**
4548
* Where tab completers to be registered should be placed.
49+
* @since 1.0.0
4650
*/
4751
public abstract void registerTabCompleters();
4852
}

src/main/java/net/lewmc/foundry/IBukkit.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class IBukkit {
2828
* Constructor for the class.
2929
* @param config FoundryConfig - Foundry's configuration.
3030
* @param plugin Plugin - Reference to the main plugin class.
31+
* @since 1.2.0
3132
*/
3233
public IBukkit(FoundryConfig config, JavaPlugin plugin) {
3334
this.config = config;
@@ -37,6 +38,7 @@ public IBukkit(FoundryConfig config, JavaPlugin plugin) {
3738
/**
3839
* Fetches the Bukkit Command Map
3940
* @return CommandMap on success, null on fail.
41+
* @since 1.2.0
4042
*/
4143
public CommandMap getCommandMap() {
4244
try {
@@ -61,6 +63,7 @@ public CommandMap getCommandMap() {
6163
* @see Registry#runtimeCommand(String, CommandExecutor, String...)
6264
* @param name The command's name.
6365
* @return PluginCommand the constructed command.
66+
* @since 1.2.0
6467
*/
6568
public PluginCommand constructRuntimeCommand(String name) {
6669
PluginCommand command = null;
@@ -82,6 +85,7 @@ public PluginCommand constructRuntimeCommand(String name) {
8285
/**
8386
* Fetches the Bukkit Plugin Manager
8487
* @return PluginManager on success, null on fail.
88+
* @since 1.2.0
8589
*/
8690
public PluginManager getPluginManager() {
8791
try {

src/main/java/net/lewmc/foundry/Logger.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class Logger {
1111
/**
1212
* Constructor for the LogUtil class.
1313
* @param config - Reference to the config class.
14+
* @since 1.0.0
1415
*/
1516
public Logger(FoundryConfig config) {
1617
this.config = config;
@@ -19,6 +20,7 @@ public Logger(FoundryConfig config) {
1920
/**
2021
* Logs a message to the server console as informational (standard).
2122
* @param message String - Message to log.
23+
* @since 1.0.0
2224
*/
2325
public void info(String message) {
2426
Bukkit.getLogger().info("[" + this.config.pluginId.toUpperCase() + "] " + message);
@@ -27,6 +29,7 @@ public void info(String message) {
2729
/**
2830
* Logs a message to the server console as warning (non-fatal error).
2931
* @param message String - Message to log.
32+
* @since 1.0.0
3033
*/
3134
public void warn(String message) {
3235
Bukkit.getLogger().warning("[" + this.config.pluginId.toUpperCase() + "] " + message);
@@ -35,13 +38,15 @@ public void warn(String message) {
3538
/**
3639
* Logs a message to the server console as severe (fatal error).
3740
* @param message String - Message to log.
41+
* @since 1.0.0
3842
*/
3943
public void severe(String message) {
4044
Bukkit.getLogger().severe("[" + this.config.pluginId.toUpperCase() + "] " + message);
4145
}
4246

4347
/**
4448
* Logs a message to the console, informing the console operator that it cannot run the command requested.
49+
* @since 1.0.0
4550
*/
4651
public boolean noConsole() {
4752
this.warn("Sorry, you need to be an in-game player to use this command.");

src/main/java/net/lewmc/foundry/Permissions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class Permissions {
1313
/**
1414
* Constructor.
1515
* @param cs CommandSender - The user who executed the command.
16+
* @since 1.0.0
1617
*/
1718
public Permissions(CommandSender cs) {
1819
this.cs = cs;
@@ -22,6 +23,7 @@ public Permissions(CommandSender cs) {
2223
* Checks if the user has a specific permission.
2324
* @param node String - the permission node to check.
2425
* @return boolean - If the user has a permission (true/false)
26+
* @since 1.0.0
2527
*/
2628
public boolean has(String node) {
2729
if (this.cs instanceof Player p) {
@@ -34,6 +36,7 @@ public boolean has(String node) {
3436
/**
3537
* Checks if the user has a specific permission.
3638
* @return boolean - If the user is operator (true/false)
39+
* @since 1.0.0
3740
*/
3841
public boolean isOp() {
3942
if (this.cs instanceof Player p) {

0 commit comments

Comments
 (0)