Skip to content

Commit

Permalink
Add 1.20.1 Fabric mod template
Browse files Browse the repository at this point in the history
  • Loading branch information
SmylerMC committed Jun 7, 2024
1 parent e0e481f commit cdc0a1a
Show file tree
Hide file tree
Showing 13 changed files with 424 additions and 163 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ subprojects {
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

java.toolchain.languageVersion = JavaLanguageVersion.of(8)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

repositories {
mavenLocal()
Expand Down
46 changes: 46 additions & 0 deletions fabric/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# IDE
.idea
eclipse
.classpath
.location
.project
0.tree
.settings

# Run files
run/*

# Build files
build/*
out/*
.gradle/*
*.launch
*.xcf

# Compiled class file
*.class

# Log file
*.log
*.log.gz

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
# *.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/bin/
/.gradle/
/build/
44 changes: 44 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}

version = project.mod_version
group = project.mod_group
mod_id = project.mod_id

base {
archivesName = project.archives_base_name
}

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}"
}

processResources {

def properties = [
"version": project.version,
"mod_id": project.mod_id,
"mod_name": project.mod_name,
"mod_author": project.mod_author,
"fabric_loader_version": project.loader_version,
"minecraft_version": project.minecraft_version,
"java_version": project.java_version
]

inputs.properties properties

filesMatching("fabric.mod.json") {
expand properties
}
}

jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}
16 changes: 16 additions & 0 deletions fabric/src/main/java/net/smyler/terramap/TerramapFabricMod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package net.smyler.terramap;

import net.fabricmc.api.ModInitializer;
import org.apache.logging.log4j.Logger;

import static org.apache.logging.log4j.LogManager.getLogger;

public class TerramapFabricMod implements ModInitializer {

public static final Logger LOGGER = getLogger("terramap");
@Override
public void onInitialize() {
LOGGER.info("Initializing Terramap");
}

}
33 changes: 33 additions & 0 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"schemaVersion": 1,
"id": "${mod_id}",
"version": "${version}",
"name": "${mod_name}",
"description": "Terramap",
"authors": [
"${mod_author}"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
},
"license": "MIT License",
"icon": "${mod_id}.png",
"environment": "*",
"entrypoints": {
"main": [
"net.smyler.terramap.TerramapFabricMod"
]
},
"mixins": [
"${mod_id}.fabric.mixins.json"
],
"depends": {
"fabricloader": ">=${fabric_loader_version}",
"minecraft": "${minecraft_version}",
"java": ">=${java_version}"
},
"suggests": {
"another-mod": "*"
}
}
14 changes: 14 additions & 0 deletions fabric/src/main/resources/terramap.fabric.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"required": true,
"minVersion": "0.8",
"package": "net.smyler.terramap.mixin",
"refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_21",
"mixins": [],
"client": [
],
"server": [],
"injectors": {
"defaultRequire": 1
}
}
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
buildscript {
pluginManagement {
repositories {
maven {
url = "https://maven.minecraftforge.net"
Expand Down
22 changes: 15 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.parallel=true

# Forge stuff
archives_base_name=terramap

# Minecraft stuff
minecraft_version=1.20.1
java_version=21

minecraft_version=1.12.2
# Forge stuff
forge_version = 14.23.5.2855
mappings_channel = stable
mappings_version = 39-1.12

# Fabric
yarn_mappings=1.20.1+build.10
loader_version=0.15.11

# Mod stuff
mod_version = 1.0.0-beta8.7_1.12.2
mod_group = fr.thesmyler.terramap
mod_version = 2.0.0-alpha1_1.20.1
mod_group = net.smyler.terramap
mod_name = Terramap
mod_id = terramap
mod_authors = SmylerMC
mod_author = SmylerMC

# Dependencies
cc_version = 355923c35ca350482a06ce120fd01474696cd86d
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Sun Nov 07 09:55:19 CET 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
Loading

0 comments on commit cdc0a1a

Please sign in to comment.