Skip to content

Commit

Permalink
forge 1.18.1 build.gradle fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticpasta1 committed May 28, 2022
1 parent 29911b4 commit b655009
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 57 deletions.
95 changes: 50 additions & 45 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,60 @@
plugins {
id 'fabric-loom' version '0.7-SNAPSHOT'
id 'dev.architectury.loom' version '0.10.0-SNAPSHOT'
id 'io.github.juuxel.loom-quiltflower' version '1.6.0'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
group = project.maven_group
version = project.mod_version
group = project.maven_group

if (project.hasProperty('buildNumber')) {
version = version + "." + buildNumber
// JENKINS STUFF! LEAVE THIS ALONE!
if (System.getenv('BUILD_NUMBER') != null) {
version = "-dev-" + System.getenv('BUILD_NUMBER')
}



repositories {
mavenCentral()
maven { url 'https://jitpack.io/'}
}

configurations {
shadow
api.extendsFrom shadow
maven {
name = "cursemaven"
url = "https://www.cursemaven.com"
}
flatDir {
dir 'libs'
}
maven {
url = "https://maven.parchmentmc.org"
}
}

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

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation include('com.github.Chocohead:Fabric-ASM:2.2')

include 'com.github.Azagwen:mcgui:1.16-SNAPSHOT'

compile 'com.electronwill.night-config:toml:3.6.3'
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.18.2:2022.05.02@zip")
}
forge "net.minecraftforge:forge:${project.forge_version}"
}

loom {
forge {
mixinConfigs = [
"gamemode.mixins.json"
]
}

launches {
data {
arg "--existing", file("src/main/resources").absolutePath
}
}
}


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

Expand All @@ -57,17 +70,7 @@ tasks.withType(JavaCompile).configureEach {
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
}

minecraft {
accessWidener "src/main/resources/gamemode.accesswidener"
it.options.release = 17
}

java {
Expand All @@ -77,12 +80,16 @@ java {
withSourcesJar()
}

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

loom {
accessWidenerPath = file("src/main/resources/gamemode.accesswidener")
}

// configure the maven publication
publishing {
publications {
Expand All @@ -96,12 +103,10 @@ publishing {
}
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// 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.
}
}

// Select the repositories you want to publish to
// To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`.
repositories {
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
}
}
22 changes: 12 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Fabric Properties
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx16G
org.gradle.jvmargs=-Xmx2G

loom.platform=forge

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.5
loader_version=0.11.3
# check these on https://fabricmc.net/versions.html
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.22
forge_version=1.18.1-39.1.2

# Mod Properties
mod_version = 1.0.1-alpha
maven_group = com.mystic
archives_base_name = gamemode
mod_version = 1.0-forge
maven_group = com.mystic
archives_base_name = gamemode

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.33.0+1.16
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
pluginManagement {
repositories {
//jcenter() // jcenter will be stopped in 2022
mavenCentral()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven { url "https://maven.architectury.dev/" }
maven { url "https://files.minecraftforge.net/maven/" }
maven {
name = 'Cotton'
url = 'https://server.bbkr.space/artifactory/libs-release/'
}
gradlePluginPortal()
}
}
1 change: 0 additions & 1 deletion src/main/resources/gamemode.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"package": "com.mystic.gamemode.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
"MixinCreativeScreenHandler",
"MixinServerPlayNetworkHandler",
"ServerBooleanThing"
],
Expand Down

0 comments on commit b655009

Please sign in to comment.