From 414272f1bf073396e6ac35ed3db47032c386294c Mon Sep 17 00:00:00 2001 From: lbenav8095 Date: Thu, 30 Nov 2023 09:37:16 -0600 Subject: [PATCH] Improves logging whenever reading BlobObjects (previously method only catched Exceptions, not all types of Throwables) --- ci-pom.xml | 2 +- local-pom.xml | 6 +----- pom.xml | 2 +- .../java/us/mytheria/bloblib/entities/ObjectDirector.java | 8 ++++---- .../bloblib/managers/InventoryTrackerManager.java | 4 ++-- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/ci-pom.xml b/ci-pom.xml index dbfb63cc..8482bfd5 100644 --- a/ci-pom.xml +++ b/ci-pom.xml @@ -7,7 +7,7 @@ us.mytheria BlobLib - 1.697.28 + 1.697.30 pom.xml bloblib diff --git a/local-pom.xml b/local-pom.xml index 86123cef..2ace98d7 100644 --- a/local-pom.xml +++ b/local-pom.xml @@ -5,7 +5,7 @@ us.mytheria BlobLib - 1.697.28 + 1.697.30 pom.xml bloblib @@ -75,10 +75,6 @@ org.apache.commons global.warming.commons - - net.milkbowl.vault - nuclear.winter.vault - false diff --git a/pom.xml b/pom.xml index 115be56d..70c6f8a3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 us.mytheria BlobLib - 1.697.28 + 1.697.30 pom diff --git a/src/main/java/us/mytheria/bloblib/entities/ObjectDirector.java b/src/main/java/us/mytheria/bloblib/entities/ObjectDirector.java index c4188f15..109f7c21 100644 --- a/src/main/java/us/mytheria/bloblib/entities/ObjectDirector.java +++ b/src/main/java/us/mytheria/bloblib/entities/ObjectDirector.java @@ -83,10 +83,10 @@ public void loadFiles(File path, CompletableFuture mainFuture) { objectIsEditable = true; this.addObject(blobObject.getKey(), blobObject, file); } - } catch (Exception exception) { - Bukkit.getLogger().log(Level.SEVERE, exception.getMessage() + " \n " + - "At: " + file.getPath(), exception); - mainFuture.completeExceptionally(exception); + } catch (Throwable throwable) { + Bukkit.getLogger().log(Level.SEVERE, throwable.getMessage() + " \n " + + "At: " + file.getPath(), throwable); + mainFuture.completeExceptionally(throwable); } }); futures.add(fileFuture); diff --git a/src/main/java/us/mytheria/bloblib/managers/InventoryTrackerManager.java b/src/main/java/us/mytheria/bloblib/managers/InventoryTrackerManager.java index 68268c09..1674c323 100644 --- a/src/main/java/us/mytheria/bloblib/managers/InventoryTrackerManager.java +++ b/src/main/java/us/mytheria/bloblib/managers/InventoryTrackerManager.java @@ -76,7 +76,7 @@ public MetaBlobInventoryTracker trackMetaInventory(@NotNull Player player, @NotN } @EventHandler - public void onLocaleChange(PlayerLocaleChangeEvent event) { + private void onLocaleChange(PlayerLocaleChangeEvent event) { Player player = event.getPlayer(); InventoryTracker result = this.playerTracker.get(player.getUniqueId()); if (result == null) @@ -88,7 +88,7 @@ public void onLocaleChange(PlayerLocaleChangeEvent event) { } @EventHandler - public void onClick(InventoryClickEvent event) { + private void onClick(InventoryClickEvent event) { Inventory clickedInventory = event.getClickedInventory(); if (clickedInventory == null) return;