File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
src/main/java/github/kasuminova/stellarcore Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1+ package github .kasuminova .stellarcore .common .util ;
2+
3+ @ SuppressWarnings ("unused" )
4+ public class RuntimeEnv {
5+ private RuntimeEnv () {
6+ }
7+
8+ public static final boolean IS_CLEANROOM_LOADER = isClassInPath ("com.cleanroommc.common.CleanroomContainer" );
9+
10+ public static boolean isClassInPath (String className ) {
11+ String classPath = className .replace ('.' , '/' ) + ".class" ;
12+ try {
13+ return Thread .currentThread ().getContextClassLoader ().getResource (classPath ) != null ;
14+ } catch (Throwable e ) {
15+ return false ;
16+ }
17+ }
18+
19+ public static boolean isClassLoaded (String className ) {
20+ try {
21+ Class .forName (className );
22+ return true ;
23+ } catch (Throwable e ) {
24+ return false ;
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change 33import github .kasuminova .stellarcore .common .config .StellarCoreConfig ;
44import github .kasuminova .stellarcore .common .integration .censoredasm .CensoredASMCompat ;
55import github .kasuminova .stellarcore .common .mod .Mods ;
6+ import github .kasuminova .stellarcore .common .util .RuntimeEnv ;
67import github .kasuminova .stellarcore .common .util .StellarEnvironment ;
78import github .kasuminova .stellarcore .common .util .StellarLog ;
89import net .minecraftforge .fml .relauncher .IFMLLoadingPlugin ;
@@ -40,7 +41,7 @@ public class StellarCoreEarlyMixinLoader implements IFMLLoadingPlugin {
4041 addMixinCFG ("mixins.stellar_core_minecraft_nnlist.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .nonNullList );
4142 addMixinCFG ("mixins.stellar_core_minecraft_noglerror.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .noGlError );
4243 addMixinCFG ("mixins.stellar_core_minecraft_property.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .propertyEnumHashCodeCache );
43- addMixinCFG ("mixins.stellar_core_minecraft_phys.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .boundingBoxIntersectCheck );
44+ addMixinCFG ("mixins.stellar_core_minecraft_phys.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .boundingBoxIntersectCheck && ! RuntimeEnv . IS_CLEANROOM_LOADER );
4445 addMixinCFG ("mixins.stellar_core_minecraft_randomtick.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .parallelRandomBlockTicker );
4546 addMixinCFG ("mixins.stellar_core_minecraft_renderglobal.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .alwaysDeferChunkUpdates );
4647 addMixinCFG ("mixins.stellar_core_minecraft_resourcelocation.json" , () -> StellarCoreConfig .PERFORMANCE .vanilla .resourceLocationCanonicalization && !StellarCoreConfig .PERFORMANCE .vanilla .resourceLocationCanonicalizationAsync );
You can’t perform that action at this time.
0 commit comments