From 7fe95f00ecef22eae7674b2ecdefaebb380773c6 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 16 Dec 2021 08:50:29 +1300 Subject: [PATCH] Fix custom names for 1.17 and 1.18 --- .../disguise/utilities/reflection/ReflectionManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 19cc18c7..c5f85107 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 @@ -1310,14 +1310,15 @@ public class ReflectionManager { public static Object convertInvalidMeta(Object value) { if (value instanceof Optional) { Optional opt = (Optional) value; - if (nmsReflection != null) { - return nmsReflection.convertOptional(opt); - } if (!opt.isPresent()) { return NmsVersion.v1_13.isSupported() ? value : com.google.common.base.Optional.absent(); } + if (nmsReflection != null) { + return nmsReflection.convertOptional(opt.get()); + } + Object val = opt.get(); if (val instanceof BlockPosition) {