Added automatic error reporting

This commit is contained in:
Intelli committed 2026-05-21 13:54:39 -06:00
1 parent b7a452bf03
commit cb09ddeb0b
128 files changed
+708 -247

No files matched your search

+3
View File
@@ -224,3 +224,6 @@ CoreProtect-TestAPI
!/src/main/java/net/coreprotect/utility/extensions/Extensions.java
/.apt_generated/
/.apt_generated_tests/
# Server side files
server/*
@@ -43,6 +43,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.listener.player.InventoryChangeListener;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* The main API class for CoreProtect.
@@ -1095,7 +1096,7 @@ public class CoreProtectAPI extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -19,6 +19,7 @@ import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.StringUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for block-related lookups in the CoreProtect database.
@@ -97,7 +98,7 @@ public class BlockAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -177,7 +178,7 @@ public class BlockAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -244,7 +245,7 @@ public class BlockAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -12,6 +12,7 @@ import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for normalized player inventory transaction lookups.
@@ -65,7 +66,7 @@ public class InventoryAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -13,6 +13,7 @@ import net.coreprotect.database.Database;
import net.coreprotect.database.logger.ItemLogger;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for world item transaction lookups.
@@ -66,7 +67,7 @@ public class ItemAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -12,6 +12,7 @@ import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for player chat and command lookups.
@@ -74,7 +75,7 @@ public class MessageAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -17,6 +17,7 @@ import net.coreprotect.consumer.process.Process;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.StringUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for looking up block-related actions in the processing queue.
@@ -103,7 +104,7 @@ public class QueueLookup extends Queue {
Collections.reverse(result);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -14,6 +14,7 @@ import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for looking up player session data in the CoreProtect database.
@@ -81,7 +82,7 @@ public class SessionLookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -131,7 +132,7 @@ public class SessionLookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -15,6 +15,7 @@ import net.coreprotect.database.Database;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.model.action.SignActions;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for sign text lookups.
@@ -71,7 +72,7 @@ public class SignAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -13,6 +13,7 @@ import net.coreprotect.api.result.UsernameResult;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.utility.ErrorReporter;
/**
* Provides API methods for username history lookups.
@@ -80,7 +81,7 @@ public class UsernameAPI {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -11,6 +11,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.language.Selector;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class ApplyCommand {
protected static void runCommand(CommandSender user, Command command, boolean permission, String[] args) {
@@ -41,7 +42,7 @@ public class ApplyCommand {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -11,6 +11,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.language.Selector;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class CancelCommand {
protected static void runCommand(CommandSender user, Command command, boolean permission, String[] args) {
@@ -41,7 +42,7 @@ public class CancelCommand {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -14,6 +14,7 @@ import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.Extensions;
import net.coreprotect.utility.VersionUtils;
import net.coreprotect.utility.ErrorReporter;
public class CommandHandler implements CommandExecutor {
private static CommandHandler instance;
@@ -156,7 +157,7 @@ public class CommandHandler implements CommandExecutor {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -27,6 +27,7 @@ import net.coreprotect.utility.Chat;
import net.coreprotect.utility.ChatMessage;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class LookupCommand {
public static void runCommand(CommandSender player, Command command, boolean permission, String[] args) {
@@ -601,7 +602,7 @@ public class LookupCommand {
thread.start();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
else {
@@ -7,6 +7,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.listener.channel.PluginChannelListener;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class NetworkDebugCommand {
protected static void runCommand(CommandSender player, boolean permission, String[] args) {
@@ -19,7 +20,7 @@ public class NetworkDebugCommand {
PluginChannelListener.getInstance().sendTest(player, args.length == 2 ? args[1] : "");
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -31,6 +31,7 @@ import net.coreprotect.utility.Color;
import net.coreprotect.utility.EntityUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.VersionUtils;
import net.coreprotect.utility.ErrorReporter;
public class PurgeCommand extends Consumer {
@@ -316,7 +317,7 @@ public class PurgeCommand extends Consumer {
preparedStmt.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -374,7 +375,7 @@ public class PurgeCommand extends Consumer {
}
catch (Exception e) {
error = true;
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -389,7 +390,7 @@ public class PurgeCommand extends Consumer {
preparedStmt.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
try {
@@ -399,7 +400,7 @@ public class PurgeCommand extends Consumer {
preparedStmt.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
try {
@@ -410,7 +411,7 @@ public class PurgeCommand extends Consumer {
preparedStmt.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
abort = true;
break;
}
@@ -442,7 +443,7 @@ public class PurgeCommand extends Consumer {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -459,7 +460,7 @@ public class PurgeCommand extends Consumer {
preparedStmt.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
int new_count = 0;
@@ -474,7 +475,7 @@ public class PurgeCommand extends Consumer {
preparedStmt.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
removed = removed + (oldCount - new_count);
@@ -515,7 +516,7 @@ public class PurgeCommand extends Consumer {
return;
}
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -555,7 +556,7 @@ public class PurgeCommand extends Consumer {
}
catch (Exception e) {
Chat.sendGlobalMessage(player, Phrase.build(Phrase.PURGE_FAILED));
e.printStackTrace();
ErrorReporter.report(e);
}
Consumer.isPaused = false;
@@ -8,6 +8,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.thread.NetworkHandler;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class ReloadCommand {
protected static void runCommand(final CommandSender player, boolean permission, String[] args) {
@@ -48,7 +49,7 @@ public class ReloadCommand {
networkHandler.start();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
Consumer.isPaused = false;
@@ -31,6 +31,7 @@ import net.coreprotect.model.action.LookupActions;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class RollbackRestoreCommand {
public static void runCommand(CommandSender player, Command command, boolean permission, String[] args, Location argLocation, long forceStart, long forceEnd) {
@@ -450,7 +451,7 @@ public class RollbackRestoreCommand {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
if (ConfigHandler.activeRollbacks.get(player2.getName()) != null) {
ConfigHandler.activeRollbacks.remove(player2.getName());
@@ -463,7 +464,7 @@ public class RollbackRestoreCommand {
thread.start();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
else {
@@ -19,6 +19,7 @@ import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.SystemUtils;
import net.coreprotect.utility.VersionUtils;
import net.coreprotect.utility.ErrorReporter;
public class StatusCommand {
private static ConcurrentHashMap<String, Boolean> alert = new ConcurrentHashMap<>();
@@ -104,7 +105,7 @@ public class StatusCommand {
Chat.sendMessage(player, Color.DARK_AQUA + Phrase.build(Phrase.STATUS_CONSUMER, Color.WHITE, String.format("%,d", consumerCount), (consumerCount == 1 ? Selector.FIRST : Selector.SECOND)));
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
long autoPurgeRowsPurged = ConfigHandler.autoPurgeRowsPurged.get();
@@ -153,7 +154,7 @@ public class StatusCommand {
Chat.sendMessage(player, Color.DARK_AQUA + Phrase.build(Phrase.STATUS_SYSTEM, Color.WHITE, systemInformation));
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
// Functions.sendMessage(player, Color.DARK_AQUA + "Website: " + Color.WHITE + "www.coreprotect.net/updates/");
@@ -176,7 +177,7 @@ public class StatusCommand {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -11,6 +11,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.language.Selector;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class UndoCommand {
protected static void runCommand(CommandSender user, Command command, boolean permission, String[] args) {
@@ -47,7 +48,7 @@ public class UndoCommand {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -10,6 +10,7 @@ import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.world.World;
import net.coreprotect.worldedit.WorldEditLogger;
import net.coreprotect.utility.ErrorReporter;
public class WorldEditHandler {
@@ -49,7 +50,7 @@ public class WorldEditHandler {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
}
@@ -16,6 +16,7 @@ import net.coreprotect.database.lookup.SignMessageLookup;
import net.coreprotect.language.Phrase;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class BlockLookupThread implements Runnable {
private final CommandSender player;
@@ -82,7 +83,7 @@ public class BlockLookupThread implements Runnable {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
ConfigHandler.lookupThrottle.put(player.getName(), new Object[] { false, System.currentTimeMillis() });
@@ -14,6 +14,7 @@ import net.coreprotect.database.lookup.ChestTransactionLookup;
import net.coreprotect.language.Phrase;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class ChestTransactionLookupThread implements Runnable {
private final CommandSender player;
@@ -47,7 +48,7 @@ public class ChestTransactionLookupThread implements Runnable {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
ConfigHandler.lookupThrottle.put(player.getName(), new Object[] { false, System.currentTimeMillis() });
@@ -37,6 +37,7 @@ import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.StringUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class StandardLookupThread implements Runnable {
private final CommandSender player;
@@ -463,7 +464,7 @@ public class StandardLookupThread implements Runnable {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
ConfigHandler.lookupThrottle.put(player.getName(), new Object[] { false, System.currentTimeMillis() });
@@ -54,6 +54,7 @@ public class Config extends Language {
public boolean NETWORK_DEBUG;
public boolean MYSQL;
public boolean CHECK_UPDATES;
public boolean ERROR_REPORTING;
public boolean API_ENABLED;
public boolean VERBOSE;
public boolean ROLLBACK_ITEMS;
@@ -109,6 +110,7 @@ public class Config extends Language {
DEFAULT_VALUES.put("language", "en");
DEFAULT_VALUES.put("auto-purge", "false");
DEFAULT_VALUES.put("check-updates", "true");
DEFAULT_VALUES.put("error-reporting", "true");
DEFAULT_VALUES.put("api-enabled", "true");
DEFAULT_VALUES.put("verbose", "true");
DEFAULT_VALUES.put("default-radius", "10");
@@ -154,6 +156,7 @@ public class Config extends Language {
HEADERS.put("language", new String[] { "# If modified, will automatically attempt to translate languages phrases.", "# List of language codes: https://coreprotect.net/languages/" });
HEADERS.put("auto-purge", new String[] { "# Automatically purge data older than the configured time.", "# Examples: 30d, 12w, 6mo. Set to false to disable." });
HEADERS.put("check-updates", new String[] { "# If enabled, CoreProtect will check for updates when your server starts up.", "# If an update is available, you'll be notified via your server console.", });
HEADERS.put("error-reporting", new String[] { "# Automatically sends errors to the plugin author." });
HEADERS.put("api-enabled", new String[] { "# If enabled, other plugins will be able to utilize the CoreProtect API.", });
HEADERS.put("verbose", new String[] { "# If enabled, extra data is displayed during rollbacks and restores.", "# Can be manually triggered by adding \"#verbose\" to your rollback command." });
HEADERS.put("default-radius", new String[] { "# If no radius is specified in a rollback or restore, this value will be", "# used as the radius. Set to \"0\" to disable automatically adding a radius." });
@@ -219,6 +222,7 @@ public class Config extends Language {
this.AUTO_PURGE = this.getString("auto-purge");
this.AUTO_PURGE_TIME = this.getString("auto-purge-time");
this.CHECK_UPDATES = this.getBoolean("check-updates");
this.ERROR_REPORTING = this.getBoolean("error-reporting");
this.API_ENABLED = this.getBoolean("api-enabled");
this.VERBOSE = this.getBoolean("verbose");
this.DEFAULT_RADIUS = this.getInt("default-radius");
@@ -26,6 +26,7 @@ import java.util.TreeMap;
import net.coreprotect.CoreProtect;
import net.coreprotect.language.Language;
import net.coreprotect.language.Phrase;
import net.coreprotect.utility.ErrorReporter;
public class ConfigFile extends Config {
@@ -201,7 +202,7 @@ public class ConfigFile extends Config {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -222,7 +223,7 @@ public class ConfigFile extends Config {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -40,6 +40,7 @@ import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.SystemUtils;
import net.coreprotect.utility.VersionUtils;
import net.coreprotect.utility.ErrorReporter;
import oshi.hardware.CentralProcessor;
public class ConfigHandler extends Queue {
@@ -210,7 +211,7 @@ public class ConfigHandler extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -237,7 +238,7 @@ public class ConfigHandler extends Queue {
ConfigHandler.loadBlacklist(); // Load the blacklist file if it exists.
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -272,7 +273,7 @@ public class ConfigHandler extends Queue {
Class.forName("org.sqlite.JDBC");
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
else {
@@ -332,7 +333,7 @@ public class ConfigHandler extends Queue {
rs.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -356,7 +357,7 @@ public class ConfigHandler extends Queue {
rs.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -380,7 +381,7 @@ public class ConfigHandler extends Queue {
rs.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -404,7 +405,7 @@ public class ConfigHandler extends Queue {
rs.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -463,7 +464,7 @@ public class ConfigHandler extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return -1;
@@ -501,7 +502,7 @@ public class ConfigHandler extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -540,7 +541,7 @@ public class ConfigHandler extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -561,7 +562,7 @@ public class ConfigHandler extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
try (Connection connection = Database.getConnection(true, 0)) {
@@ -596,7 +597,7 @@ public class ConfigHandler extends Queue {
return validVersion && databaseLock;
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return false;
@@ -608,7 +609,7 @@ public class ConfigHandler extends Queue {
ListenerHandler.unregisterNetworking(); // Unregister channels for networking API
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -14,6 +14,7 @@ import org.bukkit.inventory.ItemStack;
import net.coreprotect.CoreProtect;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.consumer.process.Process;
import net.coreprotect.utility.ErrorReporter;
public class Consumer extends Process implements Runnable, Thread.UncaughtExceptionHandler {
@@ -51,7 +52,7 @@ public class Consumer extends Process implements Runnable, Thread.UncaughtExcept
Thread.sleep(30000); // 30 seconds
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -106,7 +107,7 @@ public class Consumer extends Process implements Runnable, Thread.UncaughtExcept
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
pausedSuccess = false;
}
@@ -133,7 +134,7 @@ public class Consumer extends Process implements Runnable, Thread.UncaughtExcept
Process.processConsumer(process_id, lastRun);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
errorDelay();
}
}
@@ -141,7 +142,7 @@ public class Consumer extends Process implements Runnable, Thread.UncaughtExcept
@Override
public void uncaughtException(Thread thread, Throwable e) {
e.printStackTrace();
ErrorReporter.report(e);
Bukkit.getPluginManager().disablePlugin(CoreProtect.getInstance());
}
@@ -32,6 +32,7 @@ import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.EntityUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class Queue {
@@ -103,7 +104,7 @@ public class Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}, block.getLocation(), ticks);
}
@@ -194,7 +195,7 @@ public class Queue {
queueBlockPlace(user, placed.getBlock().getState(), type, replaced, null, -1, 0, blockData);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}, placed, ticks);
}
@@ -247,7 +248,7 @@ public class Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}, blockLocation.getLocation(), ticks);
}
@@ -16,6 +16,7 @@ import net.coreprotect.consumer.Consumer;
import net.coreprotect.database.Database;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.model.rollback.RollbackUpdateTargets;
import net.coreprotect.utility.ErrorReporter;
public class Process {
@@ -65,7 +66,7 @@ public class Process {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -248,7 +249,7 @@ public class Process {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -281,7 +282,7 @@ public class Process {
consumerData.clear();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
Consumer.consumer_id.put(processId, new Integer[] { 0, 0 });
@@ -307,7 +308,7 @@ public class Process {
Database.commitTransaction(statement, Config.getGlobal().MYSQL);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -12,6 +12,7 @@ import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class BlockLookup {
@@ -48,7 +49,7 @@ public class BlockLookup {
results.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -83,7 +84,7 @@ public class BlockLookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -111,7 +112,7 @@ public class BlockLookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -30,6 +30,7 @@ import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.ErrorReporter;
public class ContainerRollback extends Rollback {
@@ -147,7 +148,7 @@ public class ContainerRollback extends Rollback {
ConfigHandler.rollbackHash.put(finalUserString, new int[] { itemCount, modifyCount, entityCount, 1, 1 });
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}, location, 0);
@@ -184,7 +185,7 @@ public class ContainerRollback extends Rollback {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -30,6 +30,7 @@ import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.ErrorReporter;
public class Database extends Queue {
@@ -80,7 +81,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -104,7 +105,7 @@ public class Database extends Queue {
continue;
}
else {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -127,7 +128,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -150,7 +151,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -179,7 +180,7 @@ public class Database extends Queue {
catch (Exception e) {
ConfigHandler.databaseReachable = false;
Chat.sendConsoleMessage(Color.RED + "[CoreProtect] " + Phrase.build(Phrase.MYSQL_UNAVAILABLE));
e.printStackTrace();
ErrorReporter.report(e);
}
}
else {
@@ -204,7 +205,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return connection;
@@ -218,7 +219,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -236,7 +237,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -250,7 +251,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return preparedStatement;
@@ -272,7 +273,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return preparedStatement;
@@ -304,7 +305,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -337,7 +338,7 @@ public class Database extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
if (!success && forceConnection == null) {
Config.getGlobal().MYSQL = false;
@@ -431,7 +432,7 @@ public class Database extends Queue {
catch (Exception e) {
Chat.console(Phrase.build(Phrase.DATABASE_INDEX_ERROR));
if (purge) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -538,7 +539,7 @@ public class Database extends Queue {
statement.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -650,7 +651,7 @@ public class Database extends Queue {
catch (Exception e) {
Chat.console(Phrase.build(Phrase.DATABASE_INDEX_ERROR));
if (purge) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -13,6 +13,7 @@ import org.bukkit.command.CommandSender;
import net.coreprotect.consumer.Consumer;
import net.coreprotect.consumer.Queue;
import net.coreprotect.utility.ErrorReporter;
public class Lookup extends Queue {
@@ -35,7 +36,7 @@ public class Lookup extends Queue {
results.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
Consumer.isPaused = false;
@@ -51,7 +52,7 @@ public class Lookup extends Queue {
newList = LookupConverter.convertRawLookup(statement, lookupList);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return newList;
@@ -65,7 +66,7 @@ public class Lookup extends Queue {
newList = LookupConverter.convertRawLookup(statement, lookupList);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return newList;
@@ -8,6 +8,7 @@ import java.util.List;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.ErrorReporter;
public class LookupConverter {
@@ -54,7 +55,7 @@ public class LookupConverter {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
newList.add(results);
@@ -26,6 +26,7 @@ import net.coreprotect.model.item.ItemTransactionActions;
import net.coreprotect.utility.EntityUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class LookupRaw extends Queue {
@@ -214,7 +215,7 @@ public class LookupRaw extends Queue {
results.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
Consumer.isPaused = false;
@@ -698,7 +699,7 @@ public class LookupRaw extends Queue {
results = statement.executeQuery(query);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return results;
@@ -19,6 +19,7 @@ import net.coreprotect.model.action.LookupActions;
import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.BlockTypeUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class BlockBreakLogger {
@@ -82,7 +83,7 @@ public class BlockBreakLogger {
BlockStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, internalType, data, meta, blockData, LookupActions.BLOCK_BREAK, 0);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -21,6 +21,7 @@ import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.BlockTypeUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class BlockPlaceLogger {
@@ -126,7 +127,7 @@ public class BlockPlaceLogger {
BlockStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, internalType, data, meta, blockData, LookupActions.BLOCK_PLACE, 0);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -8,6 +8,7 @@ import org.bukkit.Location;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.statement.ChatStatement;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class ChatLogger {
@@ -28,7 +29,7 @@ public class ChatLogger {
ChatStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, message);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -13,6 +13,7 @@ import net.coreprotect.database.statement.CommandStatement;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.event.CoreProtectPreLogEvent;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class CommandLogger {
@@ -47,7 +48,7 @@ public class CommandLogger {
CommandStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, message);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.model.item.ItemTransactionActions;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public class ContainerBreakLogger {
@@ -29,7 +30,7 @@ public class ContainerBreakLogger {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -31,6 +31,7 @@ import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.serialize.ItemMetaHandler;
import net.coreprotect.utility.ErrorReporter;
public class ContainerLogger extends Queue {
@@ -226,7 +227,7 @@ public class ContainerLogger extends Queue {
ConfigHandler.oldContainer.put(loggingContainerId, oldList);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -284,7 +285,7 @@ public class ContainerLogger extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -18,6 +18,7 @@ import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.event.CoreProtectPreLogEvent;
import net.coreprotect.model.action.LookupActions;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class EntityKillLogger {
@@ -77,7 +78,7 @@ public class EntityKillLogger {
BlockStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, type, entity_key, null, null, LookupActions.ENTITY_KILL, 0);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -22,6 +22,7 @@ import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.serialize.ItemMetaHandler;
import net.coreprotect.utility.ErrorReporter;
public class ItemLogger {
@@ -116,7 +117,7 @@ public class ItemLogger {
logTransaction(preparedStmt, batchCount, offset, user, location, itemBuys, ITEM_BUY);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -157,7 +158,7 @@ public class ItemLogger {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -16,6 +16,7 @@ import net.coreprotect.model.action.LookupActions;
import net.coreprotect.utility.BlockTypeUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class PlayerInteractLogger {
@@ -59,7 +60,7 @@ public class PlayerInteractLogger {
BlockStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, type, data, null, blockData, LookupActions.INTERACTION, 0);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -15,6 +15,7 @@ import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.event.CoreProtectPreLogEvent;
import net.coreprotect.model.action.LookupActions;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class PlayerKillLogger {
@@ -53,7 +54,7 @@ public class PlayerKillLogger {
BlockStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, 0, playerId, null, null, LookupActions.ENTITY_KILL, 0);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -8,6 +8,7 @@ import org.bukkit.Location;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.statement.SessionStatement;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class PlayerSessionLogger {
@@ -28,7 +29,7 @@ public class PlayerSessionLogger {
SessionStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, action);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -13,6 +13,7 @@ import net.coreprotect.database.statement.SignStatement;
import net.coreprotect.database.statement.UserStatement;
import net.coreprotect.event.CoreProtectPreLogEvent;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class SignTextLogger {
@@ -59,7 +60,7 @@ public class SignTextLogger {
SignStatement.insert(preparedStmt, batchCount, time, userId, wid, x, y, z, action, color, colorSecondary, data, isWaxed ? 1 : 0, isFront ? 0 : 1, line1, line2, line3, line4, line5, line6, line7, line8);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -12,6 +12,7 @@ import net.coreprotect.database.Database;
import net.coreprotect.database.statement.SkullStatement;
import net.coreprotect.paper.PaperAdapter;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.ErrorReporter;
public class SkullBreakLogger {
@@ -50,7 +51,7 @@ public class SkullBreakLogger {
BlockBreakLogger.log(preparedStmt, batchCount, user, block.getLocation(), type, skullKey, null, block.getBlockData().getAsString(), null);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -12,6 +12,7 @@ import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.database.statement.SkullStatement;
import net.coreprotect.paper.PaperAdapter;
import net.coreprotect.utility.ErrorReporter;
public class SkullPlaceLogger {
@@ -53,7 +54,7 @@ public class SkullPlaceLogger {
BlockPlaceLogger.log(preparedStmt, batchCount, user, block, replaceType, replaceData, type, skullKey, true, null, null, null);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -6,6 +6,7 @@ import java.sql.ResultSet;
import java.util.Locale;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.utility.ErrorReporter;
public class UsernameLogger {
@@ -92,7 +93,7 @@ public class UsernameLogger {
ConfigHandler.uuidCacheReversed.put(uuid, user);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -6,6 +6,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.language.Selector;
import net.coreprotect.listener.channel.PluginChannelListener;
import net.coreprotect.utility.*;
import net.coreprotect.utility.ErrorReporter;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
import org.bukkit.command.CommandSender;
@@ -158,7 +159,7 @@ public class BlockLookup {
ConfigHandler.lookupCommand.put(commandSender.getName(), x + "." + y + "." + z + "." + worldId + ".0." + limit);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return resultText;
}
@@ -21,6 +21,7 @@ import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.StringUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class ChestTransactionLookup {
@@ -143,7 +144,7 @@ public class ChestTransactionLookup {
ConfigHandler.lookupCommand.put(commandSender.getName(), x + "." + y + "." + z + "." + worldId + "." + x2 + "." + y2 + "." + z2 + "." + limit);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -16,6 +16,7 @@ import net.coreprotect.utility.ChatUtils;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class InteractionLookup {
@@ -131,7 +132,7 @@ public class InteractionLookup {
ConfigHandler.lookupCommand.put(commandSender.getName(), x + "." + y + "." + z + "." + worldId + ".2." + limit);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -7,6 +7,7 @@ import java.util.Locale;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.utility.ErrorReporter;
public class PlayerLookup {
@@ -49,7 +50,7 @@ public class PlayerLookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return false;
@@ -19,6 +19,7 @@ import net.coreprotect.model.action.SignActions;
import net.coreprotect.utility.ChatUtils;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class SignMessageLookup {
@@ -177,7 +178,7 @@ public class SignMessageLookup {
ConfigHandler.lookupCommand.put(commandSender.getName(), x + "." + y + "." + z + "." + worldId + ".8." + limit);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -38,6 +38,7 @@ import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.DatabaseUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class Rollback extends RollbackUtil {
@@ -332,7 +333,7 @@ public class Rollback extends RollbackUtil {
return list;
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return null;
@@ -351,7 +352,7 @@ public class Rollback extends RollbackUtil {
future.complete(result);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
future.complete(false);
}
}, chunkLocation, 0);
@@ -51,6 +51,7 @@ import net.coreprotect.utility.EntityUtils;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.Util;
import net.coreprotect.utility.entity.HangingUtil;
import net.coreprotect.utility.ErrorReporter;
public class RollbackBlockHandler extends Queue {
@@ -493,7 +494,7 @@ public class RollbackBlockHandler extends Queue {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
if ((rowType != Material.AIR) && changeBlock) {
@@ -18,6 +18,7 @@ import net.coreprotect.model.action.LookupActions;
import net.coreprotect.model.item.ItemTransactionActions;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ErrorReporter;
public class RollbackComplete {
@@ -309,7 +310,7 @@ public class RollbackComplete {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -14,6 +14,7 @@ import net.coreprotect.config.ConfigHandler;
import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.EntityUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class RollbackEntityHandler {
@@ -103,7 +104,7 @@ public class RollbackEntityHandler {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return 0;
@@ -9,6 +9,7 @@ import org.bukkit.inventory.PlayerInventory;
import org.bukkit.util.io.BukkitObjectInputStream;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.utility.ErrorReporter;
public class RollbackItemHandler {
@@ -33,7 +34,7 @@ public class RollbackItemHandler {
return RollbackUtil.populateItemStack(itemstack, metaList);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -39,6 +39,7 @@ import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.Teleport;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public class RollbackProcessor {
@@ -449,7 +450,7 @@ public class RollbackProcessor {
return true;
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
int[] rollbackHashData = ConfigHandler.rollbackHash.get(finalUserString);
int itemCount = rollbackHashData[0];
int blockCount = rollbackHashData[1];
@@ -39,6 +39,7 @@ import net.coreprotect.consumer.Queue;
import net.coreprotect.database.Lookup;
import net.coreprotect.model.BlockGroup;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public class RollbackUtil extends Lookup {
@@ -230,7 +231,7 @@ public class RollbackUtil extends Lookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return modifiedArmor;
@@ -261,7 +262,7 @@ public class RollbackUtil extends Lookup {
inventory.setStorageContents(storageContents);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -280,7 +281,7 @@ public class RollbackUtil extends Lookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -479,7 +480,7 @@ public class RollbackUtil extends Lookup {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return new Object[] { slot, faceData, itemstack };
}
@@ -496,7 +497,7 @@ public class RollbackUtil extends Lookup {
return populateItemStack(itemstack, metaList);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -525,7 +526,7 @@ public class RollbackUtil extends Lookup {
return metaList;
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
return null;
}
}
@@ -5,6 +5,7 @@ import java.util.List;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public class BlockStatement {
@@ -40,7 +41,7 @@ public class BlockStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -1,6 +1,7 @@
package net.coreprotect.database.statement;
import java.sql.PreparedStatement;
import net.coreprotect.utility.ErrorReporter;
public class ChatStatement {
@@ -24,7 +25,7 @@ public class ChatStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -1,6 +1,7 @@
package net.coreprotect.database.statement;
import java.sql.PreparedStatement;
import net.coreprotect.utility.ErrorReporter;
public class CommandStatement {
@@ -24,7 +25,7 @@ public class CommandStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -3,6 +3,7 @@ package net.coreprotect.database.statement;
import java.sql.PreparedStatement;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public class ContainerStatement {
@@ -32,7 +33,7 @@ public class ContainerStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -18,6 +18,7 @@ import org.bukkit.util.io.BukkitObjectOutputStream;
import net.coreprotect.bukkit.BukkitAdapter;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.utility.ErrorReporter;
public class EntityStatement {
@@ -45,7 +46,7 @@ public class EntityStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return null;
@@ -104,10 +105,8 @@ public class EntityStatement {
resultSet.close();
}
catch (Exception e) { // only display exception on development branch
if (ConfigHandler.EDITION_BRANCH.contains("-dev")) {
e.printStackTrace();
}
catch (Exception e) { // only print exception on development branch
ErrorReporter.report(e, ConfigHandler.EDITION_BRANCH.contains("-dev"));
}
return result;
@@ -3,6 +3,7 @@ package net.coreprotect.database.statement;
import java.sql.PreparedStatement;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public class ItemStatement {
@@ -31,7 +32,7 @@ public class ItemStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -3,6 +3,7 @@ package net.coreprotect.database.statement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import net.coreprotect.utility.ErrorReporter;
public class MaterialStatement {
@@ -21,7 +22,7 @@ public class MaterialStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -36,7 +37,7 @@ public class MaterialStatement {
resultSet.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return result;
@@ -1,6 +1,7 @@
package net.coreprotect.database.statement;
import java.sql.PreparedStatement;
import net.coreprotect.utility.ErrorReporter;
public class SessionStatement {
@@ -24,7 +25,7 @@ public class SessionStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -9,6 +9,7 @@ import org.bukkit.block.Sign;
import net.coreprotect.bukkit.BukkitAdapter;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.ErrorReporter;
public class SignStatement {
@@ -45,7 +46,7 @@ public class SignStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -98,7 +99,7 @@ public class SignStatement {
resultSet.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -9,6 +9,7 @@ import org.bukkit.block.Skull;
import net.coreprotect.database.Database;
import net.coreprotect.paper.PaperAdapter;
import net.coreprotect.utility.ErrorReporter;
public class SkullStatement {
@@ -29,7 +30,7 @@ public class SkullStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return null;
@@ -59,7 +60,7 @@ public class SkullStatement {
resultSet.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -10,6 +10,7 @@ import java.util.Locale;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.utility.ErrorReporter;
public class UserStatement {
@@ -51,7 +52,7 @@ public class UserStatement {
preparedStmt.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return id;
}
@@ -107,7 +108,7 @@ public class UserStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return id;
@@ -143,7 +144,7 @@ public class UserStatement {
statement.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return user;
@@ -1,6 +1,7 @@
package net.coreprotect.database.statement;
import java.sql.PreparedStatement;
import net.coreprotect.utility.ErrorReporter;
public class WorldStatement {
@@ -19,7 +20,7 @@ public class WorldStatement {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -40,6 +40,7 @@ import net.coreprotect.paper.PaperAdapter;
import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public final class BlockBreakListener extends Queue implements Listener {
@@ -250,7 +251,7 @@ public final class BlockBreakListener extends Queue implements Listener {
log = false;
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
if (log && BukkitAdapter.ADAPTER.isSign(blockType)) {
@@ -277,7 +278,7 @@ public final class BlockBreakListener extends Queue implements Listener {
Queue.queueSignText(user, location, SignActions.BREAK, color, colorSecondary, frontGlowing, backGlowing, isWaxed, isFront, line1, line2, line3, line4, line5, line6, line7, line8, 5);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -27,6 +27,7 @@ import net.coreprotect.database.Database;
import net.coreprotect.model.BlockGroup;
import net.coreprotect.model.action.SignActions;
import net.coreprotect.paper.PaperAdapter;
import net.coreprotect.utility.ErrorReporter;
public final class BlockExplodeListener extends Queue implements Listener {
@@ -113,7 +114,7 @@ public final class BlockExplodeListener extends Queue implements Listener {
Queue.queueSignText(user, location, SignActions.BREAK, color, colorSecondary, frontGlowing, backGlowing, isWaxed, isFront, line1, line2, line3, line4, line5, line6, line7, line8, 5);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -32,6 +32,7 @@ import net.coreprotect.thread.CacheHandler;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public final class BlockPlaceListener extends Queue implements Listener {
@@ -131,7 +132,7 @@ public final class BlockPlaceListener extends Queue implements Listener {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -21,6 +21,7 @@ import net.coreprotect.config.Config;
import net.coreprotect.language.Phrase;
import net.coreprotect.language.Selector;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.ErrorReporter;
public class PluginChannelHandshakeListener implements PluginMessageListener, Listener {
@@ -95,7 +96,7 @@ public class PluginChannelHandshakeListener implements PluginMessageListener, Li
}
catch (Exception exception) {
Chat.console(exception.toString());
exception.printStackTrace();
ErrorReporter.report(exception);
}
}
@@ -28,6 +28,7 @@ import net.coreprotect.listener.player.PlayerInteractEntityListener;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.ErrorReporter;
public final class HangingBreakByEntityListener extends Queue implements Listener {
@@ -79,7 +80,7 @@ public final class HangingBreakByEntityListener extends Queue implements Listene
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
ConfigHandler.lookupThrottle.put(player.getName(), new Object[] { false, System.currentTimeMillis() });
@@ -25,6 +25,7 @@ import net.coreprotect.model.BlockGroup;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public final class ArmorStandManipulateListener extends Queue implements Listener {
@@ -68,7 +69,7 @@ public final class ArmorStandManipulateListener extends Queue implements Listene
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
ConfigHandler.lookupThrottle.put(finalPlayer.getName(), new Object[] { false, System.currentTimeMillis() });
@@ -16,6 +16,7 @@ import net.coreprotect.consumer.Queue;
import net.coreprotect.thread.CacheHandler;
import net.coreprotect.thread.Scheduler;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public final class FoodLevelChangeListener extends Queue implements Listener {
@@ -64,7 +65,7 @@ public final class FoodLevelChangeListener extends Queue implements Listener {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}, oldBlockState.getLocation());
}
@@ -18,6 +18,7 @@ import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.thread.Scheduler;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public final class HopperPullListener {
@@ -59,7 +60,7 @@ public final class HopperPullListener {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
finally {
activeProcessors.decrementAndGet();
@@ -18,6 +18,7 @@ import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.thread.Scheduler;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.ErrorReporter;
public final class HopperPushListener {
@@ -64,7 +65,7 @@ public final class HopperPushListener {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
finally {
activeProcessors.decrementAndGet();
@@ -41,6 +41,7 @@ import net.coreprotect.paper.PaperAdapter;
import net.coreprotect.thread.Scheduler;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.Validate;
import net.coreprotect.utility.ErrorReporter;
import us.lynuxcraft.deadsilenceiv.advancedchests.AdvancedChestsAPI;
import us.lynuxcraft.deadsilenceiv.advancedchests.chest.AdvancedChest;
@@ -75,7 +76,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -297,7 +298,7 @@ public final class InventoryChangeListener extends Queue implements Listener {
onInventoryInteract(player.getName(), inventory, containerState, containerType, inventoryLocation, true);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
});
}
@@ -62,6 +62,7 @@ import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.ItemUtils;
import net.coreprotect.utility.WorldUtils;
import net.coreprotect.utility.ErrorReporter;
public final class PlayerInteractListener extends Queue implements Listener {
@@ -397,7 +398,7 @@ public final class PlayerInteractListener extends Queue implements Listener {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
});
*/
@@ -709,7 +710,7 @@ public final class PlayerInteractListener extends Queue implements Listener {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}, locationFinal);
}
@@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
import net.coreprotect.database.lookup.BlockLookup;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.ErrorReporter;
public class BlockInspector extends BaseInspector {
@@ -46,7 +47,7 @@ public class BlockInspector extends BaseInspector {
Chat.sendMessage(player, e.getMessage());
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
finally {
finishInspection(player);
@@ -99,7 +100,7 @@ public class BlockInspector extends BaseInspector {
Chat.sendMessage(player, e.getMessage());
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
finally {
finishInspection(player);
@@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
import net.coreprotect.database.lookup.ChestTransactionLookup;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.ErrorReporter;
public class ContainerInspector extends BaseInspector {
@@ -33,7 +34,7 @@ public class ContainerInspector extends BaseInspector {
Chat.sendMessage(player, e.getMessage());
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
finally {
finishInspection(player);
@@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
import net.coreprotect.database.lookup.InteractionLookup;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.ErrorReporter;
public class InteractionInspector extends BaseInspector {
@@ -38,7 +39,7 @@ public class InteractionInspector extends BaseInspector {
Chat.sendMessage(player, e.getMessage());
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
finally {
finishInspection(player);
@@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
import net.coreprotect.database.lookup.SignMessageLookup;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.ErrorReporter;
public class SignInspector extends BaseInspector {
@@ -43,7 +44,7 @@ public class SignInspector extends BaseInspector {
Chat.sendMessage(player, e.getMessage());
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
finally {
finishInspection(player);
@@ -13,6 +13,7 @@ import org.bukkit.profile.PlayerTextures;
import com.destroystokyo.paper.profile.PlayerProfile;
import net.coreprotect.config.Config;
import net.coreprotect.utility.ErrorReporter;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
public class Paper_v1_20 extends Paper_v1_17 {
@@ -71,7 +72,7 @@ public class Paper_v1_20 extends Paper_v1_17 {
skull.setPlayerProfile(playerProfile);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -21,6 +21,7 @@ import net.coreprotect.language.Phrase;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.Color;
import net.coreprotect.utility.VersionUtils;
import net.coreprotect.utility.ErrorReporter;
public class Patch {
@@ -83,7 +84,7 @@ public class Patch {
statement.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return last_version;
@@ -124,7 +125,7 @@ public class Patch {
});
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return patches;
@@ -143,7 +144,7 @@ public class Patch {
ConfigHandler.serverRunning = isRunning;
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
@@ -187,7 +188,7 @@ public class Patch {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
if (success) {
@@ -222,7 +223,7 @@ public class Patch {
statement.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
patching = false;
@@ -273,7 +274,7 @@ public class Patch {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -298,7 +299,7 @@ public class Patch {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
@@ -319,7 +320,7 @@ public class Patch {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -4,6 +4,7 @@ import java.sql.Statement;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.utility.ErrorReporter;
public class __2_10_0 {
@@ -18,7 +19,7 @@ public class __2_10_0 {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -9,6 +9,7 @@ import org.bukkit.entity.EntityType;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.utility.ErrorReporter;
public class __2_11_0 {
@@ -62,7 +63,7 @@ public class __2_11_0 {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -7,6 +7,7 @@ import java.sql.Statement;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.utility.ErrorReporter;
public class __2_15_0 {
@@ -53,7 +54,7 @@ public class __2_15_0 {
ConfigHandler.loadTypes(statement);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -8,6 +8,7 @@ import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.database.Database;
import net.coreprotect.patch.Patch;
import net.coreprotect.utility.ErrorReporter;
public class __2_16_0 {
@@ -65,7 +66,7 @@ public class __2_16_0 {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
if (!Patch.continuePatch()) {
@@ -99,7 +100,7 @@ public class __2_16_0 {
Database.commitTransaction(statement, Config.getGlobal().MYSQL);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -4,6 +4,7 @@ import java.sql.Statement;
import net.coreprotect.config.Config;
import net.coreprotect.config.ConfigHandler;
import net.coreprotect.utility.ErrorReporter;
public class __2_17_0 {
@@ -17,7 +18,7 @@ public class __2_17_0 {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -17,6 +17,7 @@ import net.coreprotect.database.Database;
import net.coreprotect.patch.Patch;
import net.coreprotect.utility.BlockUtils;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.ErrorReporter;
public class __2_18_0 {
@@ -33,7 +34,7 @@ public class __2_18_0 {
catch (Exception e) {
String error = e.getMessage().toLowerCase();
if (!error.contains("duplicate") && !error.contains("error 1060")) {
e.printStackTrace();
ErrorReporter.report(e);
return false;
}
}
@@ -162,7 +163,7 @@ public class __2_18_0 {
resultSet.close();
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
Database.commitTransaction(statement, Config.getGlobal().MYSQL);
@@ -195,13 +196,13 @@ public class __2_18_0 {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -3,6 +3,7 @@ package net.coreprotect.patch.script;
import java.sql.Statement;
import net.coreprotect.patch.Patch;
import net.coreprotect.utility.ErrorReporter;
public class __2_18_1 {
@@ -15,7 +16,7 @@ public class __2_18_1 {
}
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
@@ -17,6 +17,7 @@ import net.coreprotect.language.Selector;
import net.coreprotect.patch.Patch;
import net.coreprotect.utility.Chat;
import net.coreprotect.utility.MaterialUtils;
import net.coreprotect.utility.ErrorReporter;
public class __2_19_0 {
@@ -169,7 +170,7 @@ public class __2_19_0 {
Database.commitTransaction(statement, Config.getGlobal().MYSQL);
}
catch (Exception e) {
e.printStackTrace();
ErrorReporter.report(e);
}
return true;
Loaded 100 of 128 files, more files were not shown because too many files have changed in this diff. Show more