From 2b78d730952dd819b89b51e6c47e21a7a1760395 Mon Sep 17 00:00:00 2001 From: CJ Burkey Date: Wed, 15 May 2024 21:38:46 -0400 Subject: [PATCH] Start working on loading --- .../com/cjburkey/claimchunk/ClaimChunk.java | 4 +- .../claimchunk/chunk/ChunkHandler.java | 49 +++++++++--------- .../data/newdata/BulkMySQLDataHandler.java | 10 ---- .../data/newdata/IClaimChunkDataHandler.java | 22 ++++---- .../data/newdata/JsonDataHandler.java | 23 ++------- .../data/newdata/MySQLDataHandler.java | 51 ------------------- .../SqLiteDataHandler.java} | 32 +++++------- .../SqLiteTableMigrationManager.java} | 4 +- .../{journaled => sqlite}/SqLiteWrapper.java | 43 ++++++++++++++-- .../layer/PlaceholderInitLayer.java | 2 + 10 files changed, 98 insertions(+), 142 deletions(-) rename src/main/java/com/cjburkey/claimchunk/data/{journaled/JournaledDataHandler.java => sqlite/SqLiteDataHandler.java} (93%) rename src/main/java/com/cjburkey/claimchunk/data/{journaled/TableMigrationManager.java => sqlite/SqLiteTableMigrationManager.java} (98%) rename src/main/java/com/cjburkey/claimchunk/data/{journaled => sqlite}/SqLiteWrapper.java (88%) diff --git a/src/main/java/com/cjburkey/claimchunk/ClaimChunk.java b/src/main/java/com/cjburkey/claimchunk/ClaimChunk.java index 2d42633..73a1f5c 100644 --- a/src/main/java/com/cjburkey/claimchunk/ClaimChunk.java +++ b/src/main/java/com/cjburkey/claimchunk/ClaimChunk.java @@ -6,8 +6,8 @@ import com.cjburkey.claimchunk.cmd.*; import com.cjburkey.claimchunk.config.ClaimChunkWorldProfileHandler; import com.cjburkey.claimchunk.config.ccconfig.*; -import com.cjburkey.claimchunk.data.journaled.JournaledDataHandler; import com.cjburkey.claimchunk.data.newdata.*; +import com.cjburkey.claimchunk.data.sqlite.SqLiteDataHandler; import com.cjburkey.claimchunk.event.*; import com.cjburkey.claimchunk.i18n.V2JsonMessages; import com.cjburkey.claimchunk.layer.PlaceholderInitLayer; @@ -388,7 +388,7 @@ private boolean initDataHandler() { }*/ if (dataHandler == null) { dataHandler = - new JournaledDataHandler( + new SqLiteDataHandler( new File(getDataFolder(), "/data/claimAndPlayerData.sqlite3")); } Utils.debug("Using data handler \"%s\"", dataHandler.getClass().getName()); diff --git a/src/main/java/com/cjburkey/claimchunk/chunk/ChunkHandler.java b/src/main/java/com/cjburkey/claimchunk/chunk/ChunkHandler.java index cef9bc5..0ef8369 100644 --- a/src/main/java/com/cjburkey/claimchunk/chunk/ChunkHandler.java +++ b/src/main/java/com/cjburkey/claimchunk/chunk/ChunkHandler.java @@ -28,13 +28,13 @@ public ChunkHandler(IClaimChunkDataHandler dataHandler, ClaimChunk claimChunk) { * Result returned by the {@link #fillClaimInto(String, int, int, int, int, UUID, Collection)} * and {@link #fillClaim(String, int, int, int, UUID)} methods. */ - public static enum FloodClaimResult { + public enum FloodClaimResult { /** The method completed without issues. */ - SUCCESSFULL, + SUCCESSFUL, /** The method recursed too many times and aborted due to that. */ - TOO_MANY_RECUSIONS, + TOO_MANY_RECURSIONS, /** The collection got too big and the method aborted due to that. */ COLLECTION_TOO_BIG, @@ -43,13 +43,13 @@ public static enum FloodClaimResult { * The algorithm hit a claimed chunk that did not belong to the player and aborted due to * this */ - HIT_NONPLAYER_CLAIM; + HIT_NONPLAYER_CLAIM, } /** - * Claims several chunks at once for a player. This method is very unsafe at it's own as it does + * Claims several chunks at once for a player. This method is very unsafe at its own as it does * not test whether the player can actually claim that chunk. This means that ownership can be - * overridden. And the player can go over it's quota as well + * overridden. And the player can go over its quota as well * * @param chunks The chunks to claim * @param player The player that claims these chunks @@ -110,19 +110,19 @@ public ChunkPos claimChunk(String world, int x, int z, UUID player) { - getClaimed(player)); Map.Entry, FloodClaimResult> result = fillClaim(world, x - 1, z, maxArea, player); - if (result.getValue() == FloodClaimResult.SUCCESSFULL) { + if (result.getValue() == FloodClaimResult.SUCCESSFUL) { claimAll(result.getKey(), player); } else { result = fillClaim(world, x + 1, z, maxArea, player); - if (result.getValue() == FloodClaimResult.SUCCESSFULL) { + if (result.getValue() == FloodClaimResult.SUCCESSFUL) { claimAll(result.getKey(), player); } else { result = fillClaim(world, x, z - 1, maxArea, player); - if (result.getValue() == FloodClaimResult.SUCCESSFULL) { + if (result.getValue() == FloodClaimResult.SUCCESSFUL) { claimAll(result.getKey(), player); } else { result = fillClaim(world, x, z + 1, maxArea, player); - if (result.getValue() == FloodClaimResult.SUCCESSFULL) { + if (result.getValue() == FloodClaimResult.SUCCESSFUL) { claimAll(result.getKey(), player); } } @@ -161,19 +161,19 @@ private FloodClaimResult fillClaimInto( UUID player, Collection collector) { if (recursions == 0) { - return FloodClaimResult.TOO_MANY_RECUSIONS; + return FloodClaimResult.TOO_MANY_RECURSIONS; } if (collector.size() > maxSize) { return FloodClaimResult.COLLECTION_TOO_BIG; } ChunkPos claimingPosition = new ChunkPos(world, x, z); if (collector.contains(claimingPosition)) { - return FloodClaimResult.SUCCESSFULL; + return FloodClaimResult.SUCCESSFUL; } UUID owner = getOwner(claimingPosition); if (owner != null) { if (owner.equals(player)) { - return FloodClaimResult.SUCCESSFULL; // Hit player claim, do not claim it + return FloodClaimResult.SUCCESSFUL; // Hit player claim, do not claim it } else { return FloodClaimResult.HIT_NONPLAYER_CLAIM; // Hit player claim, do not claim it } @@ -181,15 +181,15 @@ private FloodClaimResult fillClaimInto( collector.add(claimingPosition); FloodClaimResult result = fillClaimInto(world, x - 1, z, --recursions, maxSize, player, collector); - if (result != FloodClaimResult.SUCCESSFULL) { + if (result != FloodClaimResult.SUCCESSFUL) { return result; } result = fillClaimInto(world, x + 1, z, recursions, maxSize, player, collector); - if (result != FloodClaimResult.SUCCESSFULL) { + if (result != FloodClaimResult.SUCCESSFUL) { return result; } result = fillClaimInto(world, x, z - 1, recursions, maxSize, player, collector); - if (result != FloodClaimResult.SUCCESSFULL) { + if (result != FloodClaimResult.SUCCESSFUL) { return result; } return fillClaimInto(world, x, z + 1, recursions, maxSize, player, collector); @@ -418,6 +418,7 @@ public boolean isOwner(World world, int x, int z, Player ply) { * @param ply The UUID of the player. * @return Whether this player owns this chunk. */ + @SuppressWarnings("unused") public boolean isOwner(Chunk chunk, UUID ply) { return isOwner(chunk.getWorld(), chunk.getX(), chunk.getZ(), ply); } @@ -470,22 +471,24 @@ public UUID getOwner(ChunkPos pos) { /** * Toggles whether TNT is enabled in the provided chunk. * - * @param chunk The Spigot chunk position. + * @param ignoredChunk The Spigot chunk position. * @return Whether TNT is now (after the toggle) enabled in this chunk. + * @deprecated DOES NOTHING! */ - public boolean toggleTnt(Chunk chunk) { - return dataHandler.toggleTnt(new ChunkPos(chunk)); + @Deprecated + public boolean toggleTnt(Chunk ignoredChunk) { + return false; } /** * Checks whether TNT is enabled in the provided chunk. * - * @deprecated Must make use of new - * @param chunk The Spigot chunk position. + * @param ignoredChunk The Spigot chunk position. * @return Whether TNT is currently enabled in this chunk. + * @deprecated DOES NOTHING! */ @Deprecated - public boolean isTntEnabled(Chunk chunk) { - return dataHandler.isTntEnabled(new ChunkPos(chunk)); + public boolean isTntEnabled(Chunk ignoredChunk) { + return false; } } diff --git a/src/main/java/com/cjburkey/claimchunk/data/newdata/BulkMySQLDataHandler.java b/src/main/java/com/cjburkey/claimchunk/data/newdata/BulkMySQLDataHandler.java index b4d1461..b557d63 100644 --- a/src/main/java/com/cjburkey/claimchunk/data/newdata/BulkMySQLDataHandler.java +++ b/src/main/java/com/cjburkey/claimchunk/data/newdata/BulkMySQLDataHandler.java @@ -161,16 +161,6 @@ public DataChunk[] getClaimedChunks() { return dataHandler.getClaimedChunks(); } - @Override - public boolean toggleTnt(ChunkPos pos) { - return dataHandler.toggleTnt(pos); - } - - @Override - public boolean isTntEnabled(ChunkPos pos) { - return dataHandler.isTntEnabled(pos); - } - @Override public void addPlayer( UUID player, diff --git a/src/main/java/com/cjburkey/claimchunk/data/newdata/IClaimChunkDataHandler.java b/src/main/java/com/cjburkey/claimchunk/data/newdata/IClaimChunkDataHandler.java index 5c60bef..015a0b0 100644 --- a/src/main/java/com/cjburkey/claimchunk/data/newdata/IClaimChunkDataHandler.java +++ b/src/main/java/com/cjburkey/claimchunk/data/newdata/IClaimChunkDataHandler.java @@ -113,7 +113,7 @@ public interface IClaimChunkDataHandler { UUID getChunkOwner(ChunkPos pos); /** - * Retrives all claimed chunks and their owners across all worlds. + * Retrieves all claimed chunks and their owners across all worlds. * * @return An array of all claimed chunks * @since 0.0.13 @@ -123,25 +123,29 @@ public interface IClaimChunkDataHandler { /** * Toggles whether TNT can explode in the given chunk. * - * @param pos The position of the chunk + * @param ignoredPos The position of the chunk * @return Whether TNT is now enabled in the provided chunk * @since 0.0.16 * @deprecated Unused. */ @Deprecated - boolean toggleTnt(ChunkPos pos); + default boolean toggleTnt(ChunkPos ignoredPos) { + return false; + } /** * Retrieves whether TNT can explode in the given chunk (regardless of whether TNT is disabled * in the config). * - * @param pos The position of the chunk + * @param ignoredPos The position of the chunk * @return Whether TNT is enabled in the provided chunk * @since 0.0.16 * @deprecated Unused. */ @Deprecated - boolean isTntEnabled(ChunkPos pos); + default boolean isTntEnabled(ChunkPos ignoredPos) { + return false; + } // -- PLAYERS -- // @@ -151,7 +155,7 @@ public interface IClaimChunkDataHandler { * @param player The UUID of the player * @param lastIgn The in-game name of the player * @param chunkName The display name for this player's chunks - * @param lastOnlineTime The last time (in ms since January 1, 1970 UTC) that the player was + * @param lastOnlineTime The last time (in ms since January 1, 1970, UTC) that the player was * online * @param alerts Whether to send this player alerts when someone enters their chunks * @since 0.0.24 @@ -221,7 +225,7 @@ default void addPlayer(UUID player, String lastIgn, boolean alerts, int defaultM UUID getPlayerUUID(String username); /** - * Set the last time (in ms since January 1, 1970 UTC) that the player was online. + * Set the last time (in ms since January 1, 1970, UTC) that the player was online. * * @param player The player whose time should be updated * @param time The new time since the player was last online @@ -233,7 +237,7 @@ default void addPlayer(UUID player, String lastIgn, boolean alerts, int defaultM * Sets the given player's chunk's display name. * * @param player The player whose chunks should have the new display name - * @param name The new display name for this players chunks or {@code null} to clear it + * @param name The new display name for this player's chunks or {@code null} to clear it * @since 0.0.13 */ void setPlayerChunkName(UUID player, @Nullable String name); @@ -242,7 +246,7 @@ default void addPlayer(UUID player, String lastIgn, boolean alerts, int defaultM * Retrieves the given player's chunk's display name. * * @param player The player whose chunks' name to check - * @return The new display name for this players chunks or {@code null} if the player has not + * @return The new display name for this player's chunks or {@code null} if the player has not * joined or the chunks are unnamed * @since 0.0.13 */ diff --git a/src/main/java/com/cjburkey/claimchunk/data/newdata/JsonDataHandler.java b/src/main/java/com/cjburkey/claimchunk/data/newdata/JsonDataHandler.java index 1b12ab5..dbc31ac 100644 --- a/src/main/java/com/cjburkey/claimchunk/data/newdata/JsonDataHandler.java +++ b/src/main/java/com/cjburkey/claimchunk/data/newdata/JsonDataHandler.java @@ -90,13 +90,6 @@ public void load() throws Exception { } } - public void deleteFiles() { - if (claimedChunksFile != null && !claimedChunksFile.delete()) - Utils.err("Failed to delete claimed chunks file"); - if (joinedPlayersFile != null && !joinedPlayersFile.delete()) - Utils.err("Failed to delete joined players file"); - } - void clearData() { claimedChunks.clear(); joinedPlayers.clear(); @@ -150,18 +143,6 @@ public DataChunk[] getClaimedChunks() { .toArray(DataChunk[]::new); } - @Override - public boolean toggleTnt(ChunkPos pos) { - DataChunk chunk = claimedChunks.get(pos); - if (chunk == null) return false; - return (chunk.tnt = !chunk.tnt); - } - - @Override - public boolean isTntEnabled(ChunkPos pos) { - return claimedChunks.containsKey(pos) && claimedChunks.get(pos).tnt; - } - @Override public void addPlayer( UUID player, @@ -446,7 +427,9 @@ private void loadPre0024Data() throws Exception { // Backup existing files doBackup(joinedPlayersFile); - doBackup(claimedChunksFile); + if (claimedChunksFile != null && claimedChunksFile.exists()) { + doBackup(claimedChunksFile); + } } } } diff --git a/src/main/java/com/cjburkey/claimchunk/data/newdata/MySQLDataHandler.java b/src/main/java/com/cjburkey/claimchunk/data/newdata/MySQLDataHandler.java index df0a051..b1415bb 100644 --- a/src/main/java/com/cjburkey/claimchunk/data/newdata/MySQLDataHandler.java +++ b/src/main/java/com/cjburkey/claimchunk/data/newdata/MySQLDataHandler.java @@ -308,57 +308,6 @@ public DataChunk[] getClaimedChunks() { return chunks.toArray(new DataChunk[0]); } - @Override - public boolean toggleTnt(ChunkPos pos) { - boolean current = isTntEnabled(pos); - String sql = - String.format( - "UPDATE `%s` SET `%s`=? WHERE (`%s`=?) AND (`%s`=?) AND (`%s`=?)", - CLAIMED_CHUNKS_TABLE_NAME, - CLAIMED_CHUNKS_TNT, - CLAIMED_CHUNKS_WORLD, - CLAIMED_CHUNKS_X, - CLAIMED_CHUNKS_Z); - try (PreparedStatement statement = prep(claimChunk, connection, sql)) { - statement.setBoolean(1, !current); - statement.setString(2, pos.world()); - statement.setInt(3, pos.x()); - statement.setInt(4, pos.z()); - statement.execute(); - return !current; - } catch (Exception e) { - Utils.err("Failed to update tnt enabled in chunk: %s", e.getMessage()); - //noinspection CallToPrintStackTrace - e.printStackTrace(); - } - return current; - } - - @Override - public boolean isTntEnabled(ChunkPos pos) { - String sql = - String.format( - "SELECT `%s` FROM `%s` WHERE (`%s`=?) AND (`%s`=?) AND (`%s`=?)", - CLAIMED_CHUNKS_TNT, - CLAIMED_CHUNKS_TABLE_NAME, - CLAIMED_CHUNKS_WORLD, - CLAIMED_CHUNKS_X, - CLAIMED_CHUNKS_Z); - try (PreparedStatement statement = prep(claimChunk, connection, sql)) { - statement.setString(1, pos.world()); - statement.setInt(2, pos.x()); - statement.setInt(3, pos.z()); - try (ResultSet result = statement.executeQuery()) { - if (result.next()) return result.getBoolean(1); - } - } catch (Exception e) { - Utils.err("Failed to retrieve tnt enabled in chunk: %s", e.getMessage()); - //noinspection CallToPrintStackTrace - e.printStackTrace(); - } - return false; - } - @Override public void addPlayer( UUID player, diff --git a/src/main/java/com/cjburkey/claimchunk/data/journaled/JournaledDataHandler.java b/src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteDataHandler.java similarity index 93% rename from src/main/java/com/cjburkey/claimchunk/data/journaled/JournaledDataHandler.java rename to src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteDataHandler.java index 0efd2fc..22a44c8 100644 --- a/src/main/java/com/cjburkey/claimchunk/data/journaled/JournaledDataHandler.java +++ b/src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteDataHandler.java @@ -1,4 +1,4 @@ -package com.cjburkey.claimchunk.data.journaled; +package com.cjburkey.claimchunk.data.sqlite; import com.cjburkey.claimchunk.chunk.ChunkPlayerPermissions; import com.cjburkey.claimchunk.chunk.ChunkPos; @@ -34,7 +34,7 @@ * * @since 0.0.25 */ -public class JournaledDataHandler implements IClaimChunkDataHandler { +public class SqLiteDataHandler implements IClaimChunkDataHandler { @Getter private final File claimChunkDb; private boolean init = false; @@ -42,14 +42,13 @@ public class JournaledDataHandler implements IClaimChunkDataHandler { private HashMap joinedPlayers; private SqLiteWrapper sqLiteWrapper; - public JournaledDataHandler(@NotNull File claimChunkDb) { + public SqLiteDataHandler(@NotNull File claimChunkDb) { this.claimChunkDb = claimChunkDb; } @Override public void init() { joinedPlayers = new HashMap<>(); - // claimRegions = new HashMap<>(); claimedChunks = new HashMap<>(); sqLiteWrapper = new SqLiteWrapper(claimChunkDb); @@ -66,12 +65,19 @@ public void exit() {} @Override public void save() { - // Don't do anything, async handler should have us safe + // Don't do anything, we save as we go } + @SuppressWarnings("StatementWithEmptyBody") @Override public void load() throws Exception { - // TODO: THIS + for (FullPlayerData player : sqLiteWrapper.getAllPlayers()) { + // TODO: THIS + } + + for (DataChunk chunk : sqLiteWrapper.getAllChunks()) { + // TODO: THIS + } } @Override @@ -108,20 +114,6 @@ public DataChunk[] getClaimedChunks() { return claimedChunks.values().toArray(new DataChunk[0]); } - // TODO: REMOVE - - @Override - public boolean toggleTnt(ChunkPos pos) { - return false; - } - - @Override - public boolean isTntEnabled(ChunkPos pos) { - return false; - } - - // END TODO - @Override public void addPlayer(FullPlayerData playerData) { joinedPlayers.put(playerData.player, playerData); diff --git a/src/main/java/com/cjburkey/claimchunk/data/journaled/TableMigrationManager.java b/src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteTableMigrationManager.java similarity index 98% rename from src/main/java/com/cjburkey/claimchunk/data/journaled/TableMigrationManager.java rename to src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteTableMigrationManager.java index c229ac4..ae0c05c 100644 --- a/src/main/java/com/cjburkey/claimchunk/data/journaled/TableMigrationManager.java +++ b/src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteTableMigrationManager.java @@ -1,4 +1,4 @@ -package com.cjburkey.claimchunk.data.journaled; +package com.cjburkey.claimchunk.data.sqlite; import org.jetbrains.annotations.NotNull; @@ -9,7 +9,7 @@ import java.util.function.Supplier; /** This class is responsible for creating, loading, and upgrading the database file. */ -public class TableMigrationManager { +public class SqLiteTableMigrationManager { public static void go(Supplier connectionSupplier) throws RuntimeException, SQLException { diff --git a/src/main/java/com/cjburkey/claimchunk/data/journaled/SqLiteWrapper.java b/src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteWrapper.java similarity index 88% rename from src/main/java/com/cjburkey/claimchunk/data/journaled/SqLiteWrapper.java rename to src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteWrapper.java index acb1f54..88f79c9 100644 --- a/src/main/java/com/cjburkey/claimchunk/data/journaled/SqLiteWrapper.java +++ b/src/main/java/com/cjburkey/claimchunk/data/sqlite/SqLiteWrapper.java @@ -1,4 +1,4 @@ -package com.cjburkey.claimchunk.data.journaled; +package com.cjburkey.claimchunk.data.sqlite; import com.cjburkey.claimchunk.Utils; import com.cjburkey.claimchunk.chunk.ChunkPos; @@ -10,6 +10,8 @@ import java.io.File; import java.io.IOException; import java.sql.*; +import java.util.ArrayList; +import java.util.Collection; import java.util.UUID; public class SqLiteWrapper { @@ -26,7 +28,7 @@ public SqLiteWrapper(@NotNull File dbFile) throws RuntimeException { Class.forName("org.sqlite.JDBC"); // Initialize the tables and perform any changes to them - TableMigrationManager.go(this::connectionOrException); + SqLiteTableMigrationManager.go(this::connectionOrException); } catch (ClassNotFoundException e) { throw new RuntimeException( "Cannot find SQLite JDBC class? Not sure how this can happen. Please submit an" @@ -46,7 +48,7 @@ public void addClaimedChunk(DataChunk chunk) { try (PreparedStatement statement = connection.prepareStatement( """ - INSERT INTO chunk_data ( + INSERT OR IGNORE INTO chunk_data ( chunk_world, chunk_x, chunk_z, @@ -81,6 +83,7 @@ public void removeClaimedChunk(ChunkPos chunk) { statement.setInt(2, chunk.x()); statement.setInt(3, chunk.z()); ResultSet results = statement.executeQuery(); + if (!results.next()) return; chunkId = results.getInt(1); } @@ -116,7 +119,7 @@ public void addPlayer(FullPlayerData playerData) { try (PreparedStatement statement = connection.prepareStatement( """ - INSERT INTO player_data ( + INSERT OR IGNORE INTO player_data ( player_uuid, last_ign, chunk_name, @@ -223,7 +226,7 @@ public void addPlayerAccess(ChunkPos chunk, UUID accessor, int permissionFlags) try (PreparedStatement statement = connection.prepareStatement( """ - INSERT INTO chunk_permissions ( + INSERT OR IGNORE INTO chunk_permissions ( chunk_id, other_player_id, permission_bits @@ -315,6 +318,36 @@ public void removePlayerAccess(ChunkPos chunk, UUID accessor) { } } + // -- Loading stuff -- // + + public Collection getAllPlayers() { + ArrayList players = new ArrayList<>(); + try (Connection connection = connectionOrException()) { + try (PreparedStatement statement = + connection.prepareStatement( + "SELECT * FROM player_data")) { + ResultSet resultSet = statement.executeQuery(); + while (resultSet.next()) { + UUID player = UUID.fromString(resultSet.getString("player_uuid")); + String lastIgn = resultSet.getString("last_ign"); + String chunkName = resultSet.getString("chunk_name"); + long lastOnlineTime = resultSet.getLong("last_online_time"); + boolean alert = resultSet.getBoolean("alerts_enabled"); + int extraMaxClaims = resultSet.getInt("extra_max_claims"); + players.add(new FullPlayerData(player, lastIgn, chunkName, lastOnlineTime, alert, extraMaxClaims)); + } + } + } catch (SQLException e) { + throw new RuntimeException("Failed to remove player access!", e); + } + return players; + } + + public Collection getAllChunks() { + // TODO: THIS + return null; + } + // -- Connection stuff -- // public @NotNull Connection connection() throws SQLException, IOException { diff --git a/src/main/java/com/cjburkey/claimchunk/layer/PlaceholderInitLayer.java b/src/main/java/com/cjburkey/claimchunk/layer/PlaceholderInitLayer.java index fab9977..bace4d3 100644 --- a/src/main/java/com/cjburkey/claimchunk/layer/PlaceholderInitLayer.java +++ b/src/main/java/com/cjburkey/claimchunk/layer/PlaceholderInitLayer.java @@ -7,6 +7,7 @@ import lombok.Getter; +@SuppressWarnings("LombokGetterMayBeUsed") public class PlaceholderInitLayer implements IClaimChunkLayer { @Getter private ClaimChunkPlaceholders placeholders; @@ -33,6 +34,7 @@ public boolean onEnable(IClaimChunkPlugin claimChunk) { "An error occurred while trying to enable the PlaceholderAPI expansion for" + " claimchunk placeholders!"); Utils.err("Here is the error for reference:"); + //noinspection CallToPrintStackTrace e.printStackTrace(); }