Skip to content

Commit

Permalink
Throw an exception when failing to load a World Host plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Sep 2, 2024
1 parent 78e4bc7 commit e38b9a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/main/java/io/github/gaming32/worldhost/WorldHost.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
//#else
//$$ import io.github.gaming32.worldhost.gui.screen.WorldHostConfigScreen;
//$$ import java.lang.annotation.ElementType;
//$$ import java.lang.reflect.InvocationTargetException;
//$$ import java.util.Objects;
//$$ import java.util.function.BiConsumer;
//$$ import java.util.function.BiFunction;
//$$ import org.objectweb.asm.Type;
//#if FORGE
//$$ import net.minecraftforge.fml.ModContainer;
Expand Down Expand Up @@ -392,8 +392,10 @@ private static List<LoadedWorldHostPlugin> collectPlugins() {
//$$ try {
//$$ return (WorldHostPlugin)Class.forName(ad.clazz().getClassName()).getDeclaredConstructor().newInstance();
//$$ } catch (ReflectiveOperationException e) {
//$$ LOGGER.error("Failed to load World Host plugin from class {}", ad.clazz().getClassName(), e);
//$$ return null;
//$$ throw new IllegalStateException(
//$$ "World Host plugin from " + modFile.moduleName() + " failed to load",
//$$ e instanceof InvocationTargetException target ? target.getTargetException() : e
//$$ );
//$$ }
//$$ })
//$$ .filter(Objects::nonNull)
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ modId = "minecraft"
##if MC == 1.20.6
#?? versionRange = "[1.20.5,1.20.7)"
##elseif MC == 1.21.1
#?? versionRange = "[1.21.0,1.21.2)"
versionRange = "[1.21.0,1.21.2)"
##else
versionRange = "[$mc_version]"
#?? versionRange = "[$mc_version]"
##endif
type = "required"
ordering = "NONE"
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
//#elseif MC == 1.20.6
//?? "minecraft": ">=1.20.5- <1.20.7",
//#elseif MC == 1.21.1
//?? "minecraft": ">=1.21.0 <1.21.2",
"minecraft": ">=1.21.0 <1.21.2",
//#else
"minecraft": "$mc_version",
//?? "minecraft": "$mc_version",
//#endif
"fabric-resource-loader-v0": "*"
},
Expand Down

0 comments on commit e38b9a5

Please sign in to comment.