09-04-2014, 07:20 PM
Sorry for the late reply, but things are a little bit hectic seeing as I am preparing to switch to dorm-life in the near future. I have now educated myself a bit in ClassLoaders. Just to confirm that what I think I understand is correct:
Current system
New system
But I'm still wondering on how extending classes would work exactly. Your methods and fields need to be obfuscated, as you said is the case with mods, because otherwise it won't override the class'. But if it is obfuscated, how would you avoid compile-time errors? Also if they're obfuscated, it would require updating every release?
Current system
- The JAR is located and in a single pass, all required classes are loaded using reflection.
- The translator is further used to call get method and field names of those classes.
- All libraries are linked in a hacky way (sim.loading.ClassPathHack).
- Only run-time linking is possible, so no extending classes without bytecode manipulation.
New system
- The MC source is added to the project (but ofc git ignored) so that we can use its class names and have proper imports.
- A ClassLoader will translate and load classes out of the JAR when needed.
- Using MC's classes is trivial and automatic.
But I'm still wondering on how extending classes would work exactly. Your methods and fields need to be obfuscated, as you said is the case with mods, because otherwise it won't override the class'. But if it is obfuscated, how would you avoid compile-time errors? Also if they're obfuscated, it would require updating every release?