Fix reflect wrapper MCDataConverter

This commit is contained in:
Marc Baloup 2023-02-19 19:31:02 +01:00
parent 73d96d0bb7
commit add5d3bcd7

View File

@ -12,7 +12,7 @@ import static fr.pandacube.lib.util.ThrowableUtil.wrapReflectEx;
public class MCDataConverter extends ReflectWrapper { public class MCDataConverter extends ReflectWrapper {
public static final ReflectClass<?> REFLECT = wrapEx(() -> Reflect.ofClass("ca.spottedleaf.dataconverter.minecraft.MCDataConverter")); public static final ReflectClass<?> REFLECT = wrapEx(() -> Reflect.ofClass("ca.spottedleaf.dataconverter.minecraft.MCDataConverter"));
private static final ReflectMethod<?> convertTag = wrapEx(() -> REFLECT.method("convertTag", Component.MAPPING.runtimeClass())); private static final ReflectMethod<?> convertTag = wrapEx(() -> REFLECT.method("convertTag", MCDataType.REFLECT.get(), CompoundTag.MAPPING.runtimeClass(), int.class, int.class));
public static CompoundTag convertTag(MCDataType type, CompoundTag data, int fromVersion, int toVersion) { public static CompoundTag convertTag(MCDataType type, CompoundTag data, int fromVersion, int toVersion) {
return wrap(wrapReflectEx(() -> convertTag.invokeStatic(unwrap(type), unwrap(data), fromVersion, toVersion)), CompoundTag.class); return wrap(wrapReflectEx(() -> convertTag.invokeStatic(unwrap(type), unwrap(data), fromVersion, toVersion)), CompoundTag.class);