This commit is contained in:
mfnalex 2019-05-03 15:26:01 +02:00
parent b8510b36fe
commit b16b8e7a44
2 changed files with 11 additions and 8 deletions

View File

@ -32,6 +32,7 @@ public class JeffChestSortListener implements Listener {
public void onPlayerJoin(PlayerJoinEvent event) {
// DEBUG
// To enable debug mode, put debug: true into your config.yml
// Checking for my username because I always forget to comment this out before
// releases
// if (event.getPlayer().getName().equalsIgnoreCase("mfnalex")) {

View File

@ -68,7 +68,7 @@ public class JeffChestSortOrganizer {
if (file.isFile()) {
// Category name is the filename without .txt
String categoryName = file.getName().replaceFirst(".txt", "");
if (plugin.debug) {
plugin.getLogger().info("Loading category file " + file.getName());
}
@ -76,7 +76,8 @@ public class JeffChestSortOrganizer {
JeffChestSortCategory category = new JeffChestSortCategory(categoryName, loadCategoryFile(file));
categories.add(category);
if (plugin.debug) {
plugin.getLogger().info("Loaded category file " + file.getName() + " ("+category.typeMatches.length+" items)");
plugin.getLogger().info("Loaded category file " + file.getName() + " ("
+ category.typeMatches.length + " items)");
}
} catch (FileNotFoundException e) {
plugin.getLogger().warning("Could not load category file: " + file.getName());
@ -101,8 +102,6 @@ public class JeffChestSortOrganizer {
currentLine = currentLine.trim().replaceAll(" ", "");
if (currentLine.contains("#")) {
// System.out.println("File contains a comment: " + currentLine);
// currentLine = currentLine.trim().split("\\#")[0]; // Remove everything after
// the first #
String[] split = currentLine.split("#");
if (split.length > 0) {
@ -115,10 +114,13 @@ public class JeffChestSortOrganizer {
currentLine = null;
}
if (currentLine != null) {
if (currentLine.toLowerCase().startsWith("sticky=") && currentLine.toLowerCase().endsWith("=true")) {
appendLineNumber = true;
if (plugin.debug)
plugin.getLogger().info("Sticky set to true in " + file.getName());
if (currentLine.toLowerCase().startsWith("sticky=")) {
if (currentLine.toLowerCase().endsWith("=true")) {
appendLineNumber = true;
if (plugin.debug)
plugin.getLogger().info("Sticky set to true in " + file.getName());
}
} else {
if (currentLine != null) {
lines.add(new TypeMatchPositionPair(currentLine, currentLineNumber, appendLineNumber));