Skip to content
This repository was archived by the owner on Dec 7, 2024. It is now read-only.

Commands (and very likely permissions) are broken on Gradle 4.10 #4

Closed
mikroskeem opened this issue Sep 13, 2018 · 2 comments
Closed

Comments

@mikroskeem
Copy link

When I try to create a new command, then Gradle throws an exception and mentions something about "Command with name 'creategame' not found.". Here's the stacktrace: https://paste.wut.ee/avecocenoz.cs
I guess that something changed in Gradle API? 🤔
It works in 4.8 perfectly. I tried both 0.2.1 and 0.3.0 plugin versions.

I have this in my build.gradle.kts:

bukkit {
    name = "x"
    description = "y"
    authors = listOf("mikroskeem")
    main = "z"

    commands {
        "creategame" {
            description = "Creates a new game"
        }
    }
}

Current workaround is to use this:

bukkit {
    // ...
    commands.create("creategame") {
        description = "Creates a new game"
    }
}
@stephan-gh
Copy link
Member

See https://github.com/gradle/kotlin-dsl/releases/tag/v1.0-RC6 "Container String invoke now is named() instead of maybeCreate()" or gradle/kotlin-dsl-samples#907.

You should use register instead now, as that will be initialized lazily:

commands {
    register("creategame") {
        // ...
    }
}

@stephan-gh
Copy link
Member

I'll keep this open as a reminder to update the README.

@stephan-gh stephan-gh reopened this Sep 14, 2018
stephan-gh added a commit to Minecrell/ServerListPlus that referenced this issue Apr 29, 2021
rainbowdashlabs pushed a commit to rainbowdashlabs/plugin-yml that referenced this issue Oct 31, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants