Jump to content

Corgam

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by Corgam

  1. Hi,
    I am just updating my mod from 1.20.1 to 1.20.2 and I saw a big change for the custom RecipeSerializers, they now require Codec<?> serialization instead of a simple fromJson() function.
    Unfortunately, I am struggling with setting up the Codec for a few of the serialization features:

    - Using the Forge "mod_loaded" condition (the file should not be loaded when a mod is missing)

    - Loading an Ingredient field 

    Current Codec Code:

    Spoiler
        public static final Codec<EnvironmentData> CODEC = RecordCodecBuilder.create((builder) -> builder
                .group(
                    Ingredient.CODEC_NONEMPTY.fieldOf("input").forGetter(EnvironmentData::getInputItem),
                    BlockState.CODEC.fieldOf("render").forGetter(EnvironmentData::getRenderState),
                    Codec.FLOAT.fieldOf("growModifier").forGetter(EnvironmentData::getGrowModifier),
                    Codec.list(Codec.STRING).fieldOf("categories").forGetter(EnvironmentData::getCategories)
                ).apply(builder, EnvironmentData::new));

    For the first problem, previously the "mod_loaded" condition was automatically taken into account, but I suppose that now it changed and has to be taken care of in the codec?
    For the second problem, I am trying to read the Ingredient with the CODEC_NONEMPTY from the Ingredient class, but I get the following error:

    [17:35:14] [Render thread/ERROR] [minecraft/RecipeManager]: Parsing error loading recipe cagedmobs:environments/red_mushroom_block
    com.google.gson.JsonParseException: Not a JSON object: "minecraft:red_mushroom_block"
    	at net.minecraft.Util.getOrThrow(Util.java:820) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading}
    	at net.minecraft.world.item.crafting.RecipeManager.fromJson(RecipeManager.java:171) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading}
    	at net.minecraft.world.item.crafting.RecipeManager.apply(RecipeManager.java:76) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading}
    	at net.minecraft.world.item.crafting.RecipeManager.apply(RecipeManager.java:37) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading}
    	at net.minecraft.server.packs.resources.SimplePreparableReloadListener.lambda$reload$1(SimplePreparableReloadListener.java:12) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading}
    	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?] {}
    	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] {}
    	at net.minecraft.server.packs.resources.SimpleReloadInstance.lambda$new$3(SimpleReloadInstance.java:65) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading}
    	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:166) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:22) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading}
    	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:132) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:145) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    	at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.openFresh(CreateWorldScreen.java:132) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.screens.worldselection.WorldSelectionList.loadLevels(WorldSelectionList.java:189) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.screens.worldselection.WorldSelectionList.<init>(WorldSelectionList.java:100) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.screens.worldselection.SelectWorldScreen.init(SelectWorldScreen.java:37) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.screens.Screen.init(Screen.java:338) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    	at net.minecraft.client.Minecraft.setScreen(Minecraft.java:1090) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.screens.TitleScreen.lambda$createNormalMenuOptions$7(TitleScreen.java:171) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.components.Button.onPress(Button.java:38) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.components.AbstractButton.onClick(AbstractButton.java:41) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.components.AbstractWidget.mouseClicked(AbstractWidget.java:179) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.components.events.ContainerEventHandler.mouseClicked(ContainerEventHandler.java:53) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.screens.TitleScreen.mouseClicked(TitleScreen.java:329) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.MouseHandler.lambda$onPress$0(MouseHandler.java:98) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.gui.screens.Screen.wrapScreenError(Screen.java:461) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    	at net.minecraft.client.MouseHandler.onPress(MouseHandler.java:95) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.MouseHandler.lambda$setup$4(MouseHandler.java:207) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:106) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
    	at net.minecraft.client.MouseHandler.lambda$setup$5(MouseHandler.java:206) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43) ~[lwjgl-glfw-3.3.2.jar:build 13] {}
    	at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.2.jar:build 13] {}
    	at org.lwjgl.glfw.GLFW.glfwWaitEventsTimeout(GLFW.java:3509) ~[lwjgl-glfw-3.3.2.jar:build 13] {}
    	at com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS(RenderSystem.java:207) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1261) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    	at net.minecraft.client.Minecraft.run(Minecraft.java:783) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    	at net.minecraft.client.main.Main.main(Main.java:221) ~[forge-1.20.2-48.0.33_mapped_parchment_2023.10.22-1.20.2-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
    	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
    	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
    	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
    	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
    	at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:98) ~[fmlloader-1.20.2-48.0.33.jar:?] {}
    	at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.lambda$makeService$0(CommonLaunchHandler.java:82) ~[fmlloader-1.20.2-48.0.33.jar:?] {}
    	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:17) ~[modlauncher-10.1.1.jar:?] {}
    	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:40) ~[modlauncher-10.1.1.jar:?] {}
    	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:58) ~[modlauncher-10.1.1.jar:?] {}
    	at cpw.mods.modlauncher.Launcher.run(Launcher.java:96) ~[modlauncher-10.1.1.jar:?] {}
    	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) ~[modlauncher-10.1.1.jar:?] {}
    	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:13) ~[modlauncher-10.1.1.jar:?] {}
    	at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:10) ~[modlauncher-10.1.1.jar:?] {}
    	at net.minecraftforge.bootstrap.BootstrapLauncher.main(BootstrapLauncher.java:126) ~[bootstrap-1.2.0.jar:?] {}

     

    The "cagedmobs:environments/red_mushroom_block" JSON recipe:

    Spoiler
    {
    	"type": "cagedmobs:environment_data",
    	"conditions": [
    		{
    			"type": "forge:mod_loaded",
    			"modid": "cagedmobs"
    		}
    	],
    	"input": {
    		"item": "minecraft:red_mushroom_block"
    	},
    	"render": "minecraft:red_mushroom_block",
    	"growModifier": 1.0,
    	"categories": ["mycelium"]
    }

    As seen here, the Ingredient input item is in the form of a nested JSON:

    "input": {
    		"item": "minecraft:red_mushroom_block"
    }

     

     

  2. Hi,

    I have implemented a few serializers in my mod, which are reading recipes' json files and loading them.

    I would like to log all loaded recipes into the console, currently I do it one by one in the recipe constructor, but it spams the console with multiple lines of text.

    Instead I would love to first load all recipes and then to log all loaded recipes in one line. Is there some kind of event that I can listen to to do that and how can I listed to it?

  3. Hi,

    I have an item that stores entities' EntityType inside it's NBT  when used (right clicked) on some living entity,

    but there is a problem with Entities that can be interacted with, when you right click them with Item, the itemInteractionForEntity(...) function is not run.

    Is there a way to skip entities' interaction and run item's itemInteractionForEntity(...) function instead?

  4. Hi,

    I want to use the TileEntityRenderer, to render just the top side of the block, so just a flat quad with top texture of the block. Is it possible in 1.16.2?

    I already looked at the BotanyPots mod's code and it's using the

    private void renderQuadsFlat(IBlockDisplayReader blockAccessIn, BlockState stateIn, BlockPos posIn, int brightnessIn, int combinedOverlayIn, boolean ownBrightness, MatrixStack matrixStackIn, IVertexBuilder buffer, List<BakedQuad> list, BitSet bitSet)
    

    from BlockModelRenderer class.

    But in 1.16.2 it looks like it's a private function and I cannot use it.

  5. Hi,

    I want to add a few mods to my eclipse dev env (jei and Hwyla for now),

    but I run into some problems.

    First of all, here is my 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'
    // 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.0'
    group = 'com.corgam.cagedmobs' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
    archivesBaseName = 'cagedmobs'
    
    sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
    
    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.
        // 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: '20200514-1.16'
        // 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 {
                    examplemod {
                        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 {
                    examplemod {
                        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'
    
                args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/')
    
                mods {
                    examplemod {
                        source sourceSets.main
                    }
                }
            }
        }
    }
    
    dependencies {
        minecraft 'net.minecraftforge:forge:1.16.2-33.0.32'
    
        // compile against the JEI API but do not include it at runtime
      	compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api")
      	// at runtime, use the full JEI jar
      	runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}")
        // Compile against the Hwyla API, but do not include it at runtime
        compileOnly fg.deobf("mcp.mobius.waila:Hwyla:1.16.2-1.9.23-79:api")
        // At runtime, use the full Hwyla jar
        runtimeOnly fg.deobf("mcp.mobius.waila:Hwyla:1.16.2-1.9.23-79")
    }
    
    repositories {
      maven { url = "https://dvs1.progwml6.com/files/maven/"}
      maven { url = "https://modmaven.k-4u.nl/"}
      maven { url "https://maven.tehnut.info/" }
    }
    
    // Example for how to get properties into the manifest for reading by the runtime..
    jar {
        manifest {
            attributes([
                "Specification-Title": "examplemod",
                "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"
            }
        }
    }

    So I have run the "build" gradle task and it said: "BUILD SUCCESSFUL",

    but when I launched runClient, there are no additional mods.

    Am I missing something? Should I run some another gradle task?

     

    Cheers,

    Corgam

     

  6. 1 hour ago, imacatlolol said:

    Sound events are registered after blocks, so I believe that's part of the issue. One option would be to extend SoundType and override its get methods to make them access RegistryObject entries as needed instead of on initialization. Feels like there should be a cleaner solution though...

    I hope there is. I feel like it is a common thing to do for modders, to add new blocks with new sounds, so it would be nice to have a easier methode to implement it.

  7. Hi,

    is there a way to add new methodes and attributes to the ClientPlayNetHandler and ServerPlayNetHandler classes?

    I want to create a system similar to the existing advancements system, so my goal is to add a new Manager to the ClientPlayNetHandler

    and also I have created custom Packets and I want to send and process them in ClientPlayNetHandler and ServerPlayNetHandler

     

    Cheers,

    Corgam

  8.  

    On 5/6/2020 at 12:05 AM, Draco18s said:

    You call a method here, but the code you've shown does not contain this method.

     

    What do you mean? You are talking about the register() methode? It is already implemented in DefferedRegister class. Other DefferedRegisters like Blocks or Items worked this way

     

     

    On 5/6/2020 at 12:05 AM, Draco18s said:

    You call a method here, but the code you've shown does not contain this method.

     

    What line is that?

    ModBlocks.BLOCKS.register(modEventBus);

     

    And also the problem appears only when I try to create a SoundType object. If I register the sounds and don't use them, they work (I can use playsound command inside minecraft and it works fine) 

     

  9.  

    Hi,

    I'm trying to make a new SoundType for my blocks, but whatever I do I recieve an "java.lang.NullPointerException: Registry Object not present" error. I'm not sure what's exatly going on, maybe you need to assign sounds later or something?

    Maybe there is some sort of trick to do it that I'm not aware of? 

    Here is the code and the log:

    Spoiler

    [05maj2020 22:55:57.371] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.mcpVersion, 20200307.202953, --fml.mcVersion, 1.15.2, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 31.1.29, --version, MOD_DEV, --assetIndex, 1.15, --assetsDir, C:\Users\Corgam\.gradle\caches\forge_gradle\assets, --username, Dev, --accessToken, ????????, --userProperties, {}]
    [05maj2020 22:55:57.375] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 5.0.0-milestone.4+67+b1a340b starting: java version 1.8.0_221 by Oracle Corporation
    [05maj2020 22:55:57.973] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
    [05maj2020 22:55:59.131] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--version, MOD_DEV, --gameDir, ., --assetsDir, C:\Users\Corgam\.gradle\caches\forge_gradle\assets, --assetIndex, 1.15, --username, Dev, --accessToken, ????????, --userProperties, {}]
    [05maj2020 22:56:01.731] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev
    [05maj2020 22:56:14.476] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Backend library: LWJGL version 3.2.2 build 10
    [05maj2020 22:56:16.126] [modloading-worker-1/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 31.1.29, for MC 1.15.2 with MCP 20200307.202953
    [05maj2020 22:56:16.127] [modloading-worker-1/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v31.1.29 Initialized
    [05maj2020 22:56:16.207] [modloading-worker-3/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to create mod instance. ModID: slavthology, class com.Corgam.Slavthology.Slavthology
    java.lang.ExceptionInInitializerError: null
        at com.Corgam.Slavthology.Slavthology.<init>(Slavthology.java:28) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_221]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_221]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_221]
        at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_221]
        at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_221]
        at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:131) ~[?:31.1]
        at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_221]
        at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_221]
        at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?]
        at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:134) ~[?:?]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) [?:1.8.0_221]
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) [?:1.8.0_221]
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) [?:1.8.0_221]
        at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.CountedCompleter.exec(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_221]
    Caused by: java.lang.NullPointerException: Registry Object not present
        at java.util.Objects.requireNonNull(Unknown Source) ~[?:1.8.0_221]
        at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:91) ~[?:?]
        at com.Corgam.Slavthology.init.ModBlocks.<clinit>(ModBlocks.java:84) ~[?:?]
        ... 20 more
    [05maj2020 22:56:16.291] [Render thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found
    [05maj2020 22:56:16.291] [Render thread/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
    java.lang.Exception: stacktrace
        at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.0.0-milestone.1-service.jar:?]
        at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[forge-1.15.2-31.1.29_mapped_snapshot_20200225-1.15.1-recomp.jar:?]
        at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:97) ~[forge-1.15.2-31.1.29_mapped_snapshot_20200225-1.15.1-recomp.jar:?]
        at net.minecraft.client.Minecraft.<init>(Minecraft.java:398) ~[forge-1.15.2-31.1.29_mapped_snapshot_20200225-1.15.1-recomp.jar:?]
        at net.minecraft.client.main.Main.main(Main.java:141) ~[forge-1.15.2-31.1.29_mapped_snapshot_20200225-1.15.1-recomp.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
        at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.15.2-31.1.29_mapped_snapshot_20200225-1.15.1-recomp.jar:?]
        at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-5.0.0-milestone.4.jar:?]
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-5.0.0-milestone.4.jar:?]
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-5.0.0-milestone.4.jar:?]
        at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-5.0.0-milestone.4.jar:?]
        at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-5.0.0-milestone.4.jar:?]
        at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:102) [forge-1.15.2-31.1.29_mapped_snapshot_20200225-1.15.1-recomp.jar:?]
    [05maj2020 22:56:19.485] [Render thread/INFO] [com.mojang.text2speech.NarratorWindows/]: Narrator library for x64 successfully loaded
    [05maj2020 22:56:19.591] [Render thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, Mod Resources
    [05maj2020 22:56:19.623] [Server-Worker-5/ERROR] [net.minecraftforge.fml.ModLoader/LOADING]: Skipping lifecycle event SETUP, 1 errors found.
    [05maj2020 22:56:19.623] [Server-Worker-5/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event SETUP, 1 errors found
    [05maj2020 22:56:19.623] [Server-Worker-5/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
    java.lang.Exception: stacktrace
        at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.0.0-milestone.1-service.jar:?]
        at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?]
        at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:123) ~[?:?]
        at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$3(ClientModLoader.java:105) ~[?:?]
        at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:113) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_221]
    [05maj2020 22:56:25.160] [Server-Worker-7/ERROR] [net.minecraftforge.fml.ModLoader/LOADING]: Skipping lifecycle event ENQUEUE_IMC, 1 errors found.
    [05maj2020 22:56:25.161] [Server-Worker-7/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event ENQUEUE_IMC, 1 errors found
    [05maj2020 22:56:25.161] [Server-Worker-7/FATAL] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: EventBus 0 shutting down - future events will not be posted.
    java.lang.Exception: stacktrace
        at net.minecraftforge.eventbus.EventBus.shutdown(EventBus.java:278) ~[eventbus-2.0.0-milestone.1-service.jar:?]
        at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$5(ClientModLoader.java:115) ~[?:?]
        at net.minecraftforge.fml.client.ClientModLoader.finishModLoading(ClientModLoader.java:137) ~[?:?]
        at net.minecraftforge.fml.client.ClientModLoader.lambda$onreload$4(ClientModLoader.java:107) ~[?:?]
        at java.util.concurrent.CompletableFuture.uniRun(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.CompletableFuture$UniRun.tryFire(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_221]
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_221]
    [05maj2020 22:56:25.410] [Render thread/INFO] [net.minecraft.client.audio.SoundSystem/]: OpenAL initialized.
    [05maj2020 22:56:25.411] [Render thread/INFO] [net.minecraft.client.audio.SoundEngine/SOUNDS]: Sound engine started
    [05maj2020 22:56:25.584] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 1024x512x4 minecraft:textures/atlas/blocks.png-atlas
    [05maj2020 22:56:25.636] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 128x128x4 minecraft:textures/atlas/signs.png-atlas
    [05maj2020 22:56:25.637] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
    [05maj2020 22:56:25.637] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
    [05maj2020 22:56:25.638] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
    [05maj2020 22:56:25.639] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
    [05maj2020 22:56:25.639] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
    [05maj2020 22:56:26.151] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
    [05maj2020 22:56:26.153] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
    [05maj2020 22:56:26.154] [Render thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 128x128x0 minecraft:textures/atlas/mob_effects.png-atlas
     

     

    In main file:

     public Slavthology() {
        	final IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
        	
        	modEventBus.addListener(this::onClientSetup);
        	
        	ModSounds.SOUND_EVENTS.register(modEventBus);
        	ModBlocks.BLOCKS.register(modEventBus);
        	ModItems.ITEMS.register(modEventBus);
        	ModEntityTypes.ENTITIES.register(modEventBus);
        	ModTileEntities.TILE_ENTITIES.register(modEventBus);
        	ModFeatures.FEATURES.register(modEventBus);
        	
        }

    In ModSounds:

    public class ModSounds {
    
    	public static final DeferredRegister<SoundEvent> SOUND_EVENTS = new DeferredRegister<>(ForgeRegistries.SOUND_EVENTS, Reference.MOD_ID);
    
    
    	public static final RegistryObject<SoundEvent> WICKER_WALK = SOUND_EVENTS.register("wicker_walk", () -> new SoundEvent(new ResourceLocation(Reference.MOD_ID,"block.wicker.walk")));
    	public static final RegistryObject<SoundEvent> WICKER_BREAK = SOUND_EVENTS.register("wicker_break", () -> new SoundEvent(new ResourceLocation(Reference.MOD_ID,"block.wicker.break")));
    	public static final RegistryObject<SoundEvent> WICKER_PLACE = SOUND_EVENTS.register("wicker_place", () -> new SoundEvent(new ResourceLocation(Reference.MOD_ID,"block.wicker.place")));
    
    }

    In ModBlocks:

    static SoundType WICKER_SOUND = new SoundType(1.0F, 1.0F, ModSounds.WICKER_BREAK.get(), ModSounds.WICKER_WALK.get(), ModSounds.WICKER_PLACE.get(), ModSounds.WICKER_WALK.get(), ModSounds.WICKER_WALK.get());
    public static final RegistryObject<Block> WICKER_BLOCK	 = BLOCKS.register("wicker_block", () -> new WillowPlanksBlock(Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(2.0F, 3.0F).sound(WICKER_SOUND)));
    	

    In sounds.json

    {
        "block.wicker.walk": {
            "category": "block",
            "subtitle": "The wicker creaked",
            "sounds": [
                {
                    "name": "slavthology:block/block.wicker.walk"
                }
            ]
        },
        "block.wicker.place": {
            "category": "block",
            "subtitle": "The wicker creaked",
            "sounds": [
                {
                    "name": "slavthology:block/block.wicker.place"
                }
            ]
        },
        "block.wicker.break": {
            "category": "block",
            "subtitle": "The wicker creaked",
            "sounds": [
                {
                    "name": "slavthology:block/block.wicker.break"
                }
            ]
        }
    }  

     

  10. Hi,

    I think it's a quick and simple question, but I want to know what's the best way to do it,

    I want do create a block, on which you need to click 3 times with an item before converting it into different block,

    where do I store the amount of clicks I have already clicked? Do I create a tile entity and store it there (if yes, how do I do it?) , or should I store it as one of the states of the block?

    Cheers 

×
×
  • Create New...

Important Information

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