Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/main/java/us/thezircon/play/autopickup/AutoPickup.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.time.Duration;
import java.time.Instant;
import java.util.*;
import java.util.logging.Level;

public final class AutoPickup extends JavaPlugin {

Expand Down Expand Up @@ -177,7 +178,7 @@ public void run() {
} catch (UnknownHostException e) {
VersionChk.noConnection();
} catch (Exception e) {
e.printStackTrace();
getLogger().log(Level.SEVERE, "Failed to check plugin version.", e);
}
}
}.run();
Expand Down Expand Up @@ -239,7 +240,7 @@ private void createBlacklist() {
try {
confBlacklist.load(fileBlacklist);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
getLogger().log(Level.SEVERE, "Failed to load blacklist.yml.", e);
}
}

Expand All @@ -266,7 +267,7 @@ private void createPAPI() {
try {
confPAPI.load(filePAPI);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
getLogger().log(Level.SEVERE, "Failed to load papi.yml.", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import us.thezircon.play.autopickup.AutoPickup;

import java.util.logging.Level;

public class Messages {

private static final AutoPickup PLUGIN = AutoPickup.getPlugin(AutoPickup.class);
Expand Down Expand Up @@ -103,7 +105,7 @@ public Messages() {
System.out.println("----------------------------------");
System.out.println("Check the default config on spigot!");
}
e.printStackTrace();
PLUGIN.getLogger().log(Level.SEVERE, "Failed to load message keys from config.yml.", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.io.File;
import java.io.IOException;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PickupPlayer {
Expand Down Expand Up @@ -36,11 +37,7 @@ public void createFile() {
playerData.createNewFile();
} catch (IOException err) {
log.warning("[AutoPickup] Unable to create playdata file for "+uuid);
// Dev Build
log.severe("[AutoPickup] Cuase: "+err.getCause());
System.out.println("");
err.printStackTrace();
////////////
log.log(Level.SEVERE, "[AutoPickup] Cause: " + err.getMessage(), err);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Method;
import java.util.logging.Level;

import static us.thezircon.play.autopickup.AutoPickup.usingFolia;

Expand Down Expand Up @@ -109,7 +110,7 @@ void start(long initialDelay) {
}
new AsyncRepeatingTask().start(delay);
} catch (Exception e) {
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Failed to schedule async repeating task.", e);
}
return;
}
Expand All @@ -125,7 +126,7 @@ public static void runTaskAsynchronously(@NotNull Runnable task) {
globalScheduler.execute(plugin, task);
return;
} catch (Exception e) {
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Failed to schedule async task.", e);
}
}
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, task);
Expand All @@ -149,7 +150,7 @@ public static void runTask(@Nullable Location loc, @NotNull Runnable task) {
}
return;
} catch (Exception e) {
e.printStackTrace();
plugin.getLogger().log(Level.SEVERE, "Failed to schedule task.", e);
}
}

Expand Down