Fix custom names for 1.17 and 1.18

This commit is contained in:
libraryaddict 2021-12-16 08:50:29 +13:00
parent 771a827e33
commit 7fe95f00ec

View File

@ -1310,14 +1310,15 @@ public class ReflectionManager {
public static Object convertInvalidMeta(Object value) { public static Object convertInvalidMeta(Object value) {
if (value instanceof Optional) { if (value instanceof Optional) {
Optional opt = (Optional) value; Optional opt = (Optional) value;
if (nmsReflection != null) {
return nmsReflection.convertOptional(opt);
}
if (!opt.isPresent()) { if (!opt.isPresent()) {
return NmsVersion.v1_13.isSupported() ? value : com.google.common.base.Optional.absent(); return NmsVersion.v1_13.isSupported() ? value : com.google.common.base.Optional.absent();
} }
if (nmsReflection != null) {
return nmsReflection.convertOptional(opt.get());
}
Object val = opt.get(); Object val = opt.get();
if (val instanceof BlockPosition) { if (val instanceof BlockPosition) {