if(args.length==0||args[0].equalsIgnoreCase("help")){sender.sendMessage(newString[]{"MineGeo commands:","/minegeo website <http(s)://address:port>","/minegeo link <dashboard token>","/minegeo area <world> <minX> <minZ> <maxX> <maxZ>","/minegeo export <map name> — saves a local export","/minegeo upload — uploads the latest completed export","/minegeo status | cancel | reload"});returntrue;}
if(args.length==0||args[0].equalsIgnoreCase("help")){sender.sendMessage(newString[]{"MineGeo commands:","/minegeo website <http(s)://address:port>","/minegeo server <hostname[:port]> — capture server address","/minegeo link <dashboard token>","/minegeo area <world> <minX> <minZ> <maxX> <maxZ>","/minegeo export <map name> — saves a local export","/minegeo upload — uploads the latest completed export","/minegeo contribute <map ID> — send up to 12 panoramas to its owner","/minegeo status | cancel | reload"});returntrue;}
switch(args[0].toLowerCase(Locale.ROOT)){
case"area"->{
requireIdle();if(args.length!=6)thrownewIllegalArgumentException("Usage: /minegeo area <world> <minX> <minZ> <maxX> <maxZ>");
@@ -52,9 +52,11 @@ public final class MineGeoPlugin extends JavaPlugin {
case"cancel"->{cancelled.set(true);sender.sendMessage(busy?"MineGeo cancellation requested. Completed exports are kept.":"MineGeo: no operation is running.");}
case"server"->{requireIdle();if(args.length!=2)thrownewIllegalArgumentException("Usage: /minegeo server <hostname[:port]>");Stringaddress=ServerAddress.normalize(args[1]);getConfig().set("server-address",address);saveConfig();sender.sendMessage("Capture server address saved: "+address+". Export again to record it.");}
case"link"->{requireIdle();if(args.length!=2||args[1].isBlank())thrownewIllegalArgumentException("Usage: /minegeo link <dashboard token>");getConfig().set("token",args[1]);saveConfig();sender.sendMessage("MineGeo contributor token saved.");}
requireIdle();if(latest==null||!Files.isRegularFile(latest.resolve("manifest.json")))thrownewIOException("No completed export. Run /minegeo export My World, wait for 'Export complete', then /minegeo upload. Files: "+getDataFolder().toPath().resolve("exports").toAbsolutePath());
Stringwebsite=getConfig().getString("website"),token=getConfig().getString("token");if(token==null||token.isBlank())thrownewIOException("Create a token in the website dashboard, then /minegeo link <token>.");
Bukkit.getScheduler().runTaskAsynchronously(this,()->{try{client.upload(directory,message->status=message,cancelled::get);report(sender,"Upload complete. Open "+website+"/dashboard to preview the private draft after processing.");}catch(Exceptionex){fail(sender,"Upload",ex);}finally{busy=false;}});
Bukkit.getScheduler().runTaskAsynchronously(this,()->{try{client.upload(directory,targetMap,message->status=message,cancelled::get);report(sender,"Upload complete. Open "+website+"/dashboard to preview and submit "+(targetMap==null?"the private map for moderator review.":"the panoramas to the map owner."));}catch(Exceptionex){fail(sender,"Upload",ex);}finally{busy=false;}});
sender.sendMessage("MineGeo upload started. /minegeo status shows progress; retry /minegeo upload after a connection failure.");
StringserverName=getConfig().getString("server-name","My Minecraft server");if(serverName.length()<2||serverName.length()>80)thrownewIllegalArgumentException("server-name in config.yml must contain 2–80 characters.");
if(host.length()>253)thrownewIllegalArgumentException("Invalid server hostname.");
for(Stringlabel:host.split("\\.",-1))if(!label.matches("[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?"))thrownewIllegalArgumentException("Invalid server hostname.");
if(!server.equals(actual))thrownewIOException("Wrong capture server: this map requires "+server+", but the export records "+(actual==null?"no server address":actual)+". Join the correct server and capture again. Plugin admins: configure server-address before exporting. The map owner can correct or clear its server address in settings.");
# Public Minecraft connection address, matching the address used by Fabric players.
# Set this before exporting. A blank address cannot contribute to checked maps.
server-address:''
max-area-size:2048
chunks-per-tick:1
viewpoints:12
viewpoints:24
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.