initial commit
This commit is contained in:
86
fabric/build.gradle
Normal file
86
fabric/build.gradle
Normal file
@@ -0,0 +1,86 @@
|
||||
plugins {
|
||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||
}
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
fabric()
|
||||
}
|
||||
|
||||
configurations {
|
||||
common
|
||||
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
|
||||
compileClasspath.extendsFrom common
|
||||
runtimeClasspath.extendsFrom common
|
||||
developmentFabric.extendsFrom common
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url "https://maven.shedaniel.me/" }
|
||||
maven { url "https://maven.terraformersmc.com/releases/" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
||||
// Remove the next line if you don't want to depend on the API
|
||||
modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"
|
||||
|
||||
modApi "me.shedaniel.cloth:cloth-config-fabric:11.0.99"
|
||||
modApi "com.terraformersmc:modmenu:7.0.1"
|
||||
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||
|
||||
implementation 'org.json:json:20230227'
|
||||
include 'org.json:json:20230227'
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
configurations = [project.configurations.shadowCommon]
|
||||
archiveClassifier.set("dev-shadow")
|
||||
}
|
||||
|
||||
remapJar {
|
||||
inputFile.set shadowJar.archiveFile
|
||||
dependsOn shadowJar
|
||||
archiveClassifier.set(null)
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveClassifier.set("dev")
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
def commonSources = project(":common").sourcesJar
|
||||
dependsOn commonSources
|
||||
from commonSources.archiveFile.map { zipTree(it) }
|
||||
}
|
||||
|
||||
components.java {
|
||||
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
|
||||
skip()
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenFabric(MavenPublication) {
|
||||
artifactId = rootProject.archives_base_name + "-" + project.name
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
|
||||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
|
||||
repositories {
|
||||
// Add repositories to publish to here.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package me.zacharias.speedometer.fabric;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||
import me.zacharias.speedometer.SpeedTypes;
|
||||
import me.zacharias.speedometer.Speedometer;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public class Config implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return parent -> {
|
||||
ConfigBuilder builder = Speedometer.getConfig(parent);
|
||||
|
||||
return builder.build();
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package me.zacharias.speedometer.fabric;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||
import me.zacharias.speedometer.Speedometer;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public class SpeedometerFabric implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
Speedometer.init();
|
||||
|
||||
}
|
||||
}
|
||||
23
fabric/src/main/resources/fabric.mod.json
Normal file
23
fabric/src/main/resources/fabric.mod.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "speedometer",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "speedometer",
|
||||
"description": "just displaying your speed",
|
||||
"authors": [],
|
||||
"contact": {},
|
||||
|
||||
"license": "All Rights Reserved",
|
||||
"icon": "icon.png",
|
||||
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": ["me.zacharias.speedometer.fabric.SpeedometerFabric"],
|
||||
"modmenu": ["me.zacharias.speedometer.fabric.Config"]
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.21",
|
||||
"minecraft": ">=1.20"
|
||||
}
|
||||
}
|
||||
BIN
fabric/src/main/resources/icon.png
Normal file
BIN
fabric/src/main/resources/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 453 B |
Reference in New Issue
Block a user