Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I have a block that has four different types and three different settings for each side. This means that this block has about 3000 different possible states. To not need to make 3000 models I am using the forge blockstate format. The problem is now that even though the blockstate is existing and its syntax is correct, the game throws MissingVariantExceptions for all possible states. To make stuff a bit easier, I am using a custom state mapper to map each of the four types to a different blockstate file. The names of the blockstate files are correct.

 

This is one of the blockstate files:

{
  "forge_marker": 1,
  "defaults": {
    "textures": {
      "up":    "advtech:blocks/energy/batteryPack_pb_Top_None",
      "down":  "advtech:blocks/energy/batteryPack_pb_Bottom_None",
      "north": "advtech:blocks/energy/batteryPack_pb_Side_None",
      "east":  "advtech:blocks/energy/batteryPack_pb_Side_None",
      "south": "advtech:blocks/energy/batteryPack_pb_Side_None",
      "west":  "advtech:blocks/energy/batteryPack_pb_Side_None"
    },
    "model": "cube",
    "uvlock": true
  },
  "variants": {
    "set_u": {
      "in": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Top_In"
        }
      },
      "out": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Top_Out"
        }
      },
      "none": {}
    },
    "set_d": {
      "in": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Bottom_In"
        }
      },
      "out": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Bottom_Out"
        }
      },
      "none": {}
    },
    "set_n": {
      "in": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_In"
        }
      },
      "out": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_Out"
        }
      },
      "none": {}
    },
    "set_e": {
      "in": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_In"
        }
      },
      "out": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_Out"
        }
      },
      "none": {}
    },
    "set_s": {
      "in": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_In"
        }
      },
      "out": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_Out"
        }
      },
      "none": {}
    },
    "set_w": {
      "in": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_In"
        }
      },
      "out": {
        "textures": {
          "up": "advtech:blocks/batteryPack/batteryPack_pb_Side_Out"
        }
      },
      "none": {}
    }
  }
}

 

This is one of the stacktraces:

[Client thread/ERROR]: Exception loading model for variant advtech:blockBatteryPack_pb#set_u=none,set_d=out,set_n=in,set_e=out,set_s=in,set_w=in for blockstate "advtech:blockBatteryPack[set_d=out,set_e=out,set_n=in,set_s=in,set_u=none,set_w=in,type=pb]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model advtech:blockBatteryPack_pb#set_u=none,set_d=out,set_n=in,set_e=out,set_s=in,set_w=in with loader VariantLoader.INSTANCE, skipping
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:241) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:145) ~[ModelBakery.class:?]
at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:229) ~[ModelLoader.class:?]
at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:146) ~[ModelLoader.class:?]
at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.notifyReloadListeners(SimpleReloadableResourceManager.java:132) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.reloadResources(SimpleReloadableResourceManager.java:113) [simpleReloadableResourceManager.class:?]
at net.minecraft.client.Minecraft.refreshResources(Minecraft.java:799) [Minecraft.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:340) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?]
at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1184) ~[ModelLoader$VariantLoader.class:?]
at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
... 24 more

That variant is produced by my custom statemapper. I will try to see if sorting the properties in alphabetical order fixes it.

Yep, that actually fixed it. I am confused why that would fix it but it did.

Ok, that makes sense. Thanks for your help.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.