weaver-userdev
What is weaver, and how does it differ from paperweight?
Section titled “What is weaver, and how does it differ from paperweight?”weaver is a custom fork of paperweight used for Canvas build tooling.
It includes 3 modules, but only one of them matters here, namely weaver-userdev.
The main difference between the paperweight userdev plugin and ours is that weaver has some DSL extensions that make using Canvas dev bundles more easy.
What are dev bundle’s?
Section titled “What are dev bundle’s?”Dev bundles are maven artifacts, containing patches to the Minecraft source, which are applied during the build process, and API. This means that they are a fully functional way to access Minecraft internals, without having to worry about EULA or license restrictions.
Is This Important to You?
Section titled “Is This Important to You?”Accessing server internals is not necessary for majority of Canvas plugins. Using the Canvas API or the one of the APIs of our upstream projects (i.e. Paper or Folia) is always preferrable when it can be used.
In some situations, the Canvas API may not be enough and you may need to access server internals directly.
Getting Started
Section titled “Getting Started”If you’ve concluded that your project has to rely on internals, this guide is here to assist you in configuring your Gradle build script, so that you can build against them.
Prerequisites
Section titled “Prerequisites”Gradle 9.+
Section titled “Gradle 9.+”For this guide, we’ll be using gradle 9.+. If your Gradle wrapper version starts with the number 9, you’re good to go and you can skip this part!
# First, check your Gradle version./gradlew --version# Run this if your Gradle wrapper is using an older version./gradlew wrapper --gradle-version latest# First, check your Gradle versiongradlew --version# Run this if your Gradle wrapper is using an older versiongradlew wrapper --gradle-version latestSetup using weaver-userdev
Section titled “Setup using weaver-userdev”This portion will show you how to add weaver-userdev and the Canvas dev bundle to your Gradle project.
In your settings.gradle.kts or settings.gradle file…
pluginManagement { repositories { gradlePluginPortal() maven("https://maven.canvasmc.io/releases") }}In your build.gradle.kts or build.gradle file…
plugins { id("io.canvasmc.weaver.userdev") version "2.3.12"}
dependencies { // Other dependencies... paperweight.canvasDevBundle("1.21.11-R0.1-SNAPSHOT")}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(21))}Setup using paperweight-userdev
Section titled “Setup using paperweight-userdev”plugins { id("io.papermc.paperweight.userdev") version "2.0.0-beta.19"}
repositories { // Other respositories... maven("https://maven.canvasmc.io/snapshots")}
dependencies { // Other dependencies... paperweight.devBundle("io.canvasmc.canvas", "1.21.11-R0.1-SNAPSHOT")}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(21))}After completing all of the above steps, you will have successfully attached Minecraft internals to your project!