Format code

This commit is contained in:
Telesphoreo 2022-02-06 23:59:26 -06:00
parent cb3a6cc391
commit 917775e7e7
11 changed files with 45 additions and 13 deletions

View File

@ -42,6 +42,7 @@ public class Admin
/** /**
* Creates an admin with the startig ADMIN rank * Creates an admin with the startig ADMIN rank
*
* @param uuid * @param uuid
* @see UUID * @see UUID
* @see Rank * @see Rank

View File

@ -19,6 +19,7 @@ import java.util.stream.Collectors;
/** /**
* Cached storage for Admin objects * Cached storage for Admin objects
*
* @see Admin * @see Admin
*/ */
@ -31,6 +32,7 @@ public class AdminList
/** /**
* Adds the admin to cache * Adds the admin to cache
*
* @param admin The admin object * @param admin The admin object
*/ */
public void addToCache(Admin admin) public void addToCache(Admin admin)
@ -40,6 +42,7 @@ public class AdminList
/** /**
* Removes an admin from the cache * Removes an admin from the cache
*
* @param uuid The unique ID of the admin * @param uuid The unique ID of the admin
* @see UUID * @see UUID
*/ */
@ -50,6 +53,7 @@ public class AdminList
/** /**
* Gathers every admin's username (cached and databsed) * Gathers every admin's username (cached and databsed)
*
* @return An array list of the names of every admin * @return An array list of the names of every admin
*/ */
public List<String> getAllAdmins() public List<String> getAllAdmins()

View File

@ -13,6 +13,7 @@ import org.apache.commons.lang.RandomStringUtils;
/** /**
* The ban object * The ban object
*
* @see BanManager * @see BanManager
*/ */
@Getter @Getter
@ -69,10 +70,11 @@ public class Ban
/** /**
* Creates a ban object * Creates a ban object
* @param uuid The unique ID of the player being banned *
* @param banner The unique ID of the sender banning the player * @param uuid The unique ID of the player being banned
* @param ip The IP of the player being banned * @param banner The unique ID of the sender banning the player
* @param reason The reason for the ban * @param ip The IP of the player being banned
* @param reason The reason for the ban
* @param endDate When the ban will expire * @param endDate When the ban will expire
*/ */
public Ban(UUID uuid, UUID banner, String ip, String reason, LocalDateTime endDate) public Ban(UUID uuid, UUID banner, String ip, String reason, LocalDateTime endDate)
@ -87,11 +89,12 @@ public class Ban
/** /**
* Creates a ban object * Creates a ban object
* @param id The custom ID of the ban *
* @param uuid The unique ID of the player being banned * @param id The custom ID of the ban
* @param banner The unique ID of the sender banning the player * @param uuid The unique ID of the player being banned
* @param ip The IP of the player being banned * @param banner The unique ID of the sender banning the player
* @param reason The reason for the ban * @param ip The IP of the player being banned
* @param reason The reason for the ban
* @param endDate When the ban will expire * @param endDate When the ban will expire
*/ */
public Ban(String id, UUID uuid, UUID banner, String ip, String reason, LocalDateTime endDate) public Ban(String id, UUID uuid, UUID banner, String ip, String reason, LocalDateTime endDate)

View File

@ -23,6 +23,7 @@ public class BanManager
/** /**
* Adds the ban to the database * Adds the ban to the database
*
* @param ban The ban object * @param ban The ban object
*/ */
public void executeBan(Ban ban) public void executeBan(Ban ban)
@ -55,6 +56,7 @@ public class BanManager
/** /**
* Checks if the unique ID has an active ban in the database * Checks if the unique ID has an active ban in the database
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
* @return true if the unique ID is banned * @return true if the unique ID is banned
*/ */
@ -94,6 +96,7 @@ public class BanManager
/** /**
* Unbans a player if they have an active ban on record * Unbans a player if they have an active ban on record
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
*/ */
public void unban(UUID uuid) public void unban(UUID uuid)
@ -125,6 +128,7 @@ public class BanManager
/** /**
* Unbans a player if they have an active ban on record * Unbans a player if they have an active ban on record
*
* @param id Custom ID of the ban * @param id Custom ID of the ban
*/ */
public void unban(String id) public void unban(String id)
@ -155,6 +159,7 @@ public class BanManager
/** /**
* Gets a list of all the current bans active * Gets a list of all the current bans active
*
* @return An arraylist of bans * @return An arraylist of bans
*/ */
public List<Ban> getActiveBans() public List<Ban> getActiveBans()

View File

