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
*
* @param uuid
* @see UUID
* @see Rank

View File

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

View File

@ -13,6 +13,7 @@ import org.apache.commons.lang.RandomStringUtils;
/**
* The ban object
*
* @see BanManager
*/
@Getter
@ -69,10 +70,11 @@ public class Ban
/**
* 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 ip The IP of the player being banned
* @param reason The reason for the ban
*
* @param uuid The unique ID of the player being banned
* @param banner The unique ID of the sender banning the player
* @param ip The IP of the player being banned
* @param reason The reason for the ban
* @param endDate When the ban will expire
*/
public Ban(UUID uuid, UUID banner, String ip, String reason, LocalDateTime endDate)
@ -87,11 +89,12 @@ public class Ban
/**
* Creates a ban object
* @param id The custom ID of the ban
* @param uuid The unique ID of the player being banned
* @param banner The unique ID of the sender banning the player
* @param ip The IP of the player being banned
* @param reason The reason for the ban
*
* @param id The custom ID of the ban
* @param uuid The unique ID of the player being banned
* @param banner The unique ID of the sender banning the player
* @param ip The IP of the player being banned
* @param reason The reason for the ban
* @param endDate When the ban will expire
*/
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
*
* @param ban The ban object
*/
public void executeBan(Ban ban)
@ -55,6 +56,7 @@ public class BanManager
/**
* Checks if the unique ID has an active ban in the database
*
* @param uuid The unique ID of the player
* @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
*
* @param uuid The unique ID of the player
*/
public void unban(UUID uuid)
@ -125,6 +128,7 @@ public class BanManager
/**
* Unbans a player if they have an active ban on record
*
* @param id Custom ID of the ban
*/
public void unban(String id)
@ -155,6 +159,7 @@ public class BanManager
/**
* Gets a list of all the current bans active
*
* @return An arraylist of bans
*/
public List<Ban> getActiveBans()

View File

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

View File

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

View File

@ -22,6 +22,7 @@ public class SQLPlayerData
/**
* Checks if a player exists in the SQL database
*
* @param uuid The unique ID of the player
* @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
*
* @param uuid The unique ID of the player
* @return a PlexPlayer object
* @see PlexPlayer
@ -92,6 +94,7 @@ public class SQLPlayerData
/**
* Updates a player's information in the SQL database
*
* @param player The PlexPlayer object
* @see PlexPlayer
*/
@ -119,6 +122,7 @@ public class SQLPlayerData
/**
* Inserts the player's information in the database
*
* @param player The PlexPlayer object
* @see PlexPlayer
*/

View File

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

View File

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

View File

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

View File

@ -37,10 +37,11 @@ public class MojangUtils
return null;
}
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);
Arrays.sort(ashconInfo.getUsernameHistories(), (o1, o2) -> {
Arrays.sort(ashconInfo.getUsernameHistories(), (o1, o2) ->
{
if (o1.getLocalDateTime() == null || o2.getLocalDateTime() == null)
{
return 1;