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

[1.16] BlockStateProvider is registered, but not called


Recommended Posts

Hello, I recently got re-interested in modding, and have been going through the documentation to brush up my knowledge.

I'm working on a BlockStateProvider to take care of mass-producing simple files. I have verified that its event code is being run, but BlockStateProvider#registerStatesAndModels() is never called (I am using runData).

Any help would be appreciated.

 

EventSubscriber and registration

Spoiler

.....

@EventBusSubscriber(modid = ArtificialArtificing.MODID, bus = EventBusSubscriber.Bus.MOD)
public class AAEventSubscriber
{

  	.....
  
	@SubscribeEvent
	public static void onDataProvider(GatherDataEvent event)
	{
		ExistingFileHelper ehf = event.getExistingFileHelper();
		DataGenerator gen = event.getGenerator();
		
		if (event.includeClient())
		{
			gen.addProvider(new AAItemModelProvider(gen, ArtificialArtificing.MODID, ehf));
			gen.addProvider(new AABlockStateProvider(gen, ArtificialArtificing.MODID, ehf));
		}
	}
	
	.....
}

 

 

BlockStateProvider

Spoiler

.....

public class AABlockStateProvider extends BlockStateProvider
{
	.....
	
	public AABlockStateProvider(DataGenerator gen, String modid, ExistingFileHelper exFileHelper)
	{
		super(gen, modid, exFileHelper);
	}

	@Override
	protected void registerStatesAndModels()
	{
		this.simpleBlock(AABlocks.CRYSTAL_WHITE);
	}
	
	.....
}

 

 

build.gradle

Spoiler

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
    }
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.16.5-0.1.0'
group = 'mod.serpentdagger.artificialartificing' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'artificialartificing'