@ -13,6 +13,7 @@ public class DataUtils
{ {
/** /**
* Checks if the player has been on the server before * Checks if the player has been on the server before
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
* @return true if the player is registered in the database * @return true if the player is registered in the database
*/ */
@ -30,6 +31,7 @@ public class DataUtils
/** /**
* Gets a player from cache or from the database * Gets a player from cache or from the database
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
* @return a PlexPlayer object * @return a PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
@ -53,6 +55,7 @@ public class DataUtils
/** /**
* Gets a player from cache or from the database * Gets a player from cache or from the database
*
* @param name Username of the player * @param name Username of the player
* @return a PlexPlayer object * @return a PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
@ -64,6 +67,7 @@ public class DataUtils
/** /**
* Updates a player's information in the database * Updates a player's information in the database
*
* @param plexPlayer The PlexPlayer to update * @param plexPlayer The PlexPlayer to update
* @see PlexPlayer * @see PlexPlayer
*/ */
@ -81,6 +85,7 @@ public class DataUtils
/** /**
* Inserts a player's information in the database * Inserts a player's information in the database
*
* @param plexPlayer The PlexPlayer to insert * @param plexPlayer The PlexPlayer to insert
* @see PlexPlayer * @see PlexPlayer
*/ */

View File

@ -29,6 +29,7 @@ public class MongoPlayerData
/** /**
* Checks whether the player exists in mongo's database * Checks whether the player exists in mongo's database
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
* @return true if the player was found * @return true if the player was found
*/ */
@ -42,6 +43,7 @@ public class MongoPlayerData
/** /**
* Gets the player from cache or from mongo's database * Gets the player from cache or from mongo's database
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
* @return a PlexPlayer object * @return a PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
@ -59,6 +61,7 @@ public class MongoPlayerData
/** /**
* Updates a player's information in the mongo database * Updates a player's information in the mongo database
*
* @param player The PlexPlayer object * @param player The PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
*/ */
@ -84,6 +87,7 @@ public class MongoPlayerData
/** /**
* Saves the player's information in the database * Saves the player's information in the database
*
* @param plexPlayer The PlexPlayer object * @param plexPlayer The PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
*/ */

View File

@ -22,6 +22,7 @@ public class SQLPlayerData
/** /**
* Checks if a player exists in the SQL database * Checks if a player exists in the SQL database
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
* @return true if the player was found in the database * @return true if the player was found in the database
*/ */
@ -43,6 +44,7 @@ public class SQLPlayerData
/** /**
* Gets the player from cache or from the SQL database * Gets the player from cache or from the SQL database
*
* @param uuid The unique ID of the player * @param uuid The unique ID of the player
* @return a PlexPlayer object * @return a PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
@ -92,6 +94,7 @@ public class SQLPlayerData
/** /**
* Updates a player's information in the SQL database * Updates a player's information in the SQL database
*
* @param player The PlexPlayer object * @param player The PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
*/ */
@ -119,6 +122,7 @@ public class SQLPlayerData
/** /**
* Inserts the player's information in the database * Inserts the player's information in the database
*
* @param player The PlexPlayer object * @param player The PlexPlayer object
* @see PlexPlayer * @see PlexPlayer
*/ */

View File

@ -11,24 +11,28 @@ public @interface CommandParameters
{ {
/** /**
* The name * The name
*
* @return Name of the command * @return Name of the command
*/ */
String name(); String name();
/** /**
* The description * The description
*
* @return Description of the command * @return Description of the command
*/ */
String description() default ""; String description() default "";
/** /**
* The usage (optional) * The usage (optional)
*
* @return The usage of the command * @return The usage of the command
*/ */
String usage() default "/<command>"; String usage() default "/<command>";
/** /**
* The aliases (optional) * The aliases (optional)
*
* @return The aliases of the command * @return The aliases of the command
*/ */
String aliases() default ""; String aliases() default "";

View File

@ -13,6 +13,7 @@ public @interface CommandPermissions
{ {
/** /**
* Minimum rank required * Minimum rank required
*
* @return Minimum rank required for the command * @return Minimum rank required for the command
* @see Rank * @see Rank
*/ */
@ -20,6 +21,7 @@ public @interface CommandPermissions
/** /**
* Required command source * Required command source
*
* @return The required command source of the command * @return The required command source of the command
* @see RequiredCommandSource * @see RequiredCommandSource
*/ */
@ -27,6 +29,7 @@ public @interface CommandPermissions
/** /**
* The permission * The permission
*
* @return Permission of the command * @return Permission of the command
*/ */
String permission() default ""; // No idea what to put here String permission() default ""; // No idea what to put here

View File

@ -1,9 +1,7 @@
package dev.plex.listener.impl; package dev.plex.listener.impl;
import dev.plex.banning.Ban; import dev.plex.banning.Ban;
import dev.plex.cache.DataUtils;
import dev.plex.listener.PlexListener; import dev.plex.listener.PlexListener;
import dev.plex.player.PlexPlayer;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;

View File

@ -37,10 +37,11 @@ public class MojangUtils
return null; return null;
} }
client.close(); client.close();
AshconInfo ashconInfo = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, (JsonDeserializer<LocalDateTime>) (json1, typeOfT, context) -> AshconInfo ashconInfo = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, (JsonDeserializer<LocalDateTime>)(json1, typeOfT, context) ->
LocalDateTime.ofInstant(Instant.from(DateTimeFormatter.ISO_INSTANT.parse(json1.getAsJsonPrimitive().getAsString())), ZoneId.systemDefault())).create().fromJson(json, AshconInfo.class); LocalDateTime.ofInstant(Instant.from(DateTimeFormatter.ISO_INSTANT.parse(json1.getAsJsonPrimitive().getAsString())), ZoneId.systemDefault())).create().fromJson(json, AshconInfo.class);
Arrays.sort(ashconInfo.getUsernameHistories(), (o1, o2) -> { Arrays.sort(ashconInfo.getUsernameHistories(), (o1, o2) ->
{
if (o1.getLocalDateTime() == null || o2.getLocalDateTime() == null) if (o1.getLocalDateTime() == null || o2.getLocalDateTime() == null)
{ {
return 1; return 1;