Skip to content

Commit 51a84bb

Browse files
committed
Don't attempt to load classes while checking for them
1 parent e1715e2 commit 51a84bb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ProtocolLib/src/main/java/com/comphenix/protocol/reflect/compiler/StructureCompiler.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ public boolean equals(Object obj) {
146146
private static String SUPER_CLASS = "com/comphenix/protocol/reflect/StructureModifier";
147147
private static String COMPILED_CLASS = PACKAGE_NAME + "/CompiledStructureModifier";
148148
private static String FIELD_EXCEPTION_CLASS = "com/comphenix/protocol/reflect/FieldAccessException";
149+
150+
private static boolean attemptClassLoad = false;
149151

150152
/**
151153
* Construct a structure compiler.
@@ -168,6 +170,11 @@ public <TField> boolean lookupClassLoader(StructureModifier<TField> source) {
168170
return true;
169171
}
170172

173+
// Fix: Loading classes causes a ton of lag and isn't necessary
174+
if (!attemptClassLoad) {
175+
return false;
176+
}
177+
171178
try {
172179
String className = getCompiledName(source);
173180

0 commit comments

Comments
 (0)