diff --git a/src/main/java/net/tcpshield/tcpshield/TCPShieldPlugin.java b/src/main/java/net/tcpshield/tcpshield/TCPShieldPlugin.java index ce6eeb3..1d5ebd7 100644 --- a/src/main/java/net/tcpshield/tcpshield/TCPShieldPlugin.java +++ b/src/main/java/net/tcpshield/tcpshield/TCPShieldPlugin.java @@ -49,7 +49,7 @@ default void initialization() { String[] versionParts = jvmVersion.split("\\."); int baseVersion = Integer.parseInt(versionParts[0]); if (baseVersion < 11) // Java 8, and below, starts with 1, but since we are using Java 11 we can ignore sub values - this.getDebugger().warn("The Java version you are running is outdated for TCPShield and may cause issues. Update to atleast Java 11. Your version: Java %s", jvmVersion); + this.getDebugger().warn("The Java version you are running is outdated for TCPShield and may cause issues. Update to at least Java 11. Your version: Java %s", jvmVersion); } catch (Throwable t) { this.getDebugger().error("Failed to check java version for string: " + jvmVersion); } diff --git a/src/main/java/net/tcpshield/tcpshield/bukkit/BukkitConfig.java b/src/main/java/net/tcpshield/tcpshield/bukkit/BukkitConfig.java index 7cfbce0..89edb07 100644 --- a/src/main/java/net/tcpshield/tcpshield/bukkit/BukkitConfig.java +++ b/src/main/java/net/tcpshield/tcpshield/bukkit/BukkitConfig.java @@ -53,7 +53,7 @@ protected void reset() throws ConfigResetException { // Just ignore since it either does not exist, or we can overwrite } - try (InputStream in = plugin.getResource("config.yml")) { // Have to use Bukkit's resource streaming or the resource wont be found + try (InputStream in = plugin.getResource("config.yml")) { // Have to use Bukkit's resource streaming or the resource won't be found Files.copy(in, configFile.toPath()); } } catch (Exception e) { diff --git a/src/main/java/net/tcpshield/tcpshield/bukkit/paper/handler/PaperPlayer.java b/src/main/java/net/tcpshield/tcpshield/bukkit/paper/handler/PaperPlayer.java index b4d9ddf..7e5d455 100644 --- a/src/main/java/net/tcpshield/tcpshield/bukkit/paper/handler/PaperPlayer.java +++ b/src/main/java/net/tcpshield/tcpshield/bukkit/paper/handler/PaperPlayer.java @@ -20,7 +20,7 @@ public PaperPlayer(PlayerHandshakeEvent handshakeEvent) { /** * Trys to grab the UUID of the handshake - * @return If found, the corrosponding uuid, if not, unknown + * @return If found, the corresponding uuid, if not, unknown */ @Override public String getUUID() { diff --git a/src/main/java/net/tcpshield/tcpshield/bungee/BungeeConfig.java b/src/main/java/net/tcpshield/tcpshield/bungee/BungeeConfig.java index b769d12..c728f73 100644 --- a/src/main/java/net/tcpshield/tcpshield/bungee/BungeeConfig.java +++ b/src/main/java/net/tcpshield/tcpshield/bungee/BungeeConfig.java @@ -9,10 +9,8 @@ import net.tcpshield.tcpshield.util.exception.config.ConfigReloadException; import net.tcpshield.tcpshield.util.exception.config.ConfigResetException; import net.tcpshield.tcpshield.util.exception.phase.ConfigException; -import net.tcpshield.tcpshield.velocity.VelocityConfig; import java.io.File; -import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; diff --git a/src/main/java/net/tcpshield/tcpshield/bungee/handler/BungeePlayer.java b/src/main/java/net/tcpshield/tcpshield/bungee/handler/BungeePlayer.java index f8f427d..b088b68 100644 --- a/src/main/java/net/tcpshield/tcpshield/bungee/handler/BungeePlayer.java +++ b/src/main/java/net/tcpshield/tcpshield/bungee/handler/BungeePlayer.java @@ -27,7 +27,7 @@ public BungeePlayer(PendingConnection pendingConnection) { /** * Trys to grab the UUID of the handshake * - * @return If found, the corrosponding uuid, if not, unknown + * @return If found, the corresponding uuid, if not, unknown */ @Override public String getUUID() { diff --git a/src/main/java/net/tcpshield/tcpshield/provider/ConfigProvider.java b/src/main/java/net/tcpshield/tcpshield/provider/ConfigProvider.java index 85c35be..1d91603 100644 --- a/src/main/java/net/tcpshield/tcpshield/provider/ConfigProvider.java +++ b/src/main/java/net/tcpshield/tcpshield/provider/ConfigProvider.java @@ -62,7 +62,7 @@ public File getConfigFile() { /* * Plugin Constants */ - protected final long maxTimestampDifference = 3; // In Unix Timesteps (Seconds) + protected final long maxTimestampDifference = 3; // In Unix Timestamps (Seconds) public long getMaxTimestampDifference() { @@ -74,7 +74,7 @@ public long getMaxTimestampDifference() { */ /** - * Deletes the current config saved to the disk and reinstalls the default config + * Deletes the current config saved to the disk and installs the default config * @throws ConfigResetException Thrown if resetting fails */ protected abstract void reset() throws ConfigResetException; @@ -94,7 +94,7 @@ public long getMaxTimestampDifference() { /** * Checks the provided nodes to see if they exist in the config * @param nodes The nodes to check - * @throws ConfigException Thrown when a node isnt found + * @throws ConfigException Thrown when a node isn't found */ protected abstract void checkNodes(String... nodes) throws ConfigException; diff --git a/src/main/java/net/tcpshield/tcpshield/util/Debugger.java b/src/main/java/net/tcpshield/tcpshield/util/Debugger.java index 0766d79..423c890 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/Debugger.java +++ b/src/main/java/net/tcpshield/tcpshield/util/Debugger.java @@ -76,7 +76,7 @@ public void exception(Exception exception) { protected final Logger logger; /** - * Non-accessable constructor for creating a debugger + * Non-accessible constructor for creating a debugger * @param logger The plugin's logger */ private Debugger(Logger logger) { @@ -87,21 +87,21 @@ private Debugger(Logger logger) { /** * Outputs debug information with log level "INFO" * @param format The output string to be formatted - * @param formats The formarts for the string + * @param formats The formats for the string */ public abstract void info(String format, Object... formats); /** * Outputs debug information with log level "WARNING" * @param format The output string to be formatted - * @param formats The formarts for the string + * @param formats The formats for the string */ public abstract void warn(String format, Object... formats); /** * Outputs debug information with log level "SEVERE" * @param format The output string to be formatted - * @param formats The formarts for the string + * @param formats The formats for the string */ public abstract void error(String format, Object... formats); diff --git a/src/main/java/net/tcpshield/tcpshield/util/ReflectionUtil.java b/src/main/java/net/tcpshield/tcpshield/util/ReflectionUtil.java index ad7d1ec..eff7764 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/ReflectionUtil.java +++ b/src/main/java/net/tcpshield/tcpshield/util/ReflectionUtil.java @@ -7,7 +7,7 @@ import java.lang.reflect.Field; /** - * A util for reflection and manipulation + * An util for reflection and manipulation */ public class ReflectionUtil { @@ -46,7 +46,7 @@ public static void setFinalField(Object object, Field field, Object value) thro // if (modifiersField == null) { // try { // modifiersField = getDeclaredField(Field.class, "modifiers"); -// } catch (ReflectionException e) { // workaround for when searching for the modifiers field on Java 12 or higher +// } catch (ReflectionException e) { // workaround for when searching for the modifiers' field on Java 12 or higher // try { // Method getDeclaredFields0 = Class.class.getDeclaredMethod("getDeclaredFields0", boolean.class); // getDeclaredFields0.setAccessible(true); diff --git a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/CIDRException.java b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/CIDRException.java index cd84688..c9fca1e 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/CIDRException.java +++ b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/CIDRException.java @@ -8,7 +8,7 @@ public class CIDRException extends TCPShieldException { public CIDRException(Throwable throwable) { - super("An exception occured during the CIDR process", throwable); + super("An exception occurred during the CIDR process", throwable); } diff --git a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ConfigException.java b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ConfigException.java index 5e4bdda..63f5836 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ConfigException.java +++ b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ConfigException.java @@ -3,12 +3,12 @@ import net.tcpshield.tcpshield.util.exception.TCPShieldException; /** - * An exception thrown during the config loading, reloeading, saving, etc. process of TCPShield + * An exception thrown during the config loading, reloading, saving, etc. process of TCPShield */ public class ConfigException extends TCPShieldException { public ConfigException(Throwable throwable) { - super("An exception occured during the config process", throwable); + super("An exception occurred during the config process", throwable); } diff --git a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/HandshakeException.java b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/HandshakeException.java index 02232b2..c2cc82a 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/HandshakeException.java +++ b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/HandshakeException.java @@ -8,7 +8,7 @@ public class HandshakeException extends TCPShieldException { public HandshakeException(Throwable throwable) { - super("An exception occured during the handshake process", throwable); + super("An exception occurred during the handshake process", throwable); } diff --git a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/InitializationException.java b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/InitializationException.java index f1fab20..164265e 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/InitializationException.java +++ b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/InitializationException.java @@ -8,7 +8,7 @@ public class InitializationException extends TCPShieldException { public InitializationException(Throwable throwable) { - super("An exception occured during the initalization process", throwable); + super("An exception occurred during the initialization process", throwable); } diff --git a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ReflectionException.java b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ReflectionException.java index bfd45fb..07d0cd2 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ReflectionException.java +++ b/src/main/java/net/tcpshield/tcpshield/util/exception/phase/ReflectionException.java @@ -8,7 +8,7 @@ public class ReflectionException extends TCPShieldException { public ReflectionException(Throwable throwable) { - super("An exception occured during the reflection process", throwable); + super("An exception occurred during the reflection process", throwable); } diff --git a/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRMatcher.java b/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRMatcher.java index 34c083a..d9efb05 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRMatcher.java +++ b/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRMatcher.java @@ -13,7 +13,7 @@ public abstract class CIDRMatcher { /** * Creates a CIDRMatcher from a CIDR matching regex * @param cidrMatchString The string containing the CIDR matching regex - * @return The corrosponding CIDRMatcher + * @return The corresponding CIDRMatcher */ public static CIDRMatcher create(String cidrMatchString) { return new CIDRMatcher(cidrMatchString) { diff --git a/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRValidator.java b/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRValidator.java index 272fdd4..afb5ea6 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRValidator.java +++ b/src/main/java/net/tcpshield/tcpshield/util/validation/cidr/CIDRValidator.java @@ -18,7 +18,7 @@ public class CIDRValidator { private final File ipWhitelistFolder; private final List cidrMatchers; - private final Set cache = new HashSet<>(); // Max potential size is equilivent to the amount of whitelisted IP's + private final Set cache = new HashSet<>(); // Max potential size is equivalent to the amount of whitelisted IP's public CIDRValidator(TCPShieldPlugin plugin) throws CIDRException { this.plugin = plugin; @@ -43,7 +43,7 @@ private List loadCIDRMatchers(List whitelists) { try { matchers.add(CIDRMatcher.create(whitelist)); } catch (Exception e) { - plugin.getDebugger().warn("Exception occured while creating CIDRMatcher for \"%s\". Ignoring it.", whitelist); + plugin.getDebugger().warn("Exception occurred while creating CIDRMatcher for \"%s\". Ignoring it.", whitelist); plugin.getDebugger().exception(e); } diff --git a/src/main/java/net/tcpshield/tcpshield/util/validation/timestamp/impl/HTPDateTimestampValidator.java b/src/main/java/net/tcpshield/tcpshield/util/validation/timestamp/impl/HTPDateTimestampValidator.java index d82a2ed..f62f6fc 100644 --- a/src/main/java/net/tcpshield/tcpshield/util/validation/timestamp/impl/HTPDateTimestampValidator.java +++ b/src/main/java/net/tcpshield/tcpshield/util/validation/timestamp/impl/HTPDateTimestampValidator.java @@ -20,7 +20,7 @@ /** * A timestamp validator that offsets system time with Google's to sync - * tiemstamps + * timestamps */ public class HTPDateTimestampValidator extends TimestampValidator { diff --git a/src/main/java/net/tcpshield/tcpshield/velocity/handler/VelocityPacket.java b/src/main/java/net/tcpshield/tcpshield/velocity/handler/VelocityPacket.java index 13ae5f3..965b758 100644 --- a/src/main/java/net/tcpshield/tcpshield/velocity/handler/VelocityPacket.java +++ b/src/main/java/net/tcpshield/tcpshield/velocity/handler/VelocityPacket.java @@ -4,7 +4,6 @@ import net.tcpshield.tcpshield.provider.PacketProvider; import net.tcpshield.tcpshield.util.ReflectionUtil; import net.tcpshield.tcpshield.util.exception.manipulate.PacketManipulationException; -import net.tcpshield.tcpshield.util.exception.phase.HandshakeException; import net.tcpshield.tcpshield.util.exception.phase.InitializationException; import net.tcpshield.tcpshield.util.exception.phase.ReflectionException; @@ -87,7 +86,7 @@ public void setPacketHostname(String hostname) throws PacketManipulationExceptio } /** - * Adapted from https://github.com/VelocityPowered/Velocity/blob/17e6944daea8130e03903ccdfbf63f111c573849/proxy/src/main/java/com/velocitypowered/proxy/connection/client/HandshakeSessionHandler.java + * Adapted from GitHub */ private String cleanAddress(String hostname) { // Clean out any anything after any zero bytes (this includes BungeeCord forwarding and the diff --git a/src/main/resources/velocity-plugin.json b/src/main/resources/velocity-plugin.json index 99dabfa..fcd439c 100644 --- a/src/main/resources/velocity-plugin.json +++ b/src/main/resources/velocity-plugin.json @@ -13,4 +13,4 @@ } ], "main": "net.tcpshield.tcpshield.velocity.TCPShieldVelocity" -} \ No newline at end of file +}