22
33import org .junit .jupiter .api .BeforeAll ;
44import org .junit .jupiter .api .Test ;
5+ import se .llbit .chunky .PersistentSettings ;
56import se .llbit .chunky .main .Chunky ;
67import se .llbit .chunky .main .ChunkyOptions ;
78import se .llbit .chunky .main .CommandLineOptions ;
@@ -24,11 +25,17 @@ static void download_mc() {
2425 new CommandLineOptions (new String [] { "-download-mc" , "1.21.8" });
2526 }
2627
28+ private static String getMcPath () {
29+ return new File (new File (PersistentSettings .settingsDirectory (), "resources" ), "minecraft.jar" ).getPath ();
30+ }
31+
2732 @ Test
2833 void render () throws IOException , InterruptedException , NoSuchFieldException , IllegalAccessException {
2934 // Initialize Chunky
3035 Chunky .loadDefaultTextures ();
31- Chunky chunky = new Chunky (ChunkyOptions .getDefaults ());
36+ ChunkyOptions options = ChunkyOptions .getDefaults ();
37+ options .addResourcePacks (getMcPath ());
38+ Chunky chunky = new Chunky (options );
3239 Field chunkyHeadless = chunky .getClass ().getDeclaredField ("headless" );
3340 chunkyHeadless .setAccessible (true );
3441 chunkyHeadless .set (chunky , true );
@@ -57,7 +64,9 @@ void render() throws IOException, InterruptedException, NoSuchFieldException, Il
5764 void preview_render () throws IOException , InterruptedException , NoSuchFieldException , IllegalAccessException {
5865 // Initialize Chunky
5966 Chunky .loadDefaultTextures ();
60- Chunky chunky = new Chunky (ChunkyOptions .getDefaults ());
67+ ChunkyOptions options = ChunkyOptions .getDefaults ();
68+ options .addResourcePacks (getMcPath ());
69+ Chunky chunky = new Chunky (options );
6170 Field chunkyHeadless = chunky .getClass ().getDeclaredField ("headless" );
6271 chunkyHeadless .setAccessible (true );
6372 chunkyHeadless .set (chunky , true );
0 commit comments