Skip to content

Commit

Permalink
Hide item deserialization errors unless using development branch (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelli committed Jun 18, 2024
1 parent 957bf70 commit aaa7a35
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static List<Object> getData(Statement statement, BlockState block, String

resultSet.close();
}
catch (Exception e) { // only display this exception on development branch
catch (Exception e) { // only display exception on development branch
if (!ConfigHandler.EDITION_BRANCH.contains("-dev")) {
e.printStackTrace();
}
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/net/coreprotect/utility/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,18 @@ public static byte[] convertByteData(Object data) {
return result;
}

public static ItemMeta deserializeItemMeta(Class<? extends ItemMeta> itemMetaClass, Map<String, Object> args) {
DelegateDeserialization delegate = itemMetaClass.getAnnotation(DelegateDeserialization.class);
return (ItemMeta) ConfigurationSerialization.deserializeObject(args, delegate.value());
public static ItemMeta deserializeItemMetax(Class<? extends ItemMeta> itemMetaClass, Map<String, Object> args) {
try {
DelegateDeserialization delegate = itemMetaClass.getAnnotation(DelegateDeserialization.class);
return (ItemMeta) ConfigurationSerialization.deserializeObject(args, delegate.value());
}
catch (Exception e) { // only display exception on development branch
if (!ConfigHandler.EDITION_BRANCH.contains("-dev")) {
e.printStackTrace();
}
}

return null;
}

public static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> entriesSortedByValues(Map<K, V> map) {
Expand Down

0 comments on commit aaa7a35

Please sign in to comment.