MCPcopy Create free account
hub / github.com/GraxCode/zelixkiller / setup

Method setup

src/me/lpk/util/Setup.java:252–283  ·  view source on GitHub ↗

Loads RT the first time around. When this is loaded and saved once, it makes using LazySetupMaker much quicker than doing it every time. It'd be even better to save this to a local file or something.

()

Source from the content-addressed store, hash-verified

250 * even better to save this to a local file or something.
251 */
252 public static void setup() {
253 try {
254 if (setup) {
255 return;
256 }
257 Logger.logLow("Setting up " + sc + "...");
258 Map<String, ClassNode> libNodes = new HashMap<String, ClassNode>();
259 for (ClassNode cn : JarUtils.loadRT().values()) {
260 libNodes.put(cn.name, cn);
261 }
262 Map<String, MappedClass> libMappings = new HashMap<String, MappedClass>(MappingFactory.mappingsFromNodesNoLinking(libNodes));
263
264 for (MappedClass mc : libMappings.values()) {
265 mc.setIsLibrary(true);
266 for (MappedMember mm : mc.getFields()) {
267 mm.setIsLibrary(true);
268 }
269 for (MappedMember mm : mc.getMethods()) {
270 mm.setIsLibrary(true);
271 }
272 }
273 for (MappedClass mc : libMappings.values()) {
274 MappingFactory.linkMappings(mc, libMappings);
275 }
276 rtMappings = libMappings;
277 setup = true;
278 } catch (IOException e) {
279 e.printStackTrace();
280 rtMappings = new HashMap<String, MappedClass>();
281 }
282 Logger.logLow("Finished setting up "+sc+"!");
283 }
284
285 static class ImpatientSetupException extends Exception {
286 public ImpatientSetupException() {

Callers

nothing calls this directly

Calls 7

logLowMethod · 0.95
loadRTMethod · 0.95
linkMappingsMethod · 0.95
setIsLibraryMethod · 0.80
getFieldsMethod · 0.80
getMethodsMethod · 0.80

Tested by

no test coverage detected