Add authlibinjector.dumpClass option

This commit is contained in:
yushijinhun 2018-07-08 14:55:19 +08:00
parent e4cc4dd8aa
commit 760c90a37b
No known key found for this signature in database
GPG key ID: 5BC167F73EA558E4

View file

@ -55,6 +55,11 @@ public final class AuthlibInjector {
*/
public static final String PROP_DEBUG = "authlibinjector.debug";
/**
* Whether to save modified classes for debugging.
*/
public static final String PROP_DUMP_CLASS = "authlibinjector.dumpClass";
// ====
private AuthlibInjector() {}
@ -134,7 +139,7 @@ public final class AuthlibInjector {
private static ClassTransformer createTransformer(YggdrasilConfiguration config) {
ClassTransformer transformer = new ClassTransformer();
transformer.debugSaveClass = false; // TODO: add an option?
transformer.debugSaveClass = "true".equals(System.getProperty(PROP_DUMP_CLASS));
for (String ignore : nonTransformablePackages)
transformer.ignores.add(ignore);