package dev.zprestige.prestige.inject; /** JDK-only check; no game, Fabric runtime or native injection required. */ public final class MinecraftTargetCheck { public static void main(String[] args) { for (int patch = 1; patch <= 11; patch++) { String target = "1.21." + patch; MinecraftTarget.require(target, target); for (int other = 1; other <= 11; other++) { if (patch != other) rejects(target, "1.21." + other); } } rejects("1.21.11", "1.21.11-pre1"); rejects("1.21.11", "1.21.110"); rejects("", ""); System.out.println("Minecraft target checks passed"); } private static void rejects(String target, String actual) { try { MinecraftTarget.require(target, actual); } catch (IllegalStateException expected) { if (!expected.getMessage().contains(actual)) throw new AssertionError(expected); return; } throw new AssertionError("Accepted mismatched target " + target + " / " + actual); } }