mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-11 18:00:29 +00:00
Use UnsafeHacks to construct the test function info
This has been stripped (only in CI on 1.15, always in 1.16) so blows up when we try to call it.
This commit is contained in:
parent
88f5b20353
commit
f78e24f9a0
@ -12,10 +12,10 @@ import net.minecraft.test.TestRegistry;
|
||||
import net.minecraft.test.TestTrackerHolder;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import net.minecraftforge.fml.unsafe.UnsafeHacks;
|
||||
import net.minecraftforge.forgespi.language.ModFileScanData;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
@ -89,10 +89,7 @@ class TestLoader
|
||||
{
|
||||
try
|
||||
{
|
||||
Constructor<TestFunctionInfo> ctor = TestFunctionInfo.class.getDeclaredConstructor();
|
||||
ctor.setAccessible( true );
|
||||
|
||||
TestFunctionInfo func = ctor.newInstance();
|
||||
TestFunctionInfo func = UnsafeHacks.newInstance( TestFunctionInfo.class );
|
||||
setFinalField( func, "batchName", batchName );
|
||||
setFinalField( func, "testName", testName );
|
||||
setFinalField( func, "structureName", structureName );
|
||||
|
@ -15,4 +15,3 @@ displayName="CC: Tweaked test framework"
|
||||
description='''
|
||||
A test framework for ensuring CC: Tweaked works correctly.
|
||||
'''
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user