Skip to content

Commit

Permalink
WM1.37.1 MM23.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Nov 29, 2023
1 parent 9090076 commit 808b136
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 13 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/fabric-1.20.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- "fabric-1.20.1"
env:
WORLDMAP_VERSION: "1.37.0"
MINIMAP_VERSION: "23.9.0"
MINECRAFT_VERSION: "1.20.1"
MINECRAFT_VERSION_SHORT: "1.20"
MOD_LOADER: "Fabric"
Expand Down Expand Up @@ -34,6 +32,14 @@ jobs:
- name: Elevate wrapper permissions
run: chmod +x ./gradlew

- name: Get WorldMap Version
run: |
echo "WORLDMAP_VERSION=$(./gradlew -q printWorldMapVersion)" >> $GITHUB_ENV
- name: Get Minimap Version
run: |
echo "MINIMAP_VERSION=$(./gradlew -q printMinimapVersion)" >> $GITHUB_ENV
- name: Build mod
run: ./gradlew build

Expand All @@ -57,7 +63,7 @@ jobs:

- name: Create modpack zip
run: >
zip -j
zip -j
XaeroPlus-modpack-${{ env.MOD_LOADER }}-${{ env.MINECRAFT_VERSION }}-${{ github.run_number }}.zip
XaeroPlus-${{ env.MOD_LOADER }}-${{ env.MINECRAFT_VERSION }}-${{ github.run_number }}-WM${{ env.WORLDMAP_VERSION }}-MM${{ env.MINIMAP_VERSION }}.jar
XaerosWorldMap_${{ env.WORLDMAP_VERSION }}_${{ env.MOD_LOADER }}_${{ env.MINECRAFT_VERSION_SHORT }}.jar
Expand Down
26 changes: 20 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ afterEvaluate {
}
}

ext {
worldmap_version = "1.37.1"
minimap_version = "23.9.1"
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
Expand All @@ -55,9 +60,9 @@ dependencies {
jarLibs "com.github.collarmc:pounce:0e8492b68e"
jarLibs 'org.xerial:sqlite-jdbc:3.44.1.0'

modImplementation "maven.modrinth:xaeros-world-map:1.37.0_Fabric_1.20"
modImplementation "maven.modrinth:xaeros-minimap:23.9.0_Fabric_1.20"
modCompileOnly files("libs/BetterPvP_23.9.0_Fabric_1.20.jar")
modImplementation "maven.modrinth:xaeros-world-map:${worldmap_version}_Fabric_1.20"
modImplementation "maven.modrinth:xaeros-minimap:${minimap_version}_Fabric_1.20"
modCompileOnly files("libs/BetterPvP_${minimap_version}_Fabric_1.20.jar")
modImplementation files("libs/baritone-api-fabric-1.20.1-elytra-beta-v1.jar")
modImplementation "maven.modrinth:waystones:14.0.2+fabric-1.20"
modImplementation "maven.modrinth:balm:7.1.4+fabric-1.20.1"
Expand All @@ -69,13 +74,22 @@ dependencies {
}

processResources {
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
expand([
"version": project.version,
"worldmap_version": project.ext.worldmap_version,
"minimap_version": project.ext.minimap_version
])
}
}

tasks.register('printWorldMapVersion') {
println project.ext.worldmap_version
}
tasks.register('printMinimapVersion') {
println project.ext.minimap_version
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
Expand Down
Binary file not shown.
8 changes: 5 additions & 3 deletions src/main/java/xaeroplus/XaeroPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class XaeroPlus implements ClientModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("XaeroPlus");
public static final EventBus EVENT_BUS = new EventBus(Runnable::run);
public static AtomicBoolean initialized = new AtomicBoolean(false);
private static final String compatibleMinimapVersion = "23.9.0";

public static void initialize() {
if (initialized.compareAndSet(false, true)) {
LOGGER.info("Initializing XaeroPlus");
Expand All @@ -42,7 +40,7 @@ public void onInitializeClient() {

private static void minimapCompatibleVersionCheck() {
try {
SemanticVersion compatibleMinimapVersion = SemanticVersion.parse(XaeroPlus.compatibleMinimapVersion);
SemanticVersion compatibleMinimapVersion = SemanticVersion.parse(getCompatibleMinimapVersion());
if (!checkVersion("xaerominimap", compatibleMinimapVersion) && !checkVersion("xaerobetterpvp", compatibleMinimapVersion)) {
throw new RuntimeException("XaeroPlus requires version: '" + compatibleMinimapVersion + "' of Xaero's Minimap or BetterPVP installed");
}
Expand All @@ -62,4 +60,8 @@ private static boolean checkVersion(final String modId, final SemanticVersion ve
return false;
}
}

private static String getCompatibleMinimapVersion() {
return FabricLoader.getInstance().getModContainer("xaeroplus").get().getMetadata().getCustomValue("minimap_version").getAsString();
}
}
5 changes: 4 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"minecraft": "~1.20",
"java": ">=17",
"fabric-api": "*",
"xaeroworldmap": "1.37.0"
"xaeroworldmap": "${worldmap_version}"
},
"custom": {
"minimap_version": "${minimap_version}"
}
}

0 comments on commit 808b136

Please sign in to comment.