From ebd515e7dfc5539f118c55078a229322f7db5617 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 30 Jan 2022 12:35:12 +1300 Subject: [PATCH] If we can't find something to convert, return the original. --- .../disguise/utilities/reflection/ReflectionManager.java | 2 ++ .../disguise/utilities/reflection/v1_17/ReflectionManager.java | 2 +- .../disguise/utilities/reflection/v1_18/ReflectionManager.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java index c93639c5..77d69204 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java @@ -1352,6 +1352,8 @@ public class ReflectionManager { return NmsVersion.v1_13.isSupported() ? Optional.of(obj) : com.google.common.base.Optional.of(obj); } else if (!NmsVersion.v1_13.isSupported()) { return com.google.common.base.Optional.of(val); + } else { + return Optional.of(val); } } else if (value instanceof Vector3F) { Vector3F angle = (Vector3F) value; diff --git a/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java b/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java index f2af28c1..044a8c98 100644 --- a/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java +++ b/v1_17_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_17/ReflectionManager.java @@ -315,7 +315,7 @@ public class ReflectionManager implements ReflectionManagerAbstract { return Optional.of(obj); } - return Optional.empty(); + return Optional.of(val); } public Vector3f convertVec3(Object object) { diff --git a/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java b/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java index c6d070d9..75d022a6 100644 --- a/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java +++ b/v1_18_R1/src/main/java/me/libraryaddict/disguise/utilities/reflection/v1_18/ReflectionManager.java @@ -315,7 +315,7 @@ public class ReflectionManager implements ReflectionManagerAbstract { return Optional.of(obj); } - return Optional.empty(); + return Optional.of(val); } public Vector3f convertVec3(Object object) {