From 957bf70c260b77adbb75b4ee4b8d1c0ff94e9358 Mon Sep 17 00:00:00 2001 From: Intelli Date: Mon, 17 Jun 2024 18:44:46 -0600 Subject: [PATCH] Hide entity deserialization errors unless using development branch (fixes #552) --- .../coreprotect/database/statement/EntityStatement.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/coreprotect/database/statement/EntityStatement.java b/src/main/java/net/coreprotect/database/statement/EntityStatement.java index 517f9859..a3c91ce2 100644 --- a/src/main/java/net/coreprotect/database/statement/EntityStatement.java +++ b/src/main/java/net/coreprotect/database/statement/EntityStatement.java @@ -12,6 +12,7 @@ import org.bukkit.util.io.BukkitObjectInputStream; import org.bukkit.util.io.BukkitObjectOutputStream; +import net.coreprotect.config.ConfigHandler; import net.coreprotect.database.Database; public class EntityStatement { @@ -64,8 +65,10 @@ public static List getData(Statement statement, BlockState block, String resultSet.close(); } - catch (Exception e) { - e.printStackTrace(); + catch (Exception e) { // only display this exception on development branch + if (!ConfigHandler.EDITION_BRANCH.contains("-dev")) { + e.printStackTrace(); + } } return result;