// Drives the fake client the way the game would, so the bridge can be tested // end to end: bring the client up, hand the mods to the vendor loader, then tick. // // The mod jars are NOT loaded here - the agent finds them in build/testrun/mods // and feeds them to ilxq one by one, exactly as it does in the game. The last // one loaded is the only one whose getRunnableList() the vendor keeps, so the // first two only work if the bridge really has a single shared drain. // // The HUD part mimics the one path that matters: the compass widget renders, and // only while the HUD screen's gate is open. Toggling the gate is what the game's // own hide key does, so the test can check the panel follows it. public class FakeMain { public static void main(String[] args) throws Exception { System.out.println("[fake] class loader: " + FakeMain.class.getClassLoader()); System.out.println("[fake] joml.fastmath = " + System.getProperty("joml.fastmath")); wwk client = new wwk(); wwk.WA = client; ddvqd player = new ddvqd("Steve", 35789); player.g = 10.5; player.F = 64.0; player.a = -3.25; client.zb = player; oisywi world = new oisywi(); world.isRemoteFlag = true; world.time = 1000L; client.ta = world; client.S = null; client.Zb = "TIMER"; client.jC = "RENDER"; client.pC = new pvdafug("http://snoop.minecraft.net/report"); System.out.println("[fake] client up, telemetry scheduled"); // ---- the latency estimate, from the server's keep-alive cadence. // // The server keeps a 15 s cadence measured on its own clock, so the // deviation of the arrival interval is the network's. The stand compress // that into milliseconds; what matters is that a constant offset shows // up in the estimate. cxaddrz play = new cxaddrz(); System.out.println("[fake] feeding keep-alive arrivals, 240 ms apart, period 200"); for (int i = 0; i < 6; i++) { Thread.sleep(240); play.onKeepAlive(new Object()); } System.out.println("[fake] keep-alives fed"); Thread.sleep(2500); System.out.println("[fake] ticking 8 times"); for (int i = 0; i < 8; i++) { if (i == 2) { client.S = new bsh(); System.out.println("[fake] opened a screen"); } if (i == 4) { client.S = null; System.out.println("[fake] closed the screen"); } client.tick(); Thread.sleep(200); } // ---- the HUD, drawn by the compass widget the way the game draws it fakecompass compass = new fakecompass(); fakectx ctx = new fakectx(); fakescreen screen = fakescreen.SINGLE; System.out.println("[fake] HUD visible for 3 frames"); for (int i = 0; i < 3; i++) { fakebatch.reset(); if (!screen.isHidden()) { compass.render(ctx); } System.out.println("[fake] frame " + i + " commands=" + fakebatch.DRAWN.size() + (fakebatch.DRAWN.isEmpty() ? "" : " first=" + fakebatch.DRAWN.get(0) + " last=" + fakebatch.DRAWN.get( fakebatch.DRAWN.size() - 1))); } System.out.println("[fake] HUD hidden (what F3 does) for 3 frames"); screen.setHidden(true); for (int i = 0; i < 3; i++) { fakebatch.reset(); if (!screen.isHidden()) { compass.render(ctx); } System.out.println("[fake] frame " + i + " commands=" + fakebatch.DRAWN.size()); } screen.setHidden(false); System.out.println("[fake] done"); } }