Skip to content

Commit

Permalink
Merge pull request #14 from CrisInuyasha/1.17
Browse files Browse the repository at this point in the history
Rebase to Minecraft 1.17
  • Loading branch information
Draylar authored Nov 1, 2021
2 parents b5a030a + c1e7025 commit cb7bf5b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 44 deletions.
85 changes: 52 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,61 +1,78 @@
plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16

archivesBaseName = "${modid}"
version = "${version}" + "-" + project.minecraft_version

minecraft {
}
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://jitpack.io" }
maven { url = "https://maven.shedaniel.me/" }
maven { url = "https://maven.terraformersmc.com/" }
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2"
modApi "net.fabricmc:fabric-loader:${project.loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${project.api_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Mod Menu
modImplementation("com.terraformersmc:modmenu:$mod_menu_version")

// Cloth Config
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}

modCompile "io.github.prospector:modmenu:${project.mod_menu_version}"
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
}

processResources {
inputs.property "version", project.version

from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
filesMatching("fabric.mod.json") {
expand "version": project.version
}

from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

// Minecraft 1.17 (21w19a) upwards uses Java 16.
it.options.release = 16
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

jar {
from "LICENSE"
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}

// configure the maven publication
Expand All @@ -72,9 +89,11 @@ publishing {
}
}

// select the repositories you want to publish to
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// uncomment to publish to the local maven
// mavenLocal()
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
26 changes: 15 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#Done to increase the memory available to gradle.
org.gradle.jvmargs = -Xmx1G
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

cloth_config_version = 4.5.6
auto_config_version = 3.2.0-unstable
mod_menu_version = 1.12.2+build.17
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.17
yarn_mappings=1.17+build.13
loader_version=0.11.6

minecraft_version = 1.16.1
api_version = 0.14.0+build.371-1.16
loader_version = 0.8.9+build.203
yarn_build = 20
# Mod Properties
mod_version = 1.3.0
maven_group = leaf-decay
archives_base_name = leaf-decay

version = 1.2.0
modid = leaf-decay
# Dependencies
fabric_version=0.34.9+1.17
cloth_config_version = 5.0.34
mod_menu_version = 2.0.2

0 comments on commit cb7bf5b

Please sign in to comment.