| 81 | } |
| 82 | |
| 83 | @Mod.EventHandler |
| 84 | public void load(FMLInitializationEvent evt) { |
| 85 | NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler()); |
| 86 | |
| 87 | String commandLine = System.getProperty("sun.java.command"); |
| 88 | OptionParser optionparser = new OptionParser(); |
| 89 | optionparser.allowsUnrecognizedOptions(); |
| 90 | |
| 91 | ArgumentAcceptingOptionSpec<String> testOption = optionparser.accepts("test").withRequiredArg(); |
| 92 | OptionSpecBuilder quitOption = optionparser.accepts("quit"); |
| 93 | |
| 94 | OptionSet optionset = optionparser.parse(commandLine.split(" ")); |
| 95 | testFile = optionset.valueOf(testOption); |
| 96 | quitAfterRun = optionset.has(quitOption); |
| 97 | |
| 98 | if (testFile != null && !"".equals(testFile)) { |
| 99 | MinecraftForge.EVENT_BUS.register(this); |
| 100 | System.out.println("[TEST 0] [LOAD TEST] \"" + testFile + "\""); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | @SubscribeEvent |
| 105 | public void tick(WorldTickEvent evt) { |