diff --git a/src/main/java/net/knarcraft/bookswithoutborders/BooksWithoutBorders.java b/src/main/java/net/knarcraft/bookswithoutborders/BooksWithoutBorders.java index b40e81a..06b5fca 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/BooksWithoutBorders.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/BooksWithoutBorders.java @@ -21,7 +21,6 @@ import net.knarcraft.bookswithoutborders.command.CommandSetLore; import net.knarcraft.bookswithoutborders.command.CommandSetTitle; import net.knarcraft.bookswithoutborders.command.CommandUnSign; import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig; -import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings; import net.knarcraft.bookswithoutborders.listener.BookEventListener; import net.knarcraft.bookswithoutborders.listener.PlayerEventListener; import net.knarcraft.bookswithoutborders.listener.SignEventListener; @@ -41,11 +40,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getErrorColor; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSuccessColor; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getErrorColor; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSuccessColor; +/** + * The main Books Without Borders class + */ public class BooksWithoutBorders extends JavaPlugin { private static ItemFactory itemFactory; @@ -107,8 +109,7 @@ public class BooksWithoutBorders extends JavaPlugin { booksWithoutBorders = this; consoleSender = this.getServer().getConsoleSender(); playerBooksList = new HashMap<>(); - BooksWithoutBordersSettings.initialize(this); - BooksWithoutBordersConfig.loadConfig(); + BooksWithoutBordersConfig.initialize(this); publicBooksList = FileHelper.listFiles(consoleSender, true); PluginManager pluginManager = this.getServer().getPluginManager(); diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandBooksWithoutBorders.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandBooksWithoutBorders.java index 0728999..d66c729 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandBooksWithoutBorders.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandBooksWithoutBorders.java @@ -15,8 +15,8 @@ import java.util.ArrayList; import java.util.List; import static net.knarcraft.bookswithoutborders.BooksWithoutBorders.sendErrorMessage; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getCommandColor; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSuccessColor; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getCommandColor; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSuccessColor; /** * Command executor for the books without borders (bwb) command @@ -115,4 +115,5 @@ public class CommandBooksWithoutBorders implements TabExecutor { public List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) { return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandCopy.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandCopy.java index f039437..1227ecd 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandCopy.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandCopy.java @@ -94,4 +94,5 @@ public class CommandCopy implements TabExecutor { } return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDecrypt.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDecrypt.java index 0a5b265..3c063a9 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDecrypt.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDecrypt.java @@ -16,8 +16,8 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; /** * Command executor for the decrypt command @@ -113,4 +113,5 @@ public class CommandDecrypt implements TabExecutor { } return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDelete.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDelete.java index 7ab66b7..db8680e 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDelete.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandDelete.java @@ -13,8 +13,8 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; /** * Command executor for the delete command diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandGive.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandGive.java index 37d232c..f0923f6 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandGive.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandGive.java @@ -150,4 +150,5 @@ public class CommandGive implements TabExecutor { } return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandLoad.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandLoad.java index 91deffd..85f8466 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandLoad.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandLoad.java @@ -125,4 +125,5 @@ public class CommandLoad implements TabExecutor { } return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandReload.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandReload.java index 277d413..b1b164b 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandReload.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandReload.java @@ -30,4 +30,5 @@ public class CommandReload implements TabExecutor { public List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) { return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java index 5b4891a..5ecfb44 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSave.java @@ -19,10 +19,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getCommandColor; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getErrorColor; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getCommandColor; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getErrorColor; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.cleanString; import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.fixName; @@ -152,4 +152,5 @@ public class CommandSave implements TabExecutor { public List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) { return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetAuthor.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetAuthor.java index 69c9205..52f9970 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetAuthor.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetAuthor.java @@ -57,4 +57,5 @@ public class CommandSetAuthor implements TabExecutor { return new ArrayList<>(); } } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetBookPrice.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetBookPrice.java index ec5096e..bc8d7e4 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetBookPrice.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetBookPrice.java @@ -146,4 +146,5 @@ public class CommandSetBookPrice implements TabExecutor { } return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java index c326e8f..96acf98 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetLore.java @@ -67,4 +67,5 @@ public class CommandSetLore implements TabExecutor { options.add(""); return options; } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetTitle.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetTitle.java index d984dc2..09f9fdc 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetTitle.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandSetTitle.java @@ -71,4 +71,5 @@ public class CommandSetTitle implements TabExecutor { options.add(""); return options; } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java index 4208d8a..43c29c3 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/command/CommandUnSign.java @@ -59,4 +59,5 @@ public class CommandUnSign implements TabExecutor { public List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) { return new ArrayList<>(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/config/BooksWithoutBordersConfig.java b/src/main/java/net/knarcraft/bookswithoutborders/config/BooksWithoutBordersConfig.java index fa12f0b..6b24cd5 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/config/BooksWithoutBordersConfig.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/config/BooksWithoutBordersConfig.java @@ -2,6 +2,7 @@ package net.knarcraft.bookswithoutborders.config; import net.knarcraft.bookswithoutborders.BooksWithoutBorders; import net.knarcraft.bookswithoutborders.utility.EconomyHelper; +import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.configuration.Configuration; @@ -13,8 +14,18 @@ import static net.knarcraft.bookswithoutborders.BooksWithoutBorders.sendErrorMes import static net.knarcraft.bookswithoutborders.BooksWithoutBorders.sendSuccessMessage; import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.cleanString; +/** + * A config class that keeps track of all config values + */ public class BooksWithoutBordersConfig { + private static final ChatColor errorColor = ChatColor.RED; + private static final ChatColor successColor = ChatColor.GREEN; + private static final ChatColor commandColor = ChatColor.YELLOW; + private static final String SLASH = System.getProperty("file.separator"); + private static boolean isInitialized; + public static String bookFolder; + private static int bookDuplicateLimit; private static String titleAuthorSeparator; private static String loreSeparator; @@ -27,6 +38,65 @@ public class BooksWithoutBordersConfig { private static boolean adminDecrypt; private static boolean formatBooks; + /** + * Initializes the books without borders settings class + * + * @param booksWithoutBorders

The books without borders object used for getting required data

+ */ + public static void initialize(BooksWithoutBorders booksWithoutBorders) { + if (isInitialized) { + throw new IllegalArgumentException("Settings class initialized twice. This should not happen!"); + } + isInitialized = true; + bookFolder = booksWithoutBorders.getDataFolder().getAbsolutePath() + getSlash() + "Books" + getSlash(); + loadConfig(); + } + + /** + * Gets the folder used for storing books + * + * @return

The folder used for storing books

+ */ + public static String getBookFolder() { + return bookFolder; + } + + /** + * Gets the color to use for error messages + * + * @return

The color to use for error messages

+ */ + public static ChatColor getErrorColor() { + return errorColor; + } + + /** + * Gets the color to use for success messages + * + * @return

The color to use for success messages

+ */ + public static ChatColor getSuccessColor() { + return successColor; + } + + /** + * Gets the color used to color commands + * + * @return

The color used to color commands

+ */ + public static ChatColor getCommandColor() { + return commandColor; + } + + /** + * Gets the correct slash to use for the used OS + * + * @return

The slash to use for file separators

+ */ + public static String getSlash() { + return SLASH; + } + /** * Gets whether only the author of a book should be able to copy it * diff --git a/src/main/java/net/knarcraft/bookswithoutborders/config/BooksWithoutBordersSettings.java b/src/main/java/net/knarcraft/bookswithoutborders/config/BooksWithoutBordersSettings.java deleted file mode 100644 index 2cf3ec3..0000000 --- a/src/main/java/net/knarcraft/bookswithoutborders/config/BooksWithoutBordersSettings.java +++ /dev/null @@ -1,78 +0,0 @@ -package net.knarcraft.bookswithoutborders.config; - -import net.knarcraft.bookswithoutborders.BooksWithoutBorders; -import org.bukkit.ChatColor; - -/** - * Class for getting various settings - */ -public class BooksWithoutBordersSettings { - - //Static settings - private static final ChatColor errorColor = ChatColor.RED; - private static final ChatColor successColor = ChatColor.GREEN; - private static final ChatColor commandColor = ChatColor.YELLOW; - private static final String SLASH = System.getProperty("file.separator"); - private static boolean isInitialized; - public static String bookFolder; - - /** - * Initializes the books without borders settings class - * - * @param booksWithoutBorders

The books without borders object used for getting required data

- */ - public static void initialize(BooksWithoutBorders booksWithoutBorders) { - if (isInitialized) { - throw new IllegalArgumentException("Settings class initialized twice. This should not happen!"); - } - isInitialized = true; - bookFolder = booksWithoutBorders.getDataFolder().getAbsolutePath() + getSlash() + "Books" + getSlash(); - } - - /** - * Gets the folder used for storing books - * - * @return

The folder used for storing books

- */ - public static String getBookFolder() { - return bookFolder; - } - - /** - * Gets the color to use for error messages - * - * @return

The color to use for error messages

- */ - public static ChatColor getErrorColor() { - return errorColor; - } - - /** - * Gets the color to use for success messages - * - * @return

The color to use for success messages

- */ - public static ChatColor getSuccessColor() { - return successColor; - } - - /** - * Gets the color used to color commands - * - * @return

The color used to color commands

- */ - public static ChatColor getCommandColor() { - return commandColor; - } - - /** - * Gets the correct slash to use for the used OS - * - * @return

The slash to use for file separators

- */ - public static String getSlash() { - return SLASH; - } - - -} diff --git a/src/main/java/net/knarcraft/bookswithoutborders/encryption/GenenCrypt.java b/src/main/java/net/knarcraft/bookswithoutborders/encryption/GenenCrypt.java index e245c1d..e4f7370 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/encryption/GenenCrypt.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/encryption/GenenCrypt.java @@ -14,8 +14,6 @@ public class GenenCrypt { private final Random ranGen; private final String[] bases; - private final ArrayList originalCodonList; - private final ArrayList shuffledCodonList; private final String[] charList; private final HashMap codonTable; private final HashMap decryptTable; @@ -29,7 +27,7 @@ public class GenenCrypt { public GenenCrypt(String key) { // define the initial, unshuffled codon list of 4 base codons - originalCodonList = new ArrayList<>(); + ArrayList originalCodonList = new ArrayList<>(); bases = new String[]{"A", "T", "G", "C"}; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { @@ -50,7 +48,7 @@ public class GenenCrypt { ranGen = new java.util.Random(longKey); // use the random number generator and the originalCodonList to make a shuffled list - shuffledCodonList = new ArrayList<>(); + ArrayList shuffledCodonList = new ArrayList<>(); while (originalCodonList.size() > 0) { int index = ranGen.nextInt(originalCodonList.size()); shuffledCodonList.add(originalCodonList.get(index)); @@ -90,24 +88,6 @@ public class GenenCrypt { } - /** - * Prints the shuffled codon list used for generating the codon table - */ - public void printShuffledList() { - for (String s : shuffledCodonList) { - System.out.println(s); - } - } - - /** - * Prints the original codon list before it was shuffled - */ - public void printOriginalList() { - for (String s : originalCodonList) { - System.out.println(s); - } - } - /** * Prints the codon table used for encryption and decryption */ @@ -181,4 +161,5 @@ public class GenenCrypt { } return output.toString(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/encryption/SubstitutionCipher.java b/src/main/java/net/knarcraft/bookswithoutborders/encryption/SubstitutionCipher.java index c937c20..503a3b0 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/encryption/SubstitutionCipher.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/encryption/SubstitutionCipher.java @@ -3,6 +3,9 @@ package net.knarcraft.bookswithoutborders.encryption; import java.math.BigInteger; import java.util.StringTokenizer; +/** + * A simple substitution cipher + */ public class SubstitutionCipher { public SubstitutionCipher() { @@ -83,5 +86,6 @@ public class SubstitutionCipher { } return output.toString(); } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/listener/PlayerEventListener.java b/src/main/java/net/knarcraft/bookswithoutborders/listener/PlayerEventListener.java index 650207b..f358a7b 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/listener/PlayerEventListener.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/listener/PlayerEventListener.java @@ -18,9 +18,12 @@ import org.bukkit.inventory.meta.ItemMeta; import java.io.File; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; +/** + * A listener for listening to player-related events such as joining or holding a book + */ public class PlayerEventListener implements Listener { private final String slash = getSlash(); diff --git a/src/main/java/net/knarcraft/bookswithoutborders/listener/SignEventListener.java b/src/main/java/net/knarcraft/bookswithoutborders/listener/SignEventListener.java index ccf7a5e..0d9267c 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/listener/SignEventListener.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/listener/SignEventListener.java @@ -24,10 +24,13 @@ import org.bukkit.inventory.meta.BookMeta; import java.io.File; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; import static net.knarcraft.bookswithoutborders.utility.FileHelper.isBookListIndex; +/** + * A listener for relevant sign events such as clicking a decryption sign + */ public class SignEventListener implements Listener { private final String slash = getSlash(); diff --git a/src/main/java/net/knarcraft/bookswithoutborders/state/BookDirectory.java b/src/main/java/net/knarcraft/bookswithoutborders/state/BookDirectory.java index 7106d38..1d1c1d6 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/state/BookDirectory.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/state/BookDirectory.java @@ -4,8 +4,20 @@ package net.knarcraft.bookswithoutborders.state; * This enum represents the different directories books can be saved in */ public enum BookDirectory { + + /** + * The public directory + */ PUBLIC, + + /** + * A player directory + */ PLAYER, + + /** + * The encrypted directory + */ ENCRYPTED; /** @@ -25,4 +37,5 @@ public enum BookDirectory { return null; } } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/state/EncryptionStyle.java b/src/main/java/net/knarcraft/bookswithoutborders/state/EncryptionStyle.java index fb10b43..9686c5a 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/state/EncryptionStyle.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/state/EncryptionStyle.java @@ -4,6 +4,7 @@ package net.knarcraft.bookswithoutborders.state; * This enum represents the different available encryption styles */ public enum EncryptionStyle { + DNA("dna"), SUBSTITUTION("substitution"); @@ -27,4 +28,5 @@ public enum EncryptionStyle { } return SUBSTITUTION; } + } diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/BookFormatter.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/BookFormatter.java index 95c4f02..78e6449 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/BookFormatter.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/BookFormatter.java @@ -15,7 +15,6 @@ import java.util.regex.Pattern; public final class BookFormatter { private BookFormatter() { - } /** diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/BookLoader.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/BookLoader.java index e34484e..0a4134f 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/BookLoader.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/BookLoader.java @@ -2,7 +2,6 @@ package net.knarcraft.bookswithoutborders.utility; import net.knarcraft.bookswithoutborders.BooksWithoutBorders; import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig; -import net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings; import net.knarcraft.bookswithoutborders.state.BookDirectory; import org.bukkit.Material; import org.bukkit.command.CommandSender; @@ -14,8 +13,14 @@ import java.io.File; import java.util.ArrayList; import java.util.List; +/** + * A helper class for loading books from files + */ public final class BookLoader { + private BookLoader() { + } + /** * Loads the given book * @@ -109,8 +114,8 @@ public final class BookLoader { */ private static File getFullPath(CommandSender sender, String fileName, BookDirectory bookDirectory, String directory) { File file = null; - String slash = BooksWithoutBordersSettings.getSlash(); - String bookFolder = BooksWithoutBordersSettings.getBookFolder(); + String slash = BooksWithoutBordersConfig.getSlash(); + String bookFolder = BooksWithoutBordersConfig.getBookFolder(); if (bookDirectory == BookDirectory.PUBLIC) { file = FileHelper.getBookFile(bookFolder + fileName); } else if (bookDirectory == BookDirectory.PLAYER) { diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java index 4b69289..ec7e670 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java @@ -22,7 +22,6 @@ public final class EconomyHelper { private static Economy economy; private EconomyHelper() { - } /** diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/EncryptionHelper.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/EncryptionHelper.java index 6861daa..b08a42e 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/EncryptionHelper.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/EncryptionHelper.java @@ -17,8 +17,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.cleanString; import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.fixName; @@ -28,7 +28,6 @@ import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.fixN public final class EncryptionHelper { private EncryptionHelper() { - } /** diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/FileHelper.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/FileHelper.java index 01dce7d..b1b05e7 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/FileHelper.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/FileHelper.java @@ -10,8 +10,8 @@ import java.util.List; import java.util.Objects; import java.util.regex.Pattern; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getBookFolder; -import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersSettings.getSlash; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getBookFolder; +import static net.knarcraft.bookswithoutborders.config.BooksWithoutBordersConfig.getSlash; import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.cleanString; /** @@ -20,7 +20,6 @@ import static net.knarcraft.bookswithoutborders.utility.InputCleaningHelper.clea public final class FileHelper { private FileHelper() { - } /** diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/InputCleaningHelper.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/InputCleaningHelper.java index 1da2e00..6c026ba 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/InputCleaningHelper.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/InputCleaningHelper.java @@ -9,7 +9,6 @@ import java.util.List; public final class InputCleaningHelper { private InputCleaningHelper() { - } /** diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/InventoryHelper.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/InventoryHelper.java index eb80fef..bd52ab4 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/InventoryHelper.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/InventoryHelper.java @@ -14,7 +14,6 @@ import org.bukkit.inventory.meta.BookMeta; public final class InventoryHelper { private InventoryHelper() { - } /** diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/TabCompletionHelper.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/TabCompletionHelper.java index 31b2a7a..41a814d 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/TabCompletionHelper.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/TabCompletionHelper.java @@ -9,7 +9,6 @@ import java.util.List; public final class TabCompletionHelper { private TabCompletionHelper() { - } /**