From 037e655f7ef788cc39aaac374b9c4a345768b0bc Mon Sep 17 00:00:00 2001 From: okx-code Date: Sun, 26 Feb 2023 18:37:57 +0000 Subject: [PATCH] add civmc versions --- civmc | 0 .../sh/okx/civmodern/common/radar/Radar.java | 16 +++++++++++++++- fabric/build.gradle | 18 ++++++++++++++---- forge/build.gradle | 18 ++++++++++++++---- gradle.properties | 2 +- 5 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 civmc diff --git a/civmc b/civmc new file mode 100644 index 0000000..e69de29 diff --git a/common/src/main/java/sh/okx/civmodern/common/radar/Radar.java b/common/src/main/java/sh/okx/civmodern/common/radar/Radar.java index 870d612..bdd9a9a 100644 --- a/common/src/main/java/sh/okx/civmodern/common/radar/Radar.java +++ b/common/src/main/java/sh/okx/civmodern/common/radar/Radar.java @@ -10,6 +10,9 @@ import com.mojang.blaze3d.vertex.VertexFormat.Mode; import com.mojang.math.Matrix4f; import com.mojang.math.Vector3f; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; import java.util.Collections; import java.util.HashSet; import java.util.Random; @@ -48,6 +51,17 @@ public class Radar { + private static boolean hideY; + + static { + URL resource = Radar.class.getResource("/civmc"); + if (resource != null) { + hideY = true; + } else { + hideY = false; + } + } + private final EventBus eventBus; private final ColourProvider colourProvider; private final CivMapConfig config; @@ -79,7 +93,7 @@ public void onClientTick(ClientTickEvent event) { } private boolean hideY() { - return false; + return hideY; } public void onWorldTickPing(ClientTickEvent event) { diff --git a/fabric/build.gradle b/fabric/build.gradle index 95066d2..017a320 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -76,16 +76,26 @@ publishing { } } +import net.fabricmc.loom.task.RemapJarTask + +task remapCivMc(type: RemapJarTask) { + inputFile.set shadowJar.archiveFile + dependsOn shadowJar + classifier "civmc-fabric" + from sourceSets.main.output + from '../civmc' +} + task cleanJar(type: Delete) { delete fileTree('../dist') { - include "*-fabric.jar" + include "*-forge*.jar" } } task copyJar(type: Copy) { - from remapJar + dependsOn cleanJar + from remapJar, remapCivMc into '../dist' } -build.dependsOn copyJar -copyJar.dependsOn cleanJar \ No newline at end of file +build.dependsOn copyJar \ No newline at end of file diff --git a/forge/build.gradle b/forge/build.gradle index 23e4356..67ba2eb 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -84,16 +84,26 @@ publishing { } } +import net.fabricmc.loom.task.RemapJarTask + +task remapCivMc(type: RemapJarTask) { + inputFile.set shadowJar.archiveFile + dependsOn shadowJar + classifier "civmc-forge" + from sourceSets.main.output + from '../civmc' +} + task cleanJar(type: Delete) { delete fileTree('../dist') { - include "*-forge.jar" + include "*-forge*.jar" } } task copyJar(type: Copy) { - from remapJar + dependsOn cleanJar + from remapJar, remapCivMc into '../dist' } -build.dependsOn copyJar -copyJar.dependsOn cleanJar \ No newline at end of file +build.dependsOn copyJar \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index af23938..ea592fa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ minecraft_version=1.18.2 enabled_platforms=fabric,forge archives_base_name=civmodern -mod_version=1.5 +mod_version=1.5.1 maven_group=sh.okx.civmodern architectury_version=4.2.50