From 6d41d3471bcf799b58b888735272fc49ce8f35c4 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 6 Sep 2025 23:17:15 -0400 Subject: remove german locale, remove trailing whitespace --- src/main/java/cat/freya/khs/world/WorldLoader.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/cat/freya/khs/world/WorldLoader.java') diff --git a/src/main/java/cat/freya/khs/world/WorldLoader.java b/src/main/java/cat/freya/khs/world/WorldLoader.java index 8460365..97d1273 100644 --- a/src/main/java/cat/freya/khs/world/WorldLoader.java +++ b/src/main/java/cat/freya/khs/world/WorldLoader.java @@ -16,7 +16,7 @@ import static cat.freya.khs.configuration.Localization.message; public class WorldLoader { private final Map map; - + public WorldLoader(Map map) { this.map = map; } @@ -52,12 +52,12 @@ public class WorldLoader { world.setAutoSave(false); }); } - + public void rollback() { unloadMap(); loadMap(); } - + public String save() { World world = Bukkit.getServer().getWorld(map.getSpawnName()); if(world == null){ @@ -91,7 +91,7 @@ public class WorldLoader { return errorPrefix + message("MAPSAVE_ERROR"); } } - + private void copyFileFolder(String name, Boolean isMca) throws IOException { File region = new File(Main.getInstance().getWorldContainer()+File.separator+ map.getSpawnName() +File.separator+name); File temp = new File(Main.getInstance().getWorldContainer()+File.separator+"temp_"+ map.getGameSpawnName() +File.separator+name); @@ -110,14 +110,14 @@ public class WorldLoader { int minZ = (int)Math.floor(map.getBoundsMin().getZ() / 512.0); int maxX = (int)Math.floor(map.getBoundsMax().getX() / 512.0); int maxZ = (int)Math.floor(map.getBoundsMax().getZ() / 512.0); - + String[] parts = file.split("\\."); if (parts.length > 1) { if ( Integer.parseInt(parts[1]) < minX || Integer.parseInt(parts[1]) > maxX || Integer.parseInt(parts[2]) < minZ || Integer.parseInt(parts[2]) > maxZ ) continue; } } - + File srcFile = new File(region, file); if (srcFile.isDirectory()) { copyFileFolder(name+File.separator+file, false); @@ -128,7 +128,7 @@ public class WorldLoader { } } } - + private void copyFile(File source, File target) throws IOException { InputStream in = Files.newInputStream(source.toPath()); OutputStream out = Files.newOutputStream(target.toPath()); @@ -139,7 +139,7 @@ public class WorldLoader { in.close(); out.close(); } - + public static void deleteDirectory(File directoryToBeDeleted) { File[] allContents = directoryToBeDeleted.listFiles(); if (allContents != null) { @@ -151,5 +151,5 @@ public class WorldLoader { throw new RuntimeException("Failed to delete directory: "+directoryToBeDeleted.getPath()); } } - + } -- cgit v1.2.3-freya