Skip to content

Commit

Permalink
Support NeoForge 1.20.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed May 8, 2024
1 parent f9e5168 commit 976ed9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/main/java/io/github/gaming32/worldhost/WorldHost.java
Expand Up @@ -99,8 +99,6 @@
//#endif
//#else
//$$ import io.github.gaming32.worldhost.gui.screen.WorldHostConfigScreen;
//$$ import net.minecraft.server.packs.PackType;
//$$ import net.minecraft.server.packs.PackResources;
//#if FORGE
//$$ import net.minecraftforge.api.distmarker.Dist;
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
Expand All @@ -117,8 +115,10 @@
//$$ import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
//#endif
//$$ import java.util.function.BiFunction;
//#if MC < 1.20.5
//#if NEOFORGE
//#if MC >= 1.20.5
//$$ import net.neoforged.fml.common.EventBusSubscriber;
//$$ import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
//#elseif NEOFORGE
//$$ import net.neoforged.neoforge.client.ConfigScreenHandler;
//#elseif MC >= 1.19.2
//$$ import net.minecraftforge.client.ConfigScreenHandler;
Expand All @@ -128,14 +128,6 @@
//$$ import net.minecraftforge.fmlclient.ConfigGuiHandler;
//#endif
//#endif
//#if NEOFORGE
//$$ import net.neoforged.neoforge.resource.ResourcePackLoader;
//#elseif MC > 1.17.1
//$$ import net.minecraftforge.resource.ResourcePackLoader;
//#else
//$$ import net.minecraftforge.fmllegacy.packs.ResourcePackLoader;
//#endif
//#endif

//#if FORGELIKE
//$$ @Mod(WorldHost.MOD_ID)
Expand Down Expand Up @@ -848,16 +840,22 @@ public static CompletableFuture<Optional<String>> checkForUpdates() {
});
}

//#if FORGELIKE && MC < 1.20.5
//#if FORGELIKE
//#if MC >= 1.20.5
//$$ @EventBusSubscriber(modid = MOD_ID, bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
//#else
//$$ @Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
//#endif
//$$ public static class ClientModEvents {
//$$ @SubscribeEvent
//$$ public static void onClientSetup(FMLClientSetupEvent event) {
//$$ init();
//$$ final BiFunction<Minecraft, Screen, Screen> screenFunction =
//$$ (mc, screen) -> new WorldHostConfigScreen(screen);
//$$ ModLoadingContext.get().registerExtensionPoint(
//#if MC >= 1.19.2
//#if MC >= 1.20.5
//$$ IConfigScreenFactory.class, () -> screenFunction::apply
//#elseif MC >= 1.19.2
//$$ ConfigScreenHandler.ConfigScreenFactory.class,
//$$ () -> new ConfigScreenHandler.ConfigScreenFactory(screenFunction)
//#else
Expand Down
4 changes: 4 additions & 0 deletions version.gradle.kts
Expand Up @@ -43,6 +43,9 @@ version = "${modVersion}+${mcVersionString}-${loaderName}"

repositories {
mavenCentral()
maven("https://maven.fabricmc.net")
maven("https://maven.minecraftforge.net")
maven("https://maven.neoforged.net/releases")
}

unimined.minecraft {
Expand Down Expand Up @@ -281,6 +284,7 @@ java {

tasks.compileJava {
options.release = 17
options.compilerArgs.add("-Xlint:all")
}

preprocess {
Expand Down

0 comments on commit 976ed9e

Please sign in to comment.