Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

BlockStateProvider for trapdoorBlock (1.16.5)


Recommended Posts

All of my BlockStateProviders have worked so far all for the exception of my new trapdoorBlock.

 

{
            ResourceLocation block = modLoc("block/chocolate_trapdoor");
            trapdoorBlock(ModBlocks.CHOCOLATE_TRAPDOOR.get(), block, true);
}

 

What I'm confused about is the error its giving me when I try to runData. it throws a "Texture chocolate:block/chocolate_trapdoor does not exist in any known resource pack" at me. which doesn't make sense since I'm trying to make that location with this data generator.

 

[00:51:02] [main/INFO] [minecraft/DataGenerator]: Starting provider: Block States: chocolate
Exception in thread "main" [00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:39)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: Caused by: java.lang.reflect.InvocationTargetException
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at java.lang.reflect.Method.invoke(Method.java:498)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at net.minecraftforge.userdev.FMLUserdevDataLaunchProvider.lambda$launchService$0(FMLUserdevDataLaunchProvider.java:51)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1061]: 	... 5 more
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: Caused by: java.lang.IllegalArgumentException: Texture chocolate:block/chocolate_trapdoor does not exist in any known resource pack
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.ModelBuilder.texture(ModelBuilder.java:152)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.ModelProvider.singleTexture(ModelProvider.java:134)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.ModelProvider.singleTexture(ModelProvider.java:125)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.ModelProvider.singleTexture(ModelProvider.java:121)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.ModelProvider.trapdoorOrientableBottom(ModelProvider.java:324)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.BlockStateProvider.trapdoorBlockInternal(BlockStateProvider.java:531)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.BlockStateProvider.trapdoorBlock(BlockStateProvider.java:523)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at tyrannus.chocolate.data.client.ModBlockStateProvider.registerStatesAndModels(ModBlockStateProvider.java:46)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.client.model.generators.BlockStateProvider.act(BlockStateProvider.java:108)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraft.data.DataGenerator.run(DataGenerator.java:53)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.event.lifecycle.GatherDataEvent$DataGeneratorConfig.lambda$runAll$0(GatherDataEvent.java:111)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at cpw.mods.modlauncher.api.LamdbaExceptionUtils.lambda$rethrowConsumer$0(LamdbaExceptionUtils.java:34)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at java.util.HashMap$Values.forEach(HashMap.java:981)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.event.lifecycle.GatherDataEvent$DataGeneratorConfig.runAll(GatherDataEvent.java:107)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraftforge.fml.DatagenModLoader.begin(DatagenModLoader.java:61)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	at net.minecraft.data.Main.main(Main.java:43)
[00:51:02] [main/INFO] [STDERR/]: [java.lang.Throwable:printStackTrace:644]: 	... 11 more

 

Link to post
Share on other sites
1 hour ago, tal124 said:

What I'm confused about is the error its giving me when I try to runData. it throws a "Texture chocolate:block/chocolate_trapdoor does not exist in any known resource pack" at me. which doesn't make sense since I'm trying to make that location with this data generator.

Well, you can't make a texture with data generators, only blockstate and model json files. What the error is saying is that it can not find a texture (a png) with the name 'chocolate_trapdoor.png', in the 'textures/block' folder. Have you forgot to put your texture there? Another problem could be that you have to refresh the project in your IDE, since it caches resource files (Eclipse does at least).

Link to post
Share on other sites
3 minutes ago, vemerion said:

Well, you can't make a texture with data generators, only blockstate and model json files. What the error is saying is that it can not find a texture (a png) with the name 'chocolate_trapdoor.png', in the 'textures/block' folder. Have you forgot to put your texture there? Another problem could be that you have to refresh the project in your IDE, since it caches resource files (Eclipse does at least).

I have restarted Intellij and also I do have a file in my textures/block folder, I was using a vanilla asset renamed as a placeholder, I have also done the other blocks without the texture there and it still created the blockstate and block model files just with a missing texture when loaded in. However I am still getting the same error code.

Link to post
Share on other sites
5 minutes ago, diesieben07 said:

Show your build.gradle.

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
    }
}

apply plugin: 'net.minecraftforge.gradle'

group = 'Tyrannis'
version = '1.0-SNAPSHOT'
archivesBaseName = 'Chocolate'

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'

minecraft {
    // The mappings can be changed at any time, and must be in the following format.
    // snapshot_YYYYMMDD   Snapshot are built nightly.
    // stable_#            Stables are built at the discretion of the MCP team.
    // Use non-default mappings at your own risk. they may not always work.
    // Simply re-run your setup task after changing the mappings to update your workspace.
    mappings channel: 'snapshot', version: '20210309-1.16.5'
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

    // Default run configurations.
    // These can be tweaked, removed, or duplicated as needed.
    runs {
        client {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            mods {
                chocolate {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            mods {
                chocolate {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'

            // Recommended logging level for the console
            property 'forge.logging.console.level', 'debug'

            // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
            args '--mod', 'chocolate', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

            mods {
                chocolate {
                    source sourceSets.main
                }
            }
        }
    }
}

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

dependencies {
    // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
    // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
    // The userdev artifact is a special name and will get all sorts of transformations applied to it.
    minecraft 'net.minecraftforge:forge:1.16.5-36.0.48'

    // You may put jars on which you depend on in ./libs or you may define them like so..
    // compile "some.group:artifact:version:classifier"
    // compile "some.group:artifact:version"

    // Real examples
    // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

    // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
    // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // These dependencies get remapped to your current MCP mappings
    // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // For more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html
}

// Example for how to get properties into the manifest for reading by the runtime..
jar {
    manifest {
        attributes([
                "Specification-Title"     : "chocolate",
                "Specification-Vendor"    : "Tyrannus",
                "Specification-Version"   : "1", // We are version 1 of ourselves
                "Implementation-Title"    : project.name,
                "Implementation-Version"  : project.version,
                "Implementation-Vendor"   : "Tyrannus",
                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

jar.finalizedBy('reobfJar')

 

Link to post
Share on other sites

I went ahead and put Dummy files with the same name into the block models and item models area and it proceeded to generate both the block/item models and the blockstate which I don't understand because I shouldn't have to have put a dummy file with the same name just for it to generate the .json files that I wanted.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.