java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
    // The mappings can be changed at any time, and must be in the following format.
    // Channel:   Version:
    // snapshot   YYYYMMDD   Snapshot are built nightly.
    // stable     #          Stables are built at the discretion of the MCP team.
    // official   MCVersion  Official field/method names from Mojang mapping files
    //
    // You must be aware of the Mojang license when using the 'official' mappings.
    // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
    //
    // 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: 'official', version: '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
            // The markers can be changed as needed. 
            // "SCAN": For mods scan.
            // "REGISTRIES": For firing of registry events.
            // "REGISTRYDUMP": For getting the contents of all registries.
            property 'forge.logging.markers', 'REGISTRIES'

            // Recommended logging level for the console
            // You can set various levels here.
            // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
            property 'forge.logging.console.level', 'debug'

            mods {
                artificialartificing {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            // The markers can be changed as needed. 
            // "SCAN": For mods scan.
            // "REGISTRIES": For firing of registry events.
            // "REGISTRYDUMP": For getting the contents of all registries.
            property 'forge.logging.markers', 'REGISTRIES'

            // Recommended logging level for the console
            // You can set various levels here.
            // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
            property 'forge.logging.console.level', 'debug'

            mods {
                artificialartificing {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            // The markers can be changed as needed. 
            // "SCAN": For mods scan.
            // "REGISTRIES": For firing of registry events.
            // "REGISTRYDUMP": For getting the contents of all registries.
            property 'forge.logging.markers', 'REGISTRIES'

            // Recommended logging level for the console
            // You can set various levels here.
            // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
            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', 'artificialartificing', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

            mods {
                artificialartificing {
                    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.1.0'

    // 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": "artificialartificing",
            "Specification-Vendor": "examplemodsareus",
            "Specification-Version": "1", // We are version 1 of ourselves
            "Implementation-Title": project.name,
            "Implementation-Version": "${version}",
            "Implementation-Vendor" :"examplemodsareus",
            "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar') 
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact jar
        }
    }
    repositories {
        maven {
            url "file:///${project.projectDir}/mcmodsrepo"
        }
    }
}

 

 

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • HI! I installed a map with a modpack 5 minutes ago, i put all the files in the right position, but when i open the game it crash and give me the shutdown report. ---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 22/06/21 19.54 Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraftforge/fml/common/network/simpleimpl/IMessage     at cpw.mods.fml.common.LoadController.transition(LoadController.java:163)     at cpw.mods.fml.common.Loader.loadMods(Loader.java:544)     at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878)     at net.minecraft.client.main.Main.main(SourceFile:148)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.NoClassDefFoundError: net/minecraftforge/fml/common/network/simpleimpl/IMessage     at java.lang.Class.forName0(Native Method)     at java.lang.Class.forName(Class.java:348)     at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:440)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)     at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)     at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)     at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)     at com.google.common.eventbus.EventBus.post(EventBus.java:275)     at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)     at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)     at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)     at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)     at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)     at com.google.common.eventbus.EventBus.post(EventBus.java:275)     at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)     at cpw.mods.fml.common.Loader.loadMods(Loader.java:513)     ... 10 more Caused by: java.lang.ClassNotFoundException: net.minecraftforge.fml.common.network.simpleimpl.IMessage     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     ... 35 more Caused by: java.lang.NullPointerException     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182)     ... 37 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.7.10     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 215593488 bytes (205 MB) / 536870912 bytes (512 MB) up to 8589934592 bytes (8192 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 53 mods loaded, 53 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     UC    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)      UC    FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10.jar)      UC    Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10.jar)      UC    battlegear2{1.7.10} [Mine & Blade Battlegear 2 - Bullseye] (1.7.10-MB_Battlegear2-Bullseye-1.0.8.3.jar)      UC    bspkrsCore{6.16} [bspkrsCore] ([1.7.10]bspkrsCore-universal-6.16.jar)      UC    StatusEffectHUD{1.27} [StatusEffectHUD] ([1.7.10]StatusEffectHUD-client-1.27.jar)      UC    cfm{3.4.8} [§9MrCrayfish's Furniture Mod] ([Minecraft-INSIDE.com] mrcrayfishfurnituremodv3.4.81.7.10.jar)      UC    ArchimedesShips{1.7.10 v1.7.1} [Archimedes' Ships] (ArchimedesShips-1.7.1.jar)      UC    Backpack{2.0.1} [Backpack] (backpack-2.0.1-1.7.x.jar)      UC    BiblioCraft{1.11.4} [BiblioCraft] (BiblioCraft[v1.11.4][MC1.7.10].jar)      UC    BiomesOPlenty{2.1.0} [Biomes O' Plenty] (BiomesOPlenty-1.7.10-2.1.0.1889-universal.jar)      UC    CarpentersBlocks{3.3.5} [Carpenter's Blocks] (Carpenter's Blocks v3.3.5 - MC 1.7.10.jar)      UC    OblisgrMod{1.2.1} [OblisgrMod] (clothing.zip)      UC    CustomSpawner{3.3.0} [DrZhark's CustomSpawner] (CustomMobSpawner 3)      UC    customnpcs{1.7.10d} [CustomNpcs] (CustomNPCs_1.7.10d(21feb16).jar)      UC    DamageIndicatorsMod{3.2.0} [Damage Indicators] (Damage-Indicators-Mod-1.7.10.jar)      UE    PTRModelLib{1.0.0} [PTRModelLib] (Decocraft-2.4.2_1.7.10.jar)      UE    props{2.4.2} [Decocraft] (Decocraft-2.4.2_1.7.10.jar)      UC    MoCreatures{6.3.1} [DrZhark's Mo'Creatures Mod] (DrZharks MoCreatures Mod v6)      UC    eplus{3.0.2-d} [Enchanting Plus] (EnchantingPlus-1.7.10-3.0.2-d.jar)      UC    exoticbirds{1.0} [Exotic Birds] (Exotic Birds 1.7.10 - 1.0.3b.jar)      UC    flansmod{4.10.0} [Flan's Mod] (Flans Mod-1.7.10-4.10.0.jar)      UC    fossil{1.7.10 Build 7.2.1} [Fossils and Archeology Revival] (Fossils_Archeology_Revival-1.7.10_Build-7.2.1.jar)      UC    journeymap{5.1.4p2} [JourneyMap] (journeymap-1.7.10-5.1.4p2-unlimited.jar)      UC    lycanitesmobs{1.13.0.5 - MC 1.7.10} [Lycanites Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    arcticmobs{1.13.0.5 - MC 1.7.10} [Lycanites Arctic Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    demonmobs{1.13.0.5 - MC 1.7.10} [Lycanites Demon Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    desertmobs{1.13.0.5 - MC 1.7.10} [Lycanites Desert Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    forestmobs{1.13.0.5 - MC 1.7.10} [Lycanites Forest Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    freshwatermobs{1.13.0.5 - MC 1.7.10} [Lycanites Freshwater Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    infernomobs{1.13.0.5 - MC 1.7.10} [Lycanites Inferno Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    junglemobs{1.13.0.5 - MC 1.7.10} [Lycanites Jungle Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    mountainmobs{1.13.0.5 - MC 1.7.10} [Lycanites Mountain Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    plainsmobs{1.13.0.5 - MC 1.7.10} [Lycanites Plains Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    saltwatermobs{1.13.0.5 - MC 1.7.10} [Lycanites Saltwater Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    shadowmobs{1.13.0.5 - MC 1.7.10} [Lycanites Shadow Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    swampmobs{1.13.0.5 - MC 1.7.10} [Lycanites Swamp Mobs] (LycanitesMobsComplete 1.13.0.5 [1.7.10].jar)      UC    MapWriter{2.1.8} [MapWriter] (MapWriter-1.7.10-2.1.10.jar)      UC    RadixCore{2.1.1} [RadixCore] (RadixCore-1.7.10-2.1.1-universal.jar)      UC    MCA{1.7.10-5.1.2} [Minecraft Comes Alive] (MCA-1.7.10-5.1.2-universal.jar)      UC    mcheli{1.0.3} [MC Helicopter] (mcheli)      UC    MiniBosses{1.2a} [Mini-Bosses] (MiniBosses-1.2a.jar)      UC    modularpots{1.7.10.14} [Modular Flower Pots] (ModularPots-1.7.10.14-2.jar)      UC    mw{1.11.7.7} [Modern Warfare] (mw-1.11.7.7_mc1.7.10.jar)      UC    plantmegapack{4.33} [Plant Mega Pack] (plantmegapack-4.33-1.7.10-1492.jar)      UC    potioncore{@VERSION@} [Potion Core] (PotionCore-1.2_beta_for_1.7.10.jar)      UC    roadstuff{1.0.3-final} [Road Stuff] (RoadStuff-mc1.7.10-1.0.2-final.jar)      UC    row{1.7.10-15.01.18-2} [Rails of War] (RoW-1.7.10-15.01.18-2.jar)      UC    soundfilters{0.8_for_1.7.X} [Sound Filters] (SoundFilters-0.8_for_1.7.X.jar)      UC    Waila{1.5.10} [Waila] (Waila-1.5.10_1.7.10.jar)      UC    weaponmod{v1.14.3} [Balkon's WeaponMod] (weaponmod-1.14.3.jar)      UC    witchery{0.24.1} [Witchery] (witchery-1.7.10-0.24.1.jar)      UC    worldedit{6.1.1} [WorldEdit] (worldedit-forge-mc1.7.10-6.1.1-dist.jar)      GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 457.51' Renderer: 'GeForce RTX 3070/PCIe/SSE2'
    • so i tried to join my friends minecraft server and i got this message: Internal Exception: java.lang.InexOutOfBoundsException: readerindex(42) + length(1) exceeds writerIndex(42):PooledUnsafeDirectByteBuf(ridx: 42, widx: 42, cap: 42) debug.log here: https://gist.github.com/odasety/385dd969b2677f42b726d12b7d3bc78f please help
    • No, that's strange, but it has only one state. Moreover, even if I wanted to compare block (not blockstate), i don't know how to do it, because this function require BlockState
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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