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

Gradle task "compileJava" for new project fails


LaT3St
 Share

Recommended Posts

Hello there,

i'm an absolute beginner in modding. Gradle is also new for me. I do know some java though.
I followed the Getting Started - Guide in the documentation twice. The damn thing doesn't want to compile the example code (renamed to match the name of my mod) because of this error:

> Executing task: gradle: build <


> Configure project :
Java: 16.0.2 JVM: 16.0.2+7(N/A) Arch: amd64
WARNING: This project is configured to use the official obfuscation mappings provided by Mojang. These mapping fall under their associated license, you should be fully aware of this license. For the latest license text, refer below, or the reference copy here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md, You can hide this warning by running the `hideOfficialWarningUntilChanged` task
WARNING: (c) 2020 Microsoft Corporation. These mappings are provided "as-is" and you bear the risk of using them. You may copy and use the mappings for development purposes, but you may not redistribute the mappings complete and unmodified. Microsoft makes no warranties, express or implied, with respect to the mappings provided here.  Use and modification of this document or the source code (in any form) of Minecraft: Java Edition is governed by the Minecraft End User License Agreement available at https://account.mojang.com/documents/minecraft_eula.
<-------------> 0% EXECUTING [987ms]
> :compileJava

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> error: release version 16 not supported

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

As you can see, i am running the Java 16, just like the guide told me to.

I would be thankful for any help.

LaT3St

Edited by LaT3St
Link to comment
Share on other sites

buildscript {
    repositories {
        // These repositories are only for Gradle plugins, put any other repositories in the repository block further below
        maven { url = 'https://maven.minecraftforge.net' }
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.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 = '0.1'
group = 'de.lat3st.obsidiantools' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'obsidiantools'

// Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16.
java.toolchain.languageVersion = JavaLanguageVersion.of(16)

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.17.1'

    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

    // 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 added/remove as needed separated by commas.
            // "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 {
                obsidiantools {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            // The markers can be added/remove as needed separated by commas.
            // "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 {
                obsidiantools {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            // The markers can be added/remove as needed separated by commas.
            // "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', 'obsidiantools', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

            mods {
                obsidiantools {
                    source sourceSets.main
                }
            }
        }
    }
}

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

repositories {
    // Put repositories for dependencies here
    // ForgeGradle automatically adds the Forge maven and Maven Central for you

    // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
    // flatDir {
    //     dir 'libs'
    // }
}

dependencies {
    // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
    // that the dep is a ForgeGradle 'patcher' dependency, and its 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.17.1-37.0.34'

    // Real mod deobf dependency examples - these get remapped to your current mappings
    // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
    // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
    // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency

    // Examples using mod jars from ./libs
    // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")

    // 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 at runtime.
jar {
    manifest {
        attributes([
                "Specification-Title"     : "obsidiantools",
                "Specification-Vendor"    : "obsidiantoolssareus",
                "Specification-Version"   : "1", // We are version 1 of ourselves
                "Implementation-Title"    : project.name,
                "Implementation-Version"  : project.jar.archiveVersion,
                "Implementation-Vendor"   : "obsidiantoolssareus",
                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

// Example configuration to allow publishing using the maven-publish plugin
// 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"
        }
    }
}

 

I'm building with ./gradlew build.

Link to comment
Share on other sites

The default java environment is systemwide set to version 16. Gradle is using Java 16.0.2, as seen in my initial post. I've added the following line to my gradle.properties file:

org.gradle.java.home=/usr/lib/jvm/java-16-openjdk/

But there was no change.

Edited by LaT3St
Link to comment
Share on other sites

Okay, i did finally fixed the problem. The JRE 16 was installed, the JDK was missing tho.
After running ./gradlew -q javaToolchains, i noticed, that there was an entry for some JDKs and the 16 JRE, which sounded wrong to me.

Weird error message from Gradle... 

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm making my own MOD using Geckolib, but when I start it as a test, it works fine, but when I put it in the Minecraft app, it doesn't start and crashes. crash report ---- Minecraft Crash Report ---- // Who set us up the TNT? Time: 22/09/27 13:38 Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed     at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:71) [?:?] {re:classloading}     at net.minecraftforge.fml.client.ClientModLoader.completeModLoading(ClientModLoader.java:174) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.lambda$null$1(Minecraft.java:508) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft$$Lambda$4172/899120039.run(Unknown Source) [?:?] {}     at net.minecraft.util.Util.func_215077_a(Util.java:320) [?:?] {re:classloading}     at net.minecraft.client.Minecraft.lambda$new$2(Minecraft.java:504) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft$$Lambda$3963/1223907812.accept(Unknown Source) [?:?] {}     at net.minecraft.client.gui.ResourceLoadProgressGui.func_230430_a_(ResourceLoadProgressGui.java:113) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.func_195458_a(GameRenderer.java:481) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:977) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:184) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.39.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/2095970915.call(Unknown Source) [forge-1.16.5-36.2.39.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at com.Kujira.minepiece.Items.SeaStoneIngot.<init>(SeaStoneIngot.java:8) ~[?:?] {re:classloading} -- MOD minepiece -- Details:     Mod File: MinePiece.jar     Failure message: MinePiece Mod (minepiece) encountered an error during the load_registries event phase         java.lang.NoSuchMethodError: net.minecraft.item.Item$Properties.tab(Lnet/minecraft/item/ItemGroup;)Lnet/minecraft/item/Item$Properties;     Mod Version: 1.0.0     Mod Issue URL: NOT PROVIDED     Exception message: java.lang.NoSuchMethodError: net.minecraft.item.Item$Properties.tab(Lnet/minecraft/item/ItemGroup;)Lnet/minecraft/item/Item$Properties; Stacktrace:     at com.Kujira.minepiece.Items.SeaStoneIngot.<init>(SeaStoneIngot.java:8) ~[?:?] {re:classloading}     at com.Kujira.minepiece.regi.MinePieceItems$Register.registerItems(MinePieceItems.java:25) ~[?:?] {re:classloading}     at net.minecraftforge.eventbus.ASMEventHandler_17_Register_registerItems_Register.invoke(.dynamic) ~[?:?] {}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus$$Lambda$3476/1916974029.invoke(Unknown Source) ~[?:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:106) ~[?:36.2] {re:classloading}     at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:107) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModContainer$$Lambda$3105/752772379.run(Unknown Source) ~[?:?] {}     at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:42) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:26) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:235) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:222) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:188) ~[?:?] {re:classloading}     at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2920/168398198.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2921/1088649990.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:437) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:149) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.39.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/2095970915.call(Unknown Source) [forge-1.16.5-36.2.39.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} -- MOD minepiece -- Details:     Mod File: MinePiece.jar     Failure message: MinePiece Mod (minepiece) encountered an error during the error event phase         java.lang.NoSuchMethodError: net.minecraft.entity.EntityType$Builder.of(Lnet/minecraft/entity/EntityType$IFactory;Lnet/minecraft/entity/EntityClassification;)Lnet/minecraft/entity/EntityType$Builder;     Mod Version: 1.0.0     Mod Issue URL: NOT PROVIDED     Exception message: java.lang.NoSuchMethodError: net.minecraft.entity.EntityType$Builder.of(Lnet/minecraft/entity/EntityType$IFactory;Lnet/minecraft/entity/EntityClassification;)Lnet/minecraft/entity/EntityType$Builder; Stacktrace:     at com.Kujira.minepiece.entity.ModEntityTypes.lambda$static$0(ModEntityTypes.java:19) ~[?:?] {re:classloading}     at com.Kujira.minepiece.entity.ModEntityTypes$$Lambda$3118/1730752382.get(Unknown Source) ~[?:?] {}     at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:110) ~[?:?] {re:classloading}     at net.minecraftforge.registries.DeferredRegister$$Lambda$3090/1983063045.get(Unknown Source) ~[?:?] {}     at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:186) ~[?:?] {re:classloading}     at net.minecraftforge.registries.DeferredRegister.access$000(DeferredRegister.java:47) ~[?:?] {re:classloading}     at net.minecraftforge.registries.DeferredRegister$EventDispatcher.handleEvent(DeferredRegister.java:158) ~[?:?] {re:classloading}     at net.minecraftforge.eventbus.ASMEventHandler_0_EventDispatcher_handleEvent_Register.invoke(.dynamic) ~[?:?] {}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus$$Lambda$3476/1916974029.invoke(Unknown Source) ~[?:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.fml.javafmlmod.FMLModContainer.acceptEvent(FMLModContainer.java:106) ~[?:36.2] {re:classloading}     at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:107) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModContainer$$Lambda$3105/752772379.run(Unknown Source) ~[?:?] {}     at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1618) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.ModWorkManager$SyncExecutor.driveOne(ModWorkManager.java:42) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModWorkManager$DrivenExecutor.drive(ModWorkManager.java:26) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.waitForTransition(ModLoader.java:235) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:222) ~[?:?] {re:classloading}     at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:188) ~[?:?] {re:classloading}     at net.minecraftforge.fml.client.ClientModLoader.lambda$begin$1(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2920/168398198.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:109) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraftforge.fml.client.ClientModLoader$$Lambda$2921/1088649990.run(Unknown Source) ~[?:?] {}     at net.minecraftforge.fml.client.ClientModLoader.begin(ClientModLoader.java:89) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:437) [?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:149) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.39.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$457/2095970915.call(Unknown Source) [forge-1.16.5-36.2.39.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {} -- System Details -- Details:     Minecraft Version: 1.16.5     Minecraft Version ID: 1.16.5     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: 886955560 bytes (845 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB)     CPUs: 8     JVM Flags: 10 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -XX:+IgnoreUnrecognizedVMOptions -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec     ModLauncher launch target: fmlclient     ModLauncher naming: srg     ModLauncher services:          /mixin-0.8.4.jar mixin PLUGINSERVICE          /eventbus-4.0.0.jar eventbus PLUGINSERVICE          /forge-1.16.5-36.2.39.jar object_holder_definalize PLUGINSERVICE          /forge-1.16.5-36.2.39.jar runtime_enum_extender PLUGINSERVICE          /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE          /forge-1.16.5-36.2.39.jar capability_inject_definalize PLUGINSERVICE          /forge-1.16.5-36.2.39.jar runtimedistcleaner PLUGINSERVICE          /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE          /forge-1.16.5-36.2.39.jar fml TRANSFORMATIONSERVICE      FML: 36.2     Forge: net.minecraftforge:36.2.39     FML Language Providers:          javafml@36.2         minecraft@1
    • Ok so the game has run but when I create world, after loading terrain and joining the world,  the screen went gray and after a few minutes it kicked me out and say "Invalid player data". Could you help me?
    • That is correct. But that is also not the name mentioned above. You should also try using proper logging or adding a breakpoint in a debugger instead of System.out.println().
    • I mean, you can, it would be a different forge mod loader version. I am asking mostly because I refuse to change to 1.19.x due to Microsoft's policies and decisions about the game (the in-game chat report system)
    • The main task - is to make your own gui for the inventory or just a separate gui, which will implement the basic functions for the marketplace (as in the various plugins). This needs to be implemented specifically by a mod. So far I've tried creating a class that inherits the Screen and setting as new ( minecraft.setScreen(new CustomScreen())), but the main inventory stops working (not moving things from slot to slot). Also tried overriding the InventoryScreen class, but the problem is the same as above. Decided to start simple, namely adding a button to the main inventory. Logic: listening for the ScreenEvent event, and setting the new button as a widget.  @SubscribeEvent public static void openInventoryGui(ScreenEvent e) { Minecraft minecraft = Minecraft.getInstance(); if (minecraft.screen != null) { Screen current = e.getScreen(); if (current.passEvents) { Button button = new Button(10, 10, 10, 10, Component.literal("TEST"), (a) -> { System.out.println("Press"); }); e.getScreen().renderables.add(button); } } } But so far the button does not work (should output text to the console).  Regarding ScreenEvent.InitScreenEvent - I could not do anything with it (it is not in the class, found no such event). What can I read or what guides to look at this topic? Or maybe someone has advice or experience in this matter?
  • Topics

×
×
  • Create New...

Important Information

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