Skip to content

Commit 2994d30

Browse files
committed
fix end city locator and include distance in notification
1 parent b9c1ec1 commit 2994d30

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ configurations {
2525

2626
dependencies {
2727
// This will make it work on most platforms. It automatically chooses the right dependencies at runtime.
28-
extraLibs('dev.duti.acheong:cubiomes:1.22.1') { transitive = false }
29-
extraLibs('dev.duti.acheong:cubiomes:1.22.1:linux64') { transitive = false }
30-
extraLibs('dev.duti.acheong:cubiomes:1.22.1:osx') { transitive = false }
31-
extraLibs('dev.duti.acheong:cubiomes:1.22.1:windows64') { transitive = false }
28+
extraLibs('dev.duti.acheong:cubiomes:1.22.2') { transitive = false }
29+
extraLibs('dev.duti.acheong:cubiomes:1.22.2:linux64') { transitive = false }
30+
extraLibs('dev.duti.acheong:cubiomes:1.22.2:osx') { transitive = false }
31+
extraLibs('dev.duti.acheong:cubiomes:1.22.2:windows64') { transitive = false }
3232
// To change the versions see the gradle.properties file
3333
minecraft "com.mojang:minecraft:${project.minecraft_version}"
3434
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"

src/main/java/anticope/rejects/commands/LocateCommand.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,17 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
7777

7878
}
7979
if (pos != null) {
80+
// Calculate distance
81+
int distance = (int) Math.hypot(pos.x - playerPos.getX(), pos.z - playerPos.getZ());
8082
MutableText text = Text.literal(String.format(
8183
"%s located at ",
8284
Utils.nameToTitle(feature.toString().replaceAll("_", "-"))));
8385
Vec3d coords = new Vec3d(pos.x, 0, pos.z);
8486
text.append(ChatUtils.formatCoords(coords));
8587
text.append(".");
88+
if (distance > 0) {
89+
text.append(String.format(" (%d blocks away)", distance));
90+
}
8691
info(text);
8792
return SINGLE_SUCCESS;
8893
}

0 commit comments

Comments
 (0)