mirror of
https://github.com/ViaVersion/ViaRewind-Legacy-Support.git
synced 2025-01-20 20:51:18 +01:00
Support Paper 1.21, print proper exception
Closes https://github.com/ViaVersion/ViaRewind-Legacy-Support/issues/82
This commit is contained in:
parent
28f14ce635
commit
5380fc9c1b
@ -18,6 +18,7 @@
|
||||
|
||||
package com.viaversion.viarewind.legacysupport.feature;
|
||||
|
||||
import com.viaversion.viarewind.legacysupport.util.ReflectionUtil;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@ -154,7 +155,10 @@ public class BlockCollisionChanges {
|
||||
final Field isEmpty = getFieldAccessible(voxelShape, "isEmpty");
|
||||
isEmpty.setBoolean(voxelShapeArray, true);
|
||||
|
||||
final Method initCache = voxelShape.getDeclaredMethod("initCache");
|
||||
final Method initCache = ReflectionUtil.findMethod(voxelShape, new String[]{ "initCache", "moonrise$initCache" });
|
||||
if (initCache == null) {
|
||||
throw new IllegalStateException("Could not find initCache method in " + voxelShape.getName());
|
||||
}
|
||||
initCache.invoke(voxelShapeArray);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user