Skip to content

Commit

Permalink
update to 1.20-1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
12345-mcpython committed Jun 27, 2024
1 parent 7c241e1 commit 5142400
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
54 changes: 25 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
id 'fabric-loom' version '0.7-SNAPSHOT'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

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

base {
archivesName = project.archives_base_name
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
Expand All @@ -18,6 +18,18 @@ repositories {
// for more information about repositories.
}

loom {
splitEnvironmentSourceSets()

mods {
"modid" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand All @@ -27,8 +39,6 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_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 {
Expand All @@ -40,45 +50,31 @@ processResources {
}

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"

// 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
}
it.options.release = 21
}

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()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

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

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
from components.java
}
}

Expand Down
11 changes: 6 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ org.gradle.jvmargs=-Xmx8G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.16.5
yarn_mappings=1.16.5+build.9
loader_version=0.11.3
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11


# Mod Properties
mod_version = fabric-all-1.0.2
mod_version = fabric-all-1.0.3
maven_group = com.laosun
archives_base_name = stackone

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api (or https://fabricmc.net/versions.html)
fabric_version=0.34.2+1.16
fabric_version=0.100.4+1.21
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-7.4-bin.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions src/main/java/com/laosun/stackone/StackOneMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import net.fabricmc.api.ModInitializer;
import net.minecraft.item.Item;
import net.minecraft.util.registry.Registry;
import net.minecraft.registry.Registries;

import java.lang.reflect.Field;

Expand All @@ -12,7 +12,7 @@ public class StackOneMod implements ModInitializer {

@Override
public void onInitialize() {
for (Item i : Registry.ITEM) {
for (Item i : Registries.ITEM) {
try {
Class<? extends Item> a = Item.class;
Field f2;
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Stack One Mod",
"description": "You can't stack anything!!!",
"authors": [
"Me!"
"Lao Sun"
],
"contact": {
"sources": "https://github.com/12345-mcpython/stackone"
Expand All @@ -21,6 +21,9 @@
"com.laosun.stackone.StackOneMod"
]
},
"depends": {
"minecraft": ">=1.20"
},
"suggests": {
"another-mod": "*"
}
Expand Down

0 comments on commit 5142400

Please sign in to comment.