Improve MineGeo exploration and mapping features

This commit is contained in:
2026-10-05 13:41:36 +05:00
parent aec0641f87
commit c5368fa8cc
69 changed files with 3581 additions and 333 deletions

View File

@@ -0,0 +1,17 @@
import dev.minegeo.plugin.ServerAddress;
public class ServerAddressSmoke {
public static void main(String[] args) throws Exception {
ServerAddress.requireMatch(" PLAY.EXAMPLE.COM.:25565 ","play.example.com");
ServerAddress.requireMatch("[2001:DB8::1]","[2001:db8::1]:25565");
ServerAddress.requireMatch(null,"other.example.com");
for(String capture:new String[]{"other.example.com","play.example.com:25566",""}) {
try {ServerAddress.requireMatch("play.example.com",capture);throw new AssertionError("Wrong server accepted");}
catch(java.io.IOException expected) {}
}
for(String invalid:new String[]{"https://host","host:0","host:65536","a..b","[:::]"}) {
try {ServerAddress.normalize(invalid);throw new AssertionError("Invalid address accepted");}
catch(IllegalArgumentException expected) {}
}
System.out.println("Server address checks passed for the shared mod/plugin client");
}
}

View File

@@ -4,6 +4,6 @@ import java.nio.file.*;
public class UploadSmoke {
public static void main(String[] args) throws Exception {
String token=JsonParser.parseString(Files.readString(Path.of(args[2]))).getAsJsonObject().get("token").getAsString();
new UploadClient(args[0],token).upload(Path.of(args[1]),message->System.out.println(message),()->false);
new UploadClient(args[0],token).upload(Path.of(args[1]),args.length>3?args[3]:null,message->System.out.println(message),()->false);
}
}