# 1.17.X-1.18.X(Fabric)

Issue #5 wanted to add support for 1.17

Made the mod work for 1.17.1-1.18.2 for Fabric, and 1.17.1 for Forge

Lot of changes due to API differences have resulted in changes to nearly all files and a comprehensive list would just list everything, so if you're interested you can look through things

This version is a backport of 6.2.4/6.2.3 to Minecraft 1.17 this includes
- Resourcepack
- Color
- Location
- And more
This commit is contained in:
2025-04-05 19:30:49 +02:00
parent 4b2a150a30
commit b81dd019ea
19 changed files with 401 additions and 122 deletions

View File

@@ -23,13 +23,13 @@ repositories {
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}+${rootProject.minecraft_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}+1.17"
// 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:${rootProject.cloth_config_version}"
modApi "com.terraformersmc:modmenu:${rootProject.modmenu_version}"
modApi "eu.pb4:placeholder-api:2.4.0-pre.2+1.21"
//modApi "eu.pb4:placeholder-api:2.4.0-pre.2+1.21"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
@@ -49,7 +49,7 @@ shadowJar {
}
remapJar {
inputFile.set shadowJar.archiveFile
input/*File*/.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set(null)
}

View File

@@ -8,6 +8,8 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.resources.ResourceManager;
import java.io.IOException;
public class SpeedometerFabric implements ModInitializer {
@Override
public void onInitialize() {
@@ -16,7 +18,7 @@ public class SpeedometerFabric implements ModInitializer {
//Minecraft.getInstance().getResourcePackRepository().addPack()
ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() {
/**
/**
* Register the reload listener for the speedometers
* This is required since i haven't found how to put this in the Architecture Abstraction layer(Common module)
* TODO: Find a way to put this in the Abstraction layer
@@ -24,12 +26,16 @@ public class SpeedometerFabric implements ModInitializer {
*/
@Override
public void onResourceManagerReload(ResourceManager resourceManager) {
Speedometer.loadSpeedometers(resourceManager);
try {
Speedometer.loadSpeedometers(resourceManager);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Override
public ResourceLocation getFabricId() {
return ResourceLocation.fromNamespaceAndPath("speedometer", "visual_speedometer_reload_listener");
return new ResourceLocation("speedometer", "visual_speedometer_reload_listener");
}
});
}

View File

@@ -19,11 +19,11 @@
"main": ["me.zacharias.speedometer.fabric.SpeedometerFabric"]
},
"depends": {
"fabricloader": ">=0.15.11",
"minecraft": ">=1.21",
"architectury": ">=13.0.5"
"fabricloader": ">=0.12.12",
"minecraft": ">=1.17 <1.19",
"architectury": ">=2.10.10"
},
"suggests": {
"cloth-config1": ">=15.0.140"
"cloth-config1": ">=5.3.63"
}
}