diff --git a/API/src/main/java/cc/restfulmc/api/common/DNSUtils.java b/API/src/main/java/cc/restfulmc/api/common/DNSUtils.java index 8127dfb..0252f3e 100644 --- a/API/src/main/java/cc/restfulmc/api/common/DNSUtils.java +++ b/API/src/main/java/cc/restfulmc/api/common/DNSUtils.java @@ -23,11 +23,11 @@ */ package cc.restfulmc.api.common; +import cc.restfulmc.api.model.dns.impl.ARecord; +import cc.restfulmc.api.model.dns.impl.SRVRecord; import lombok.NonNull; import lombok.SneakyThrows; import lombok.experimental.UtilityClass; -import cc.restfulmc.api.model.dns.impl.ARecord; -import cc.restfulmc.api.model.dns.impl.SRVRecord; import org.xbill.DNS.Lookup; import org.xbill.DNS.Record; import org.xbill.DNS.Type; diff --git a/API/src/main/java/cc/restfulmc/api/common/MiscUtils.java b/API/src/main/java/cc/restfulmc/api/common/MiscUtils.java index 2e3f587..b7c09d2 100644 --- a/API/src/main/java/cc/restfulmc/api/common/MiscUtils.java +++ b/API/src/main/java/cc/restfulmc/api/common/MiscUtils.java @@ -36,7 +36,7 @@ import java.util.regex.Pattern; @UtilityClass public final class MiscUtils { private static final Pattern USERNAME_REGEX = Pattern.compile("^[a-zA-Z0-9_]{2,16}$"); - private static final List WHITELISTED_NAMES = Arrays.asList("8", "g"); + private static final List WHITELISTED_USERNAMES = Arrays.asList("8", "g"); /** * Check if the given username is a valid. @@ -45,9 +45,6 @@ public final class MiscUtils { * @return whether the username is valid */ public static boolean isUsernameValid(@NonNull String username) { - if (WHITELISTED_NAMES.contains(username.toLowerCase())) { // Name is whitelisted - return true; - } - return USERNAME_REGEX.matcher(username).matches(); + return WHITELISTED_USERNAMES.contains(username.toLowerCase()) || USERNAME_REGEX.matcher(username).matches(); } } \ No newline at end of file diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPingPacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPingPacket.java index e3fc5aa..777a9a3 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPingPacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPingPacket.java @@ -23,8 +23,8 @@ */ package cc.restfulmc.api.common.packet.impl.bedrock; -import lombok.NonNull; import cc.restfulmc.api.common.packet.UDPPacket; +import lombok.NonNull; import java.io.IOException; import java.net.DatagramPacket; diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPongPacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPongPacket.java index c3dcbcd..b765c40 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPongPacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/bedrock/BedrockUnconnectedPongPacket.java @@ -23,10 +23,10 @@ */ package cc.restfulmc.api.common.packet.impl.bedrock; -import lombok.Getter; -import lombok.NonNull; import cc.restfulmc.api.common.packet.UDPPacket; import cc.restfulmc.api.model.server.BedrockMinecraftServer; +import lombok.Getter; +import lombok.NonNull; import java.io.IOException; import java.net.DatagramPacket; diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaHandshakingInSetProtocolPacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaHandshakingInSetProtocolPacket.java index 88394bb..90cbcd5 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaHandshakingInSetProtocolPacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaHandshakingInSetProtocolPacket.java @@ -23,10 +23,10 @@ */ package cc.restfulmc.api.common.packet.impl.java.tcp; +import cc.restfulmc.api.common.packet.TCPPacket; import lombok.AllArgsConstructor; import lombok.NonNull; import lombok.ToString; -import cc.restfulmc.api.common.packet.TCPPacket; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaStatusInStartPacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaStatusInStartPacket.java index e8943b4..9d74a45 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaStatusInStartPacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/tcp/JavaStatusInStartPacket.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.common.packet.impl.java.tcp; +import cc.restfulmc.api.common.packet.TCPPacket; import lombok.Getter; import lombok.NonNull; -import cc.restfulmc.api.common.packet.TCPPacket; import java.io.DataInputStream; import java.io.DataOutputStream; diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatRequestPacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatRequestPacket.java index 1e6614a..49cb096 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatRequestPacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatRequestPacket.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.common.packet.impl.java.udp; +import cc.restfulmc.api.common.packet.JavaQueryPacket; import lombok.AllArgsConstructor; import lombok.NonNull; -import cc.restfulmc.api.common.packet.JavaQueryPacket; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatResponsePacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatResponsePacket.java index 18725a2..83fba66 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatResponsePacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryFullStatResponsePacket.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.common.packet.impl.java.udp; +import cc.restfulmc.api.common.packet.JavaQueryPacket; import lombok.Getter; import lombok.NonNull; -import cc.restfulmc.api.common.packet.JavaQueryPacket; import java.io.IOException; import java.net.DatagramPacket; diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeRequestPacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeRequestPacket.java index cb89176..8a2e385 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeRequestPacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeRequestPacket.java @@ -23,8 +23,8 @@ */ package cc.restfulmc.api.common.packet.impl.java.udp; -import lombok.NonNull; import cc.restfulmc.api.common.packet.JavaQueryPacket; +import lombok.NonNull; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; diff --git a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeResponsePacket.java b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeResponsePacket.java index 03bd70e..ccc6b69 100644 --- a/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeResponsePacket.java +++ b/API/src/main/java/cc/restfulmc/api/common/packet/impl/java/udp/JavaQueryHandshakeResponsePacket.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.common.packet.impl.java.udp; +import cc.restfulmc.api.common.packet.JavaQueryPacket; import lombok.Getter; import lombok.NonNull; -import cc.restfulmc.api.common.packet.JavaQueryPacket; import java.io.IOException; import java.net.DatagramPacket; diff --git a/API/src/main/java/cc/restfulmc/api/common/renderer/IsometricSkinRenderer.java b/API/src/main/java/cc/restfulmc/api/common/renderer/IsometricSkinRenderer.java index 5f02342..500ecdc 100644 --- a/API/src/main/java/cc/restfulmc/api/common/renderer/IsometricSkinRenderer.java +++ b/API/src/main/java/cc/restfulmc/api/common/renderer/IsometricSkinRenderer.java @@ -23,8 +23,8 @@ */ package cc.restfulmc.api.common.renderer; -import lombok.NonNull; import cc.restfulmc.api.model.skin.ISkinPart; +import lombok.NonNull; import java.awt.*; import java.awt.geom.AffineTransform; diff --git a/API/src/main/java/cc/restfulmc/api/common/renderer/SkinRenderer.java b/API/src/main/java/cc/restfulmc/api/common/renderer/SkinRenderer.java index 43cad54..5fee042 100644 --- a/API/src/main/java/cc/restfulmc/api/common/renderer/SkinRenderer.java +++ b/API/src/main/java/cc/restfulmc/api/common/renderer/SkinRenderer.java @@ -23,11 +23,11 @@ */ package cc.restfulmc.api.common.renderer; -import lombok.NonNull; -import lombok.SneakyThrows; import cc.restfulmc.api.common.ImageUtils; import cc.restfulmc.api.model.skin.ISkinPart; import cc.restfulmc.api.model.skin.Skin; +import lombok.NonNull; +import lombok.SneakyThrows; import javax.imageio.ImageIO; import java.awt.*; diff --git a/API/src/main/java/cc/restfulmc/api/common/renderer/impl/BodySkinPartRenderer.java b/API/src/main/java/cc/restfulmc/api/common/renderer/impl/BodySkinPartRenderer.java index 8977862..fe92c33 100644 --- a/API/src/main/java/cc/restfulmc/api/common/renderer/impl/BodySkinPartRenderer.java +++ b/API/src/main/java/cc/restfulmc/api/common/renderer/impl/BodySkinPartRenderer.java @@ -23,11 +23,11 @@ */ package cc.restfulmc.api.common.renderer.impl; -import lombok.NonNull; import cc.restfulmc.api.common.ImageUtils; import cc.restfulmc.api.common.renderer.SkinRenderer; import cc.restfulmc.api.model.skin.ISkinPart; import cc.restfulmc.api.model.skin.Skin; +import lombok.NonNull; import java.awt.*; import java.awt.image.BufferedImage; diff --git a/API/src/main/java/cc/restfulmc/api/common/renderer/impl/IsometricHeadSkinPartRenderer.java b/API/src/main/java/cc/restfulmc/api/common/renderer/impl/IsometricHeadSkinPartRenderer.java index cb33541..0303c2a 100644 --- a/API/src/main/java/cc/restfulmc/api/common/renderer/impl/IsometricHeadSkinPartRenderer.java +++ b/API/src/main/java/cc/restfulmc/api/common/renderer/impl/IsometricHeadSkinPartRenderer.java @@ -23,10 +23,10 @@ */ package cc.restfulmc.api.common.renderer.impl; -import lombok.NonNull; import cc.restfulmc.api.common.renderer.IsometricSkinRenderer; import cc.restfulmc.api.model.skin.ISkinPart; import cc.restfulmc.api.model.skin.Skin; +import lombok.NonNull; import java.awt.*; import java.awt.geom.AffineTransform; diff --git a/API/src/main/java/cc/restfulmc/api/common/renderer/impl/VanillaSkinPartRenderer.java b/API/src/main/java/cc/restfulmc/api/common/renderer/impl/VanillaSkinPartRenderer.java index f18a70d..9d6a1a6 100644 --- a/API/src/main/java/cc/restfulmc/api/common/renderer/impl/VanillaSkinPartRenderer.java +++ b/API/src/main/java/cc/restfulmc/api/common/renderer/impl/VanillaSkinPartRenderer.java @@ -23,10 +23,10 @@ */ package cc.restfulmc.api.common.renderer.impl; -import lombok.NonNull; import cc.restfulmc.api.common.renderer.SkinRenderer; import cc.restfulmc.api.model.skin.ISkinPart; import cc.restfulmc.api.model.skin.Skin; +import lombok.NonNull; import java.awt.*; import java.awt.image.BufferedImage; diff --git a/API/src/main/java/cc/restfulmc/api/common/web/JsonWebRequest.java b/API/src/main/java/cc/restfulmc/api/common/web/JsonWebRequest.java index ed122e9..a67c506 100644 --- a/API/src/main/java/cc/restfulmc/api/common/web/JsonWebRequest.java +++ b/API/src/main/java/cc/restfulmc/api/common/web/JsonWebRequest.java @@ -23,11 +23,11 @@ */ package cc.restfulmc.api.common.web; +import cc.restfulmc.api.config.AppConfig; import lombok.AccessLevel; import lombok.Getter; import lombok.NonNull; import lombok.RequiredArgsConstructor; -import cc.restfulmc.api.config.AppConfig; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; diff --git a/API/src/main/java/cc/restfulmc/api/controller/MojangController.java b/API/src/main/java/cc/restfulmc/api/controller/MojangController.java index c4c295a..3f8c219 100644 --- a/API/src/main/java/cc/restfulmc/api/controller/MojangController.java +++ b/API/src/main/java/cc/restfulmc/api/controller/MojangController.java @@ -23,12 +23,12 @@ */ package cc.restfulmc.api.controller; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.NonNull; -import lombok.extern.log4j.Log4j2; import cc.restfulmc.api.common.MojangServer; import cc.restfulmc.api.exception.impl.BadRequestException; import cc.restfulmc.api.service.MojangService; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.NonNull; +import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/API/src/main/java/cc/restfulmc/api/controller/PlayerController.java b/API/src/main/java/cc/restfulmc/api/controller/PlayerController.java index b332a2f..d2e9a1f 100644 --- a/API/src/main/java/cc/restfulmc/api/controller/PlayerController.java +++ b/API/src/main/java/cc/restfulmc/api/controller/PlayerController.java @@ -23,16 +23,16 @@ */ package cc.restfulmc.api.controller; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.NonNull; -import lombok.extern.log4j.Log4j2; import cc.restfulmc.api.exception.impl.BadRequestException; import cc.restfulmc.api.exception.impl.MojangRateLimitException; import cc.restfulmc.api.exception.impl.ResourceNotFoundException; import cc.restfulmc.api.model.Player; import cc.restfulmc.api.model.cache.CachedPlayer; import cc.restfulmc.api.service.MojangService; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.NonNull; +import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/API/src/main/java/cc/restfulmc/api/controller/ServerController.java b/API/src/main/java/cc/restfulmc/api/controller/ServerController.java index d0a9641..b745b25 100644 --- a/API/src/main/java/cc/restfulmc/api/controller/ServerController.java +++ b/API/src/main/java/cc/restfulmc/api/controller/ServerController.java @@ -23,15 +23,15 @@ */ package cc.restfulmc.api.controller; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.NonNull; -import lombok.extern.log4j.Log4j2; import cc.restfulmc.api.exception.impl.BadRequestException; import cc.restfulmc.api.exception.impl.ResourceNotFoundException; import cc.restfulmc.api.model.MinecraftServer; import cc.restfulmc.api.model.cache.CachedMinecraftServer; import cc.restfulmc.api.service.MojangService; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.NonNull; +import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; diff --git a/API/src/main/java/cc/restfulmc/api/exception/ExceptionControllerAdvice.java b/API/src/main/java/cc/restfulmc/api/exception/ExceptionControllerAdvice.java index 835dcdc..85e47d4 100644 --- a/API/src/main/java/cc/restfulmc/api/exception/ExceptionControllerAdvice.java +++ b/API/src/main/java/cc/restfulmc/api/exception/ExceptionControllerAdvice.java @@ -23,8 +23,8 @@ */ package cc.restfulmc.api.exception; -import lombok.NonNull; import cc.restfulmc.api.model.response.ErrorResponse; +import lombok.NonNull; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; diff --git a/API/src/main/java/cc/restfulmc/api/log/TransactionLogger.java b/API/src/main/java/cc/restfulmc/api/log/TransactionLogger.java index 9fa18a0..399742d 100644 --- a/API/src/main/java/cc/restfulmc/api/log/TransactionLogger.java +++ b/API/src/main/java/cc/restfulmc/api/log/TransactionLogger.java @@ -23,11 +23,11 @@ */ package cc.restfulmc.api.log; +import cc.restfulmc.api.common.IPUtils; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; -import cc.restfulmc.api.common.IPUtils; import org.springframework.core.MethodParameter; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; diff --git a/API/src/main/java/cc/restfulmc/api/model/MinecraftServer.java b/API/src/main/java/cc/restfulmc/api/model/MinecraftServer.java index 7489ae0..5a25326 100644 --- a/API/src/main/java/cc/restfulmc/api/model/MinecraftServer.java +++ b/API/src/main/java/cc/restfulmc/api/model/MinecraftServer.java @@ -23,18 +23,18 @@ */ package cc.restfulmc.api.model; -import com.maxmind.geoip2.model.CityResponse; -import com.maxmind.geoip2.record.City; -import com.maxmind.geoip2.record.Continent; -import com.maxmind.geoip2.record.Country; -import com.maxmind.geoip2.record.Location; -import lombok.*; import cc.restfulmc.api.common.ColorUtils; import cc.restfulmc.api.model.dns.DNSRecord; import cc.restfulmc.api.model.token.JavaServerStatusToken; import cc.restfulmc.api.service.pinger.MinecraftServerPinger; import cc.restfulmc.api.service.pinger.impl.BedrockMinecraftServerPinger; import cc.restfulmc.api.service.pinger.impl.JavaMinecraftServerPinger; +import com.maxmind.geoip2.model.CityResponse; +import com.maxmind.geoip2.record.City; +import com.maxmind.geoip2.record.Continent; +import com.maxmind.geoip2.record.Country; +import com.maxmind.geoip2.record.Location; +import lombok.*; import java.util.ArrayList; import java.util.Arrays; diff --git a/API/src/main/java/cc/restfulmc/api/model/Player.java b/API/src/main/java/cc/restfulmc/api/model/Player.java index 292d55c..9be7389 100644 --- a/API/src/main/java/cc/restfulmc/api/model/Player.java +++ b/API/src/main/java/cc/restfulmc/api/model/Player.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.model; -import lombok.*; import cc.restfulmc.api.model.skin.Skin; import cc.restfulmc.api.model.token.MojangProfileToken; +import lombok.*; import java.util.UUID; diff --git a/API/src/main/java/cc/restfulmc/api/model/cache/CachedMinecraftServer.java b/API/src/main/java/cc/restfulmc/api/model/cache/CachedMinecraftServer.java index ca8a810..0e9bf73 100644 --- a/API/src/main/java/cc/restfulmc/api/model/cache/CachedMinecraftServer.java +++ b/API/src/main/java/cc/restfulmc/api/model/cache/CachedMinecraftServer.java @@ -23,10 +23,10 @@ */ package cc.restfulmc.api.model.cache; +import cc.restfulmc.api.model.MinecraftServer; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonUnwrapped; import lombok.*; -import cc.restfulmc.api.model.MinecraftServer; import org.springframework.data.annotation.Id; import org.springframework.data.redis.core.RedisHash; diff --git a/API/src/main/java/cc/restfulmc/api/model/cache/CachedPlayer.java b/API/src/main/java/cc/restfulmc/api/model/cache/CachedPlayer.java index fafbb92..44360da 100644 --- a/API/src/main/java/cc/restfulmc/api/model/cache/CachedPlayer.java +++ b/API/src/main/java/cc/restfulmc/api/model/cache/CachedPlayer.java @@ -23,16 +23,16 @@ */ package cc.restfulmc.api.model.cache; -import com.fasterxml.jackson.annotation.JsonIgnore; -import lombok.Getter; -import lombok.NonNull; -import lombok.Setter; -import lombok.ToString; import cc.restfulmc.api.model.Cape; import cc.restfulmc.api.model.Player; import cc.restfulmc.api.model.ProfileAction; import cc.restfulmc.api.model.skin.Skin; import cc.restfulmc.api.model.token.MojangProfileToken; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Getter; +import lombok.NonNull; +import lombok.Setter; +import lombok.ToString; import org.springframework.data.annotation.Id; import org.springframework.data.redis.core.RedisHash; diff --git a/API/src/main/java/cc/restfulmc/api/model/dns/impl/ARecord.java b/API/src/main/java/cc/restfulmc/api/model/dns/impl/ARecord.java index e58ec17..42bb2b0 100644 --- a/API/src/main/java/cc/restfulmc/api/model/dns/impl/ARecord.java +++ b/API/src/main/java/cc/restfulmc/api/model/dns/impl/ARecord.java @@ -23,8 +23,8 @@ */ package cc.restfulmc.api.model.dns.impl; -import lombok.*; import cc.restfulmc.api.model.dns.DNSRecord; +import lombok.*; import java.net.InetAddress; diff --git a/API/src/main/java/cc/restfulmc/api/model/dns/impl/SRVRecord.java b/API/src/main/java/cc/restfulmc/api/model/dns/impl/SRVRecord.java index e17573d..54884e4 100644 --- a/API/src/main/java/cc/restfulmc/api/model/dns/impl/SRVRecord.java +++ b/API/src/main/java/cc/restfulmc/api/model/dns/impl/SRVRecord.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.model.dns.impl; +import cc.restfulmc.api.model.dns.DNSRecord; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.*; -import cc.restfulmc.api.model.dns.DNSRecord; import java.net.InetSocketAddress; diff --git a/API/src/main/java/cc/restfulmc/api/model/server/BedrockMinecraftServer.java b/API/src/main/java/cc/restfulmc/api/model/server/BedrockMinecraftServer.java index f3f113d..485ab64 100644 --- a/API/src/main/java/cc/restfulmc/api/model/server/BedrockMinecraftServer.java +++ b/API/src/main/java/cc/restfulmc/api/model/server/BedrockMinecraftServer.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.model.server; -import lombok.*; import cc.restfulmc.api.model.MinecraftServer; import cc.restfulmc.api.model.dns.DNSRecord; +import lombok.*; /** * A Bedrock edition {@link MinecraftServer}. diff --git a/API/src/main/java/cc/restfulmc/api/model/server/JavaMinecraftServer.java b/API/src/main/java/cc/restfulmc/api/model/server/JavaMinecraftServer.java index 008cadb..aab071f 100644 --- a/API/src/main/java/cc/restfulmc/api/model/server/JavaMinecraftServer.java +++ b/API/src/main/java/cc/restfulmc/api/model/server/JavaMinecraftServer.java @@ -23,8 +23,6 @@ */ package cc.restfulmc.api.model.server; -import com.google.gson.annotations.SerializedName; -import lombok.*; import cc.restfulmc.api.common.JavaMinecraftVersion; import cc.restfulmc.api.config.AppConfig; import cc.restfulmc.api.model.MinecraftServer; @@ -32,6 +30,8 @@ import cc.restfulmc.api.model.dns.DNSRecord; import cc.restfulmc.api.model.token.JavaServerChallengeStatusToken; import cc.restfulmc.api.model.token.JavaServerStatusToken; import cc.restfulmc.api.service.MojangService; +import com.google.gson.annotations.SerializedName; +import lombok.*; import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.chat.ComponentSerializer; diff --git a/API/src/main/java/cc/restfulmc/api/model/skin/ISkinPart.java b/API/src/main/java/cc/restfulmc/api/model/skin/ISkinPart.java index 6d4a117..8ac6a41 100644 --- a/API/src/main/java/cc/restfulmc/api/model/skin/ISkinPart.java +++ b/API/src/main/java/cc/restfulmc/api/model/skin/ISkinPart.java @@ -23,11 +23,11 @@ */ package cc.restfulmc.api.model.skin; -import lombok.*; import cc.restfulmc.api.common.renderer.SkinRenderer; import cc.restfulmc.api.common.renderer.impl.BodySkinPartRenderer; import cc.restfulmc.api.common.renderer.impl.IsometricHeadSkinPartRenderer; import cc.restfulmc.api.common.renderer.impl.VanillaSkinPartRenderer; +import lombok.*; import java.awt.image.BufferedImage; diff --git a/API/src/main/java/cc/restfulmc/api/model/skin/Skin.java b/API/src/main/java/cc/restfulmc/api/model/skin/Skin.java index 52efe91..60c918c 100644 --- a/API/src/main/java/cc/restfulmc/api/model/skin/Skin.java +++ b/API/src/main/java/cc/restfulmc/api/model/skin/Skin.java @@ -23,13 +23,13 @@ */ package cc.restfulmc.api.model.skin; +import cc.restfulmc.api.common.ImageUtils; +import cc.restfulmc.api.config.AppConfig; +import cc.restfulmc.api.model.Player; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.JsonObject; import lombok.*; -import cc.restfulmc.api.common.ImageUtils; -import cc.restfulmc.api.config.AppConfig; -import cc.restfulmc.api.model.Player; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; diff --git a/API/src/main/java/cc/restfulmc/api/model/token/JavaServerChallengeStatusToken.java b/API/src/main/java/cc/restfulmc/api/model/token/JavaServerChallengeStatusToken.java index ca015e2..cf62640 100644 --- a/API/src/main/java/cc/restfulmc/api/model/token/JavaServerChallengeStatusToken.java +++ b/API/src/main/java/cc/restfulmc/api/model/token/JavaServerChallengeStatusToken.java @@ -23,8 +23,8 @@ */ package cc.restfulmc.api.model.token; -import lombok.*; import cc.restfulmc.api.model.server.JavaMinecraftServer; +import lombok.*; import java.util.HashMap; import java.util.Map; diff --git a/API/src/main/java/cc/restfulmc/api/model/token/JavaServerStatusToken.java b/API/src/main/java/cc/restfulmc/api/model/token/JavaServerStatusToken.java index 018e201..cb1ff8b 100644 --- a/API/src/main/java/cc/restfulmc/api/model/token/JavaServerStatusToken.java +++ b/API/src/main/java/cc/restfulmc/api/model/token/JavaServerStatusToken.java @@ -23,12 +23,12 @@ */ package cc.restfulmc.api.model.token; +import cc.restfulmc.api.model.server.JavaMinecraftServer; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NonNull; import lombok.ToString; -import cc.restfulmc.api.model.server.JavaMinecraftServer; import java.util.UUID; diff --git a/API/src/main/java/cc/restfulmc/api/model/token/MojangProfileToken.java b/API/src/main/java/cc/restfulmc/api/model/token/MojangProfileToken.java index 1eae0d6..c075be2 100644 --- a/API/src/main/java/cc/restfulmc/api/model/token/MojangProfileToken.java +++ b/API/src/main/java/cc/restfulmc/api/model/token/MojangProfileToken.java @@ -23,13 +23,13 @@ */ package cc.restfulmc.api.model.token; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.google.gson.JsonObject; -import lombok.*; import cc.restfulmc.api.config.AppConfig; import cc.restfulmc.api.model.Cape; import cc.restfulmc.api.model.ProfileAction; import cc.restfulmc.api.model.skin.Skin; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.gson.JsonObject; +import lombok.*; import java.util.Base64; diff --git a/API/src/main/java/cc/restfulmc/api/service/MojangService.java b/API/src/main/java/cc/restfulmc/api/service/MojangService.java index 84785cc..327d487 100644 --- a/API/src/main/java/cc/restfulmc/api/service/MojangService.java +++ b/API/src/main/java/cc/restfulmc/api/service/MojangService.java @@ -163,13 +163,13 @@ public final class MojangService { }, 0L, 60L * 3L * 1000L); // Schedule a task to fetch blocked - // servers from Mojang every 15 minutes. + // servers from Mojang every hour. new Timer().scheduleAtFixedRate(new TimerTask() { @Override public void run() { fetchBlockedServers(); } - }, 0L, 60L * 15L * 1000L); + }, 0L, 60L * 60L * 1000L); } /** diff --git a/API/src/main/java/cc/restfulmc/api/service/pinger/MinecraftServerPinger.java b/API/src/main/java/cc/restfulmc/api/service/pinger/MinecraftServerPinger.java index 705d89e..9926a35 100644 --- a/API/src/main/java/cc/restfulmc/api/service/pinger/MinecraftServerPinger.java +++ b/API/src/main/java/cc/restfulmc/api/service/pinger/MinecraftServerPinger.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.service.pinger; -import lombok.NonNull; import cc.restfulmc.api.model.MinecraftServer; import cc.restfulmc.api.model.dns.DNSRecord; +import lombok.NonNull; /** * A {@link MinecraftServerPinger} is diff --git a/API/src/main/java/cc/restfulmc/api/service/pinger/impl/BedrockMinecraftServerPinger.java b/API/src/main/java/cc/restfulmc/api/service/pinger/impl/BedrockMinecraftServerPinger.java index 196449c..25f2929 100644 --- a/API/src/main/java/cc/restfulmc/api/service/pinger/impl/BedrockMinecraftServerPinger.java +++ b/API/src/main/java/cc/restfulmc/api/service/pinger/impl/BedrockMinecraftServerPinger.java @@ -23,8 +23,6 @@ */ package cc.restfulmc.api.service.pinger.impl; -import lombok.NonNull; -import lombok.extern.log4j.Log4j2; import cc.restfulmc.api.common.packet.impl.bedrock.BedrockUnconnectedPingPacket; import cc.restfulmc.api.common.packet.impl.bedrock.BedrockUnconnectedPongPacket; import cc.restfulmc.api.exception.impl.BadRequestException; @@ -32,6 +30,8 @@ import cc.restfulmc.api.exception.impl.ResourceNotFoundException; import cc.restfulmc.api.model.dns.DNSRecord; import cc.restfulmc.api.model.server.BedrockMinecraftServer; import cc.restfulmc.api.service.pinger.MinecraftServerPinger; +import lombok.NonNull; +import lombok.extern.log4j.Log4j2; import java.io.IOException; import java.net.DatagramSocket; diff --git a/API/src/main/java/cc/restfulmc/api/service/pinger/impl/JavaMinecraftServerPinger.java b/API/src/main/java/cc/restfulmc/api/service/pinger/impl/JavaMinecraftServerPinger.java index 5ca0746..48d6402 100644 --- a/API/src/main/java/cc/restfulmc/api/service/pinger/impl/JavaMinecraftServerPinger.java +++ b/API/src/main/java/cc/restfulmc/api/service/pinger/impl/JavaMinecraftServerPinger.java @@ -23,8 +23,6 @@ */ package cc.restfulmc.api.service.pinger.impl; -import lombok.NonNull; -import lombok.extern.log4j.Log4j2; import cc.restfulmc.api.common.JavaMinecraftVersion; import cc.restfulmc.api.common.packet.impl.java.tcp.JavaHandshakingInSetProtocolPacket; import cc.restfulmc.api.common.packet.impl.java.tcp.JavaStatusInStartPacket; @@ -40,6 +38,8 @@ import cc.restfulmc.api.model.server.JavaMinecraftServer; import cc.restfulmc.api.model.token.JavaServerChallengeStatusToken; import cc.restfulmc.api.model.token.JavaServerStatusToken; import cc.restfulmc.api.service.pinger.MinecraftServerPinger; +import lombok.NonNull; +import lombok.extern.log4j.Log4j2; import java.io.DataInputStream; import java.io.DataOutputStream; diff --git a/API/src/test/java/cc/restfulmc/api/test/controller/MojangControllerTests.java b/API/src/test/java/cc/restfulmc/api/test/controller/MojangControllerTests.java index 4c6328b..63280f0 100644 --- a/API/src/test/java/cc/restfulmc/api/test/controller/MojangControllerTests.java +++ b/API/src/test/java/cc/restfulmc/api/test/controller/MojangControllerTests.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.test.controller; -import lombok.NonNull; import cc.restfulmc.api.controller.MojangController; import cc.restfulmc.api.test.config.TestRedisConfig; +import lombok.NonNull; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; diff --git a/API/src/test/java/cc/restfulmc/api/test/controller/PlayerControllerTests.java b/API/src/test/java/cc/restfulmc/api/test/controller/PlayerControllerTests.java index 3e42b6a..8022bd0 100644 --- a/API/src/test/java/cc/restfulmc/api/test/controller/PlayerControllerTests.java +++ b/API/src/test/java/cc/restfulmc/api/test/controller/PlayerControllerTests.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.test.controller; -import lombok.NonNull; import cc.restfulmc.api.controller.PlayerController; import cc.restfulmc.api.test.config.TestRedisConfig; +import lombok.NonNull; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; diff --git a/API/src/test/java/cc/restfulmc/api/test/controller/ServerControllerTests.java b/API/src/test/java/cc/restfulmc/api/test/controller/ServerControllerTests.java index 8c97107..0067f67 100644 --- a/API/src/test/java/cc/restfulmc/api/test/controller/ServerControllerTests.java +++ b/API/src/test/java/cc/restfulmc/api/test/controller/ServerControllerTests.java @@ -23,9 +23,9 @@ */ package cc.restfulmc.api.test.controller; -import lombok.NonNull; import cc.restfulmc.api.controller.ServerController; import cc.restfulmc.api.test.config.TestRedisConfig; +import lombok.NonNull; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;