Skip to content

Commit

Permalink
Make it compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Su5eD committed May 1, 2024
1 parent d870131 commit 878cccb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/fabricmc/loader/impl/FMLModMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.*;
import java.util.stream.Stream;

import static cpw.mods.modlauncher.api.LamdbaExceptionUtils.uncheck;
import static cpw.mods.modlauncher.api.LambdaExceptionUtils.uncheck;

public class FMLModMetadata implements ModMetadata {
private final IModInfo modInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package net.fabricmc.loader.impl;

import net.fabricmc.loader.api.MappingResolver;
import net.fabricmc.loader.impl.util.LoaderUtil;
import net.minecraftforge.srgutils.IMappingFile;
import net.minecraftforge.srgutils.INamedMappingFile;
import net.neoforged.fml.loading.FMLEnvironment;
Expand All @@ -33,7 +34,7 @@ public class MappingResolverImpl implements MappingResolver {
* We ship this file in our jar, by default it contains OFFICIAL -> SRG -> INTERMEDIARY mappings
*/
private static final String MAPPINGS_RESOURCE = "/mappings.tsrg";
private static final String FML_NAMESPACE = FMLEnvironment.naming;
private static final String FML_NAMESPACE = LoaderUtil.RUNTIME_MAPPING;

private final INamedMappingFile mappings;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@
import cpw.mods.modlauncher.LaunchPluginHandler;
import cpw.mods.modlauncher.Launcher;
import cpw.mods.modlauncher.serviceapi.ILaunchPluginService;
import net.neoforged.neoforgespi.language.ILifecycleEvent;
import net.neoforged.neoforgespi.language.IModLanguageProvider;
import net.neoforged.neoforgespi.language.ModFileScanData;

import java.lang.reflect.Field;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;

/**
* Terribly ugly hack to bootstrap fml mods into fabric loader before modloading starts, in a way that can be loaded from JarJar.
Expand Down Expand Up @@ -59,8 +57,4 @@ public String name() {
public Consumer<ModFileScanData> getFileVisitor() {
return data -> {};
}

@Override
public <R extends ILifecycleEvent<R>> void consumeLifecycleEvent(Supplier<R> consumeEvent) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package net.fabricmc.loader.impl.launch;

import net.fabricmc.api.EnvType;
import net.fabricmc.loader.impl.util.LoaderUtil;
import net.neoforged.fml.loading.FMLEnvironment;

import java.io.IOException;
Expand Down Expand Up @@ -83,7 +84,7 @@ public String getEntrypoint() {

@Override
public String getTargetNamespace() {
return FMLEnvironment.naming;
return LoaderUtil.RUNTIME_MAPPING;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package net.fabricmc.loader.impl.launch;

import net.fabricmc.loader.impl.util.LoaderUtil;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.fml.loading.FMLLoader;

Expand Down Expand Up @@ -44,7 +45,7 @@ public boolean matches(String gameId, String gameVersion) {
// }

public String getTargetNamespace() {
return FMLEnvironment.naming;
return LoaderUtil.RUNTIME_MAPPING;
}

public boolean requiresPackageAccessHack() {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/fabricmc/loader/impl/util/LoaderUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.Locale;

public final class LoaderUtil {
public static final String RUNTIME_MAPPING = "mojang";

public static String getClassFileName(String className) {
return className.replace('.', '/').concat(".class");
}
Expand Down

0 comments on commit 878cccb

Please sign in to comment.