diff --git a/src/main/java/dev/plex/Plex.java b/src/main/java/dev/plex/Plex.java index 411e3d5..27210a4 100644 --- a/src/main/java/dev/plex/Plex.java +++ b/src/main/java/dev/plex/Plex.java @@ -21,14 +21,13 @@ import dev.plex.storage.StorageType; import dev.plex.util.PlexLog; import dev.plex.util.PlexUtils; import dev.plex.world.CustomWorld; +import java.util.UUID; import lombok.Getter; import lombok.Setter; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; -import java.util.UUID; - @Getter @Setter public class Plex extends JavaPlugin @@ -82,7 +81,8 @@ public class Plex extends JavaPlugin { PlexUtils.testConnections(); PlexLog.log("Connected to " + storageType.name().toUpperCase()); - } catch (Exception e) + } + catch (Exception e) { PlexLog.error("Failed to connect to " + storageType.name().toUpperCase()); e.printStackTrace(); @@ -96,7 +96,8 @@ public class Plex extends JavaPlugin { redisConnection.getJedis(); PlexLog.log("Connected to Redis!"); - } else + } + else { PlexLog.log("Redis is disabled in the configuration file, not connecting."); } @@ -104,7 +105,8 @@ public class Plex extends JavaPlugin if (storageType == StorageType.MONGODB) { mongoPlayerData = new MongoPlayerData(); - } else + } + else { sqlPlayerData = new SQLPlayerData(); } @@ -149,7 +151,8 @@ public class Plex extends JavaPlugin if (mongoPlayerData != null) //back to mongo checking { mongoPlayerData.update(plexPlayer); //update the player's document - } else if (sqlPlayerData != null) //sql checking + } + else if (sqlPlayerData != null) //sql checking { sqlPlayerData.update(plexPlayer); } diff --git a/src/main/java/dev/plex/command/PlexCommand.java b/src/main/java/dev/plex/command/PlexCommand.java index 18fb5ad..2dbaac1 100644 --- a/src/main/java/dev/plex/command/PlexCommand.java +++ b/src/main/java/dev/plex/command/PlexCommand.java @@ -436,8 +436,9 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC /** * Converts usage to a component - * + *
* s The usage to convert
+ *
* @return A Kyori component stating the usage
*/
protected Component usage(String s)
diff --git a/src/main/java/dev/plex/command/impl/DebugCMD.java b/src/main/java/dev/plex/command/impl/DebugCMD.java
index 17449b5..1da9fcc 100644
--- a/src/main/java/dev/plex/command/impl/DebugCMD.java
+++ b/src/main/java/dev/plex/command/impl/DebugCMD.java
@@ -1,7 +1,6 @@
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
-import dev.plex.Plex;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
diff --git a/src/main/java/dev/plex/config/Config.java b/src/main/java/dev/plex/config/Config.java
index c37a32e..bd4d185 100644
--- a/src/main/java/dev/plex/config/Config.java
+++ b/src/main/java/dev/plex/config/Config.java
@@ -25,8 +25,9 @@ public class Config extends YamlConfiguration
/**
* Creates a config object
+ *
* @param plugin The plugin instance
- * @param name The file name
+ * @param name The file name
*/
public Config(Plex plugin, String name)
{
diff --git a/src/main/java/dev/plex/event/PunishedPlayerEvent.java b/src/main/java/dev/plex/event/PunishedPlayerEvent.java
index 603b68f..9f724b4 100644
--- a/src/main/java/dev/plex/event/PunishedPlayerEvent.java
+++ b/src/main/java/dev/plex/event/PunishedPlayerEvent.java
@@ -27,6 +27,7 @@ public abstract class PunishedPlayerEvent extends PlayerEvent implements Cancell
/**
* Creates an event object
+ *
* @param punishedPlayer The player who was punished
* @see PunishedPlayer
*/
diff --git a/src/main/java/dev/plex/event/PunishedPlayerFreezeEvent.java b/src/main/java/dev/plex/event/PunishedPlayerFreezeEvent.java
index d165040..a753974 100644
--- a/src/main/java/dev/plex/event/PunishedPlayerFreezeEvent.java
+++ b/src/main/java/dev/plex/event/PunishedPlayerFreezeEvent.java
@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
//TODO: Event doesn't look like it is called
+
/**
* Event that is called when a player is frozen or unfrozen
*/
@@ -21,8 +22,9 @@ public class PunishedPlayerFreezeEvent extends PunishedPlayerEvent implements Ca
/**
* Creates a new event instance
+ *
* @param punishedPlayer The player who was punished
- * @param frozen The new frozen status
+ * @param frozen The new frozen status
*/
public PunishedPlayerFreezeEvent(PunishedPlayer punishedPlayer, boolean frozen)
{
diff --git a/src/main/java/dev/plex/event/PunishedPlayerMuteEvent.java b/src/main/java/dev/plex/event/PunishedPlayerMuteEvent.java
index 5470b55..6d76cc4 100644
--- a/src/main/java/dev/plex/event/PunishedPlayerMuteEvent.java
+++ b/src/main/java/dev/plex/event/PunishedPlayerMuteEvent.java
@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
//TODO: Event doesn't look like it is called
+
/**
* Event that is called when a player is frozen or unfrozen
*/
@@ -21,8 +22,9 @@ public class PunishedPlayerMuteEvent extends PunishedPlayerEvent implements Canc
/**
* Creates a new event instance
+ *
* @param punishedPlayer The player who was punished
- * @param muted The new muted status
+ * @param muted The new muted status
*/
public PunishedPlayerMuteEvent(PunishedPlayer punishedPlayer, boolean muted)
{
diff --git a/src/main/java/dev/plex/listener/impl/BanListener.java b/src/main/java/dev/plex/listener/impl/BanListener.java
index 0afb8d3..9014b12 100644
--- a/src/main/java/dev/plex/listener/impl/BanListener.java
+++ b/src/main/java/dev/plex/listener/impl/BanListener.java
@@ -6,12 +6,11 @@ import dev.plex.player.PunishedPlayer;
import dev.plex.punishment.PunishmentType;
import dev.plex.util.MojangUtils;
import dev.plex.util.PlexUtils;
+import java.time.format.DateTimeFormatter;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
-import java.time.format.DateTimeFormatter;
-
public class BanListener extends PlexListener
{
private final String banUrl = plugin.config.getString("banning.ban_url");
diff --git a/src/main/java/dev/plex/listener/impl/PlayerListener.java b/src/main/java/dev/plex/listener/impl/PlayerListener.java
index 3b58f3a..935ecdc 100644
--- a/src/main/java/dev/plex/listener/impl/PlayerListener.java
+++ b/src/main/java/dev/plex/listener/impl/PlayerListener.java
@@ -8,6 +8,8 @@ import dev.plex.listener.PlexListener;
import dev.plex.player.PlexPlayer;
import dev.plex.player.PunishedPlayer;
import dev.plex.util.PlexLog;
+import java.util.Collections;
+import java.util.UUID;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -18,9 +20,6 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
-import java.util.Collections;
-import java.util.UUID;
-
public class PlayerListener extends PlexListener
{
private final MongoPlayerData mongoPlayerData = plugin.getMongoPlayerData() != null ? plugin.getMongoPlayerData() : null;
@@ -38,7 +37,8 @@ public class PlayerListener extends PlexListener
{
player.setOp(true);
PlexLog.debug("Automatically opped " + player.getName() + " since ranks are enabled.");
- } else if (plugin.getSystem().equalsIgnoreCase("permissions"))
+ }
+ else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
player.setOp(false);
PlexLog.debug("Automatically deopped " + player.getName() + " since ranks are disabled.");
@@ -51,7 +51,8 @@ public class PlayerListener extends PlexListener
plexPlayer.setName(player.getName()); //set the name of the player
plexPlayer.setIps(Collections.singletonList(player.getAddress().getAddress().getHostAddress().trim())); //set the arraylist of ips
DataUtils.insert(plexPlayer); // insert data in some wack db
- } else
+ }
+ else
{
plexPlayer = DataUtils.getPlayer(player.getUniqueId());
}
@@ -62,7 +63,8 @@ public class PlayerListener extends PlexListener
{
punishedPlayer = new PunishedPlayer(player.getUniqueId());
PlayerCache.getPunishedPlayerMap().put(player.getUniqueId(), punishedPlayer);
- } else
+ }
+ else
{
punishedPlayer = PlayerCache.getPunishedPlayer(player.getUniqueId());
}
@@ -76,8 +78,8 @@ public class PlayerListener extends PlexListener
{
event.joinMessage(
Component.text(ChatColor.AQUA + player.getName() + " is ").color(NamedTextColor.AQUA).append(LegacyComponentSerializer.legacyAmpersand().deserialize(loginMessage))
- .append(Component.newline())
- .append(Component.text(player.getName() + " joined the game").color(NamedTextColor.YELLOW))
+ .append(Component.newline())
+ .append(Component.text(player.getName() + " joined the game").color(NamedTextColor.YELLOW))
);
}
}
@@ -96,7 +98,8 @@ public class PlayerListener extends PlexListener
if (mongoPlayerData != null) //back to mongo checking
{
mongoPlayerData.update(plexPlayer); //update the player's document
- } else if (sqlPlayerData != null) //sql checking
+ }
+ else if (sqlPlayerData != null) //sql checking
{
sqlPlayerData.update(plexPlayer);
}
diff --git a/src/main/java/dev/plex/listener/impl/ServerListener.java b/src/main/java/dev/plex/listener/impl/ServerListener.java
index e3a633c..584d6d1 100644
--- a/src/main/java/dev/plex/listener/impl/ServerListener.java
+++ b/src/main/java/dev/plex/listener/impl/ServerListener.java
@@ -3,13 +3,12 @@ package dev.plex.listener.impl;
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import dev.plex.listener.PlexListener;
import dev.plex.util.PlexUtils;
+import java.util.List;
+import java.util.stream.Collectors;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
-import java.util.List;
-import java.util.stream.Collectors;
-
public class ServerListener extends PlexListener
{
@EventHandler
@@ -27,7 +26,8 @@ public class ServerListener extends PlexListener
motd.append(PlexUtils.randomChatColor()).append(word).append(" ");
}
event.motd(LegacyComponentSerializer.legacyAmpersand().deserialize(motd.toString().trim()));
- } else
+ }
+ else
{
event.motd(LegacyComponentSerializer.legacyAmpersand().deserialize(baseMotd.trim()));
}
diff --git a/src/main/java/dev/plex/listener/impl/WorldListener.java b/src/main/java/dev/plex/listener/impl/WorldListener.java
index 5b02573..3b032d5 100644
--- a/src/main/java/dev/plex/listener/impl/WorldListener.java
+++ b/src/main/java/dev/plex/listener/impl/WorldListener.java
@@ -8,6 +8,9 @@ import dev.plex.rank.enums.Rank;
import dev.plex.rank.enums.Title;
import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
@@ -18,10 +21,6 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.jetbrains.annotations.NotNull;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-
public class WorldListener extends PlexListener
{
@@ -34,15 +33,27 @@ public class WorldListener extends PlexListener
if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
String permission = plugin.config.getString("worlds." + world.getName().toLowerCase() + ".permission");
- if (permission == null) return;
- if (player.hasPermission(permission)) return;
- } else if (plugin.getSystem().equalsIgnoreCase("ranks"))
+ if (permission == null)
+ {
+ return;
+ }
+ if (player.hasPermission(permission))
+ {
+ return;
+ }
+ }
+ else if (plugin.getSystem().equalsIgnoreCase("ranks"))
{
if (plugin.config.contains("worlds." + world.getName().toLowerCase() + ".requiredLevels"))
{
@NotNull List