refac: убрана лишняя рефлексия

This commit is contained in:
2025-06-12 00:17:52 +03:00
parent aeb88f0f41
commit 375ae523da
2 changed files with 4 additions and 16 deletions

View File

@@ -1,24 +1,12 @@
import java.io.File;
import java.lang.reflect.Field;
import net.minecraft.client.Minecraft;
import java.io.File;
public class Start
{
public static void main(String[] args)
{
try
{
Field f = Minecraft.class.getDeclaredField("minecraftDir");
Field.setAccessible(new Field[] { f }, true);
f.set(null, new File("."));
}
catch (Exception e)
{
e.printStackTrace();
return;
}
Minecraft.minecraftDir = new File(".");
Minecraft.main(args);
}
}

View File

@@ -227,7 +227,7 @@ public abstract class Minecraft implements Runnable
private TextureLavaFX textureLavaFX;
/** The working dir (OS specific) for minecraft */
private static File minecraftDir = null;
public static File minecraftDir = null;
/**
* Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly.