Posted December 19, 20168 yr Hey there, So I'm trying to create a custom fluid, however I run into this Resource Error upon lauch: 21:10:16] [Client thread/ERROR]: Exception loading model for variant plentifulmisc:block_empowered_fluid#level=6 for blockstate "plentifulmisc:block_empowered_fluid[level=6]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model plentifulmisc:block_empowered_fluid#level=6 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:153) ~[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:798) [Minecraft.class:?] at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:347) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:385) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] 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_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:?] 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:?] ... 29 more [21:10:16] [Client thread/ERROR]: Exception loading blockstate for the variant plentifulmisc:block_empowered_fluid#level=6: java.lang.Exception: Could not load model definition for variant plentifulmisc:block_empowered_fluid at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:274) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:121) ~[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:798) [Minecraft.class:?] at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:347) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:560) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:385) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] 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_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:?] Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'plentifulmisc:block_empowered_fluid' from: 'plentifulmisc:blockstates/block_empowered_fluid.json' in resourcepack: 'FMLFileResourcePack:Plentiful Misc' at net.minecraft.client.renderer.block.model.ModelBakery.loadModelBlockDefinition(ModelBakery.java:246) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadMultipartMBD(ModelBakery.java:223) ~[ModelBakery.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.getModelBlockDefinition(ModelBakery.java:208) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.getModelBlockDefinition(ModelLoader.java:270) ~[ModelLoader.class:?] ... 28 more However, I don't know what to set as the blockstate / model files. I have the texture files + the .mcmeta files for them.. however it doesn't seem to work... Thanks, Relatively new to modding. Currently developing: https://github.com/LambdaXV/DynamicGenerators
December 21, 20168 yr Author Okay, I probably should put my block class in there and how i'm registering, eh? Here is the class that does.. everything: public final class InitFluids{ public static Fluid fluidEmpoweredFluid; public static Block blockEmpoweredFluid; public static void init(){ fluidEmpoweredFluid = registerFluid("empoweredfluid", "block_empowered_fluid", EnumRarity.UNCOMMON); blockEmpoweredFluid = registerFluidBlock(fluidEmpoweredFluid, Material.WATER, "block_empowered_fluid"); } private static Fluid registerFluid(String fluidName, String fluidTextureName, EnumRarity rarity){ Fluid fluid = new CustomFluids(fluidName.toLowerCase(Locale.ROOT), fluidTextureName).setRarity(rarity); FluidRegistry.registerFluid(fluid); FluidRegistry.addBucketForFluid(fluid); return FluidRegistry.getFluid(fluid.getName()); } private static Block registerFluidBlock(Fluid fluid, Material material, String name){ return new BlockFluidFlowing(fluid, material, name); } } The 'CustomFluids' class: public class CustomFluids extends Fluid { public CustomFluids(String fluidName, String textureName){ super(fluidName, new ResourceLocation(ModUtil.MOD_ID, "blocks/"+textureName+"_still"), new ResourceLocation(ModUtil.MOD_ID, "blocks/"+textureName+"_flowing")); } @Override public String getUnlocalizedName(){ return "fluid."+ModUtil.MOD_ID+"."+this.unlocalizedName; } } Lastly, the block base: public class BlockFluidFlowing extends BlockFluidClassic implements ItemBlockBase.ICustomRarity{ private final String name; public BlockFluidFlowing(Fluid fluid, Material material, String unlocalizedName){ super(fluid, material); this.name = unlocalizedName; this.displacements.put(this, false); this.register(); } private void register(){ ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); } protected String getBaseName(){ return this.name; } protected ItemBlockBase getItemBlock(){ return new ItemBlockBase(this); } public boolean shouldAddCreative(){ return false; } @Override public boolean canDisplace(IBlockAccess world, BlockPos pos){ return !world.getBlockState(pos).getMaterial().isLiquid() && super.canDisplace(world, pos); } @Override public boolean displaceIfPossible(World world, BlockPos pos){ return !world.getBlockState(pos).getMaterial().isLiquid() && super.displaceIfPossible(world, pos); } @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; } } Relatively new to modding. Currently developing: https://github.com/LambdaXV/DynamicGenerators
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.