Compare commits
3 Commits
1.17
...
LambdAuror
Author | SHA1 | Date | |
---|---|---|---|
|
e7e85542be | ||
|
0cf9d4f2a8 | ||
|
2e71bcc464 |
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -12,7 +12,9 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
# Use these Java versions
|
# Use these Java versions
|
||||||
java: [
|
java: [
|
||||||
16 # Minimum supported by Minecraft
|
1.8, # Minimum supported by Minecraft
|
||||||
|
11, # Current Java LTS
|
||||||
|
15 # Latest version
|
||||||
]
|
]
|
||||||
# and run on both Linux and Windows
|
# and run on both Linux and Windows
|
||||||
os: [ubuntu-20.04, windows-latest]
|
os: [ubuntu-20.04, windows-latest]
|
||||||
@ -32,7 +34,7 @@ jobs:
|
|||||||
- name: build
|
- name: build
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
- name: capture build artifacts
|
- name: capture build artifacts
|
||||||
if: ${{ runner.os == 'Linux' && matrix.java == '16' }} # Only upload artifacts built from latest java on one OS
|
if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Artifacts
|
name: Artifacts
|
||||||
|
22
build.gradle
22
build.gradle
@ -1,15 +1,16 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.9-SNAPSHOT'
|
id 'fabric-loom' version '0.5-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_16
|
|
||||||
targetCompatibility = JavaVersion.VERSION_16
|
|
||||||
|
|
||||||
archivesBaseName = project.archives_base_name
|
archivesBaseName = project.archives_base_name
|
||||||
version = project.mod_version
|
version = project.mod_version
|
||||||
group = project.maven_group
|
group = project.maven_group
|
||||||
|
|
||||||
|
// This field defines the Java version your mod target.
|
||||||
|
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too.
|
||||||
|
def targetJavaVersion = 8
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// Add repositories to retrieve artifacts from in here.
|
// Add repositories to retrieve artifacts from in here.
|
||||||
// You should only use this when depending on other mods because
|
// You should only use this when depending on other mods because
|
||||||
@ -26,6 +27,9 @@ dependencies {
|
|||||||
|
|
||||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
// You can also use individual Fabric API modules with
|
||||||
|
// `modImplementation fabricApi.module('module-name', project.fabric_version)`
|
||||||
|
// If you do this, you will need to depend individually on each modules in the fabric.mod.json file.
|
||||||
|
|
||||||
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
|
||||||
// You may need to force-disable transitiveness on them.
|
// You may need to force-disable transitiveness on them.
|
||||||
@ -46,11 +50,17 @@ tasks.withType(JavaCompile).configureEach {
|
|||||||
// If Javadoc is generated, this must be specified in that task too.
|
// If Javadoc is generated, this must be specified in that task too.
|
||||||
it.options.encoding = "UTF-8"
|
it.options.encoding = "UTF-8"
|
||||||
|
|
||||||
// Minecraft 1.17 (21w19a) upwards uses Java 16.
|
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
|
||||||
it.options.release = 16
|
// We'll use that if it's available, but otherwise we'll use the older option.
|
||||||
|
if (JavaVersion.current().isJava9Compatible()) {
|
||||||
|
it.options.release = targetJavaVersion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.toVersion(targetJavaVersion)
|
||||||
|
targetCompatibility = JavaVersion.toVersion(targetJavaVersion)
|
||||||
|
|
||||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||||
// if it is present.
|
// if it is present.
|
||||||
// If you remove this line, sources will not be generated.
|
// If you remove this line, sources will not be generated.
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
org.gradle.jvmargs=-Xmx1G
|
org.gradle.jvmargs=-Xmx1G
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/versions.html
|
# check these on https://fabricmc.net/use
|
||||||
minecraft_version=1.17.1
|
minecraft_version=1.16.5
|
||||||
yarn_mappings=1.17.1+build.63
|
yarn_mappings=1.16.5+build.1
|
||||||
loader_version=0.11.7
|
loader_version=0.11.0
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0.0
|
mod_version = 1.0.0
|
||||||
@ -13,4 +13,5 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
archives_base_name = fabric-example-mod
|
archives_base_name = fabric-example-mod
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.41.0+1.17
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
|
fabric_version=0.29.3+1.16
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
2
gradlew
vendored
2
gradlew
vendored
@ -72,7 +72,7 @@ case "`uname`" in
|
|||||||
Darwin* )
|
Darwin* )
|
||||||
darwin=true
|
darwin=true
|
||||||
;;
|
;;
|
||||||
MSYS* | MINGW* )
|
MINGW* )
|
||||||
msys=true
|
msys=true
|
||||||
;;
|
;;
|
||||||
NONSTOP* )
|
NONSTOP* )
|
||||||
|
@ -1,21 +1,14 @@
|
|||||||
package net.fabricmc.example;
|
package net.fabricmc.example;
|
||||||
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
|
|
||||||
public class ExampleMod implements ModInitializer {
|
public class ExampleMod 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 = LogManager.getLogger("modid");
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
// This code runs as soon as Minecraft is in a mod-load-ready state.
|
// This code runs as soon as Minecraft is in a mod-load-ready state.
|
||||||
// However, some things (like resources) may still be uninitialized.
|
// However, some things (like resources) may still be uninitialized.
|
||||||
// Proceed with mild caution.
|
// Proceed with mild caution.
|
||||||
|
|
||||||
LOGGER.info("Hello Fabric world!");
|
System.out.println("Hello Fabric world!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package net.fabricmc.example.mixin;
|
package net.fabricmc.example.mixin;
|
||||||
|
|
||||||
import net.fabricmc.example.ExampleMod;
|
|
||||||
import net.minecraft.client.gui.screen.TitleScreen;
|
import net.minecraft.client.gui.screen.TitleScreen;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@ -11,6 +10,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
public class ExampleMixin {
|
public class ExampleMixin {
|
||||||
@Inject(at = @At("HEAD"), method = "init()V")
|
@Inject(at = @At("HEAD"), method = "init()V")
|
||||||
private void init(CallbackInfo info) {
|
private void init(CallbackInfo info) {
|
||||||
ExampleMod.LOGGER.info("This line is printed by an example mod mixin!");
|
System.out.println("This line is printed by an example mod mixin!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,9 @@
|
|||||||
],
|
],
|
||||||
|
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.11.3",
|
"fabricloader": ">=0.7.4",
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"minecraft": "1.17.x",
|
"minecraft": "1.16.x"
|
||||||
"java": ">=16"
|
|
||||||
},
|
},
|
||||||
"suggests": {
|
"suggests": {
|
||||||
"another-mod": "*"
|
"another-mod": "*"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"required": true,
|
"required": true,
|
||||||
"minVersion": "0.8",
|
"minVersion": "0.8",
|
||||||
"package": "net.fabricmc.example.mixin",
|
"package": "net.fabricmc.example.mixin",
|
||||||
"compatibilityLevel": "JAVA_16",
|
"compatibilityLevel": "JAVA_8",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
|
Loading…
Reference in New Issue
Block a user