Compare commits
1 Commits
1.17
...
liachmodde
Author | SHA1 | Date | |
---|---|---|---|
|
fd92928700 |
25
build.gradle
25
build.gradle
@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '0.9-SNAPSHOT'
|
id 'fabric-loom' version '0.8-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7,9 +7,19 @@ sourceCompatibility = JavaVersion.VERSION_16
|
|||||||
targetCompatibility = JavaVersion.VERSION_16
|
targetCompatibility = JavaVersion.VERSION_16
|
||||||
|
|
||||||
archivesBaseName = project.archives_base_name
|
archivesBaseName = project.archives_base_name
|
||||||
version = project.mod_version
|
|
||||||
group = project.maven_group
|
group = project.maven_group
|
||||||
|
|
||||||
|
// Obtains mod version. change file reference if your fabric.mod.json is located elsewhere
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
version = new JsonSlurper().parse(file('src/main/resources/fabric.mod.json')).version
|
||||||
|
|
||||||
|
// You can use logger.lifecycle to print out messages like System.out; double-quote strings convert
|
||||||
|
// ${statement} templates to statement values, such as method calls, while single-quote strings don't.
|
||||||
|
// getXxx() calls can be simplified to xxx, like project.getGradle().getGradleVersion() is project.gradle.gradleVersion.
|
||||||
|
// Since the buildscript is provided with a project, you can call project methods without qualification if there is no
|
||||||
|
// ambiguity, such as file() call to retrieve version is project.file(), and gradle is project.getGradle()
|
||||||
|
logger.lifecycle "Setting up ${archivesBaseName} ${version} with Gradle ${gradle.gradleVersion}"
|
||||||
|
|
||||||
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,17 +36,6 @@ 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}"
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
filesMatching("fabric.mod.json") {
|
|
||||||
expand "version": project.version
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/versions.html
|
# check these on https://fabricmc.net/versions.html
|
||||||
minecraft_version=1.17.1
|
minecraft_version=1.17
|
||||||
yarn_mappings=1.17.1+build.63
|
yarn_mappings=1.17+build.13
|
||||||
loader_version=0.11.7
|
loader_version=0.11.6
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0.0
|
# edit your mod version in fabric.mod.json
|
||||||
maven_group = com.example
|
maven_group = com.example
|
||||||
archives_base_name = fabric-example-mod
|
archives_base_name = fabric-example-mod
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.41.0+1.17
|
fabric_version=0.36.0+1.17
|
||||||
|
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-7.0.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!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "modid",
|
"id": "modid",
|
||||||
"version": "${version}",
|
"version": "1.0.0",
|
||||||
|
|
||||||
"name": "Example Mod",
|
"name": "Example Mod",
|
||||||
"description": "This is an example description! Tell everyone what your mod is about!",
|
"description": "This is an example description! Tell everyone what your mod is about!",
|
||||||
|
Loading…
Reference in New Issue
Block a user