Modern Beta [Fabric]

Modern Beta [Fabric]

166k Downloads

Default indevLevelType is 0 in older version and it might be crashed from that.

craftingmod opened this issue ยท 1 comments

commented

Hello, I'm using modern beta since v0.3 and current version is v1.0.4.

A crash is happened when I try to choose indev world type in world creation with following log.

---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.

Time: 2020-12-29 18:25:08 KST
Description: mouseClicked event handler

java.lang.IllegalArgumentException: No Indev Theme matching name: 0
    at Not Enough Crashes deobfuscated stack trace.(1.16.1+build.21)
    at com.bespectacled.modernbeta.biome.indev.IndevUtil$IndevTheme.fromName(IndevUtil.java:44)
    at com.bespectacled.modernbeta.biome.provider.IndevBiomeProvider.<init>(IndevBiomeProvider.java:26)
    at com.bespectacled.modernbeta.biome.provider.AbstractBiomeProvider.getBiomeProvider(AbstractBiomeProvider.java:30)
    at com.bespectacled.modernbeta.biome.OldBiomeSource.<init>(OldBiomeSource.java:39)
    at com.bespectacled.modernbeta.gen.type.IndevGeneratorType.method_29076(IndevGeneratorType.java:52)
    at net.minecraft.client.world.GeneratorType.method_29077(GeneratorType:174)
    at net.minecraft.client.gui.screen.world.MoreOptionsDialog.method_28093(MoreOptionsDialog:123)
    at net.minecraft.client.gui.widget.ButtonWidget.onPress(ButtonWidget:33)
    at net.minecraft.client.gui.widget.AbstractPressableButtonWidget.onClick(AbstractPressableButtonWidget:16)
    at net.minecraft.client.gui.widget.AbstractButtonWidget.mouseClicked(AbstractButtonWidget:149)
    at net.minecraft.client.gui.ParentElement.mouseClicked(ParentElement:27)
    at net.minecraft.client.Mouse.method_1611(Mouse:92)
    at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen:435)
    at net.minecraft.client.Mouse.onMouseButton(Mouse:92)
    at net.minecraft.client.Mouse.method_22686(Mouse:162)
    at net.minecraft.util.thread.ThreadExecutor.execute(ThreadExecutor:94)
    at net.minecraft.client.Mouse.method_22684(Mouse:162)
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36)
    at org.lwjgl.system.JNI.invokeV(Native Method)
    at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3174)
    at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(RenderSystem:127)
    at net.minecraft.client.MinecraftClient.render(MinecraftClient:1071)
    at net.minecraft.client.MinecraftClient.run(MinecraftClient:681)
    at net.minecraft.client.MinecraftClient.handler$bjf000$afterCrashHandled(MinecraftClient:11904)
    at net.minecraft.client.MinecraftClient.run(MinecraftClient:699)
    at net.minecraft.client.main.Main.main(Main:215)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:564)
    at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:224)
    at net.fabricmc.loader.launch.knot.Knot.init(Knot.java:141)
    at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:27)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:564)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Affected screen --
  Screen name: net.minecraft.class_525

Here's config and crash code location.

this.theme = settings.contains("levelTheme") ? IndevTheme.fromName(settings.getString("levelTheme")) : IndevTheme.NORMAL;

./config/modernbeta.json

{
  "fixedSeed": 0,
  "renderBetaSkyColor": true,
  "renderBetaBiomeColor": true,
  "renderAlphaSunset": false,
  "generateOceans": false,
  "biomeType": "beta",
  "generateInfdevPyramid": true,
  "generateInfdevWall": true,
  "indevLevelType": "0",
  "indevLevelTheme": "0",
  "indevLevelWidth": 256,
  "indevLevelLength": 256,
  "indevLevelHeight": 128,
  "indevCaveRadius": 1.0
}

I think default indevLevelTheme and indevLevelType are "0" so code would modify to check LevelType is integer or typename.

public static IndevTheme fromName(String name) {

How about trying to catch Integer.parseInt() and parsing index if it is integer?

commented

Seems fixed in 24a117d.