Skip to content

Commit

Permalink
Fix NEI Plugins not loading and remove unnecessary patch to CCC
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed Apr 23, 2024
1 parent 9cda36e commit dcf4aa4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"server": [],
"mixins": [
"codechickencore.ASMHelperMixin",
"codechickencore.ClassHeirachyManagerMixin",
"codechickencore.ClassMappingMixin",
"codechickencore.ClassOverriderMixin",
"codechickencore.DelegatedTransformerMixin",
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/cpw/mods/fml/common/ModClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@ public File[] getParentSources() {
files.add(new File(url.toURI()));
}

files = files.stream()
.filter(file -> Objects.equals(
file.getParentFile(),
Constants.COREMODS_FOLDER)
).collect(Collectors.toList());

files.addAll(FabricLauncherBase.getLauncher().getClassPath().stream().map(Path::toFile).collect(Collectors.toList()));

return files.toArray(new File[0]);
} catch (URISyntaxException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
import cpw.mods.fml.common.ModClassLoader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.relauncher.RelaunchLibraryManager;
import fr.catcore.fabricatedforge.Constants;

import java.io.File;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -54,6 +56,7 @@ public void findClasspathMods(ModClassLoader modClassLoader) {
if (knownLibraries.contains(minecraftSources[i].getName())) {
FMLLog.finer("Skipping known library file %s", new Object[]{minecraftSources[i].getAbsolutePath()});
} else {
if (!Objects.equals(minecraftSources[i].getParentFile().toString(), Constants.COREMODS_FOLDER.toString())) continue;
FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", new Object[]{minecraftSources[i].getAbsolutePath()});
this.candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i == 0, true));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import cpw.mods.fml.common.FMLLog;
import fr.catcore.fabricatedforge.util.Utils;
import fr.catcore.modremapperapi.ClassTransformer;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.impl.launch.FabricLauncherBase;
import net.fabricmc.loader.impl.util.UrlUtil;

Expand Down Expand Up @@ -70,7 +71,7 @@ public class RelaunchClassLoader extends URLClassLoader {
private static final boolean DEBUG_CLASSLOADING = Boolean.parseBoolean(System.getProperty("fml.debugClassLoading", "false"));

public RelaunchClassLoader() {
super(new URL[0], FabricLauncherBase.getLauncher().getTargetClassLoader());
super(new URL[0], FMLRelauncher.class.getClassLoader());
this.sources = new ArrayList<>();
this.parent = this.getClass().getClassLoader();
this.cachedClasses = new HashMap<>(1000);
Expand Down Expand Up @@ -271,7 +272,7 @@ public byte[] getClassBytes(String name) throws IOException {

Object i$;
try {
URL classResource = this.findResource(name.replace('.', '/').concat(".class"));
URL classResource = ((URLClassLoader)this.parent.getParent()).findResource(name.replace('.', '/').concat(".class"));
if (classResource != null) {
classStream = classResource.openStream();
if (DEBUG_CLASSLOADING) {
Expand Down

0 comments on commit dcf4aa4

Please sign in to comment.