Skip to content

Commit

Permalink
Update Fabric to 1.19.1.
Browse files Browse the repository at this point in the history
Support more minecraft version.
  • Loading branch information
12345-mcpython committed Aug 2, 2022
1 parent 65310da commit 7c241e1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 30 deletions.
35 changes: 27 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'fabric-loom' version '0.7-SNAPSHOT'
id 'maven-publish'
}

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

archivesBaseName = project.archives_base_name
version = project.mod_version
Expand All @@ -16,7 +16,6 @@ repositories {
// 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.aliyun.com/nexus/content/groups/public/'}
}

dependencies {
Expand All @@ -27,6 +26,9 @@ 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 @@ -38,8 +40,19 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
// 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
}
}

java {
Expand All @@ -59,7 +72,13 @@ jar {
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

Expand All @@ -70,4 +89,4 @@ publishing {
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
27 changes: 10 additions & 17 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.jvmargs=-Xmx8G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.1
yarn_mappings=1.19.1+build.5
loader_version=0.14.8
# 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

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

# Dependencies
fabric_version=0.58.5+1.19.1

#systemProp.http.proxyHost=127.0.0.1:3128
#systemProp.http.proxyPort=3128
#systemProp.https.proxyHost=127.0.0.1
#systemProp.https.proxyPort=03128


#Fabric api
# 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
5 changes: 0 additions & 5 deletions src/main/java/com/laosun/stackone/StackOneMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
import net.fabricmc.api.ModInitializer;
import net.minecraft.item.Item;
import net.minecraft.util.registry.Registry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.Field;

public class StackOneMod implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("stackone");

@Override
public void onInitialize() {
for (Item i : Registry.ITEM) {
try {
LOGGER.debug(i.getTranslationKey());
Class<? extends Item> a = Item.class;
Field f2;
try {
Expand Down

0 comments on commit 7c241e1

Please sign in to comment.