From c0a865cb083e61e630ac2207904a55de7afaca71 Mon Sep 17 00:00:00 2001 From: joserobjr Date: Sat, 25 Jan 2020 15:23:21 -0300 Subject: [PATCH] Make WorldConverter.convert() throws IOException in java --- CHANGELOG.md | 3 ++- src/main/kotlin/br/com/gamemods/j2nwc/WorldConverter.kt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5340227..b4cd706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,12 @@ Click the link above to see the future. - [#84] Mappings for Minecraft Java Edition 1.15 items and blocks ### Changed +- `WorldConverter.convert()` now throws `IOException` in java **(breaking change)** +- Updated [Region-Manipulator to `2.0.0`][Region 2.0.0] from `1.1.0` **(breaking change)** - [#84] The source world must be optimized by Minecraft 1.15.2 now - If the converter finds an unmapped block it will now be converted as 248:0 (minecraft:info_update) instead of 1:15 (stone with invalid data) - sweet_berries and shield are no longer replaced, they are obtainable in Nukkit 1.X now -- Updated [Region-Manipulator to `2.0.0`][Region 2.0.0] from `1.1.0`. - Honey bottle and all banner patterns are no longer replaced, they aren't obtainable in Nukkit 1.X but the server won't break if you have these items in your inventory anymore. diff --git a/src/main/kotlin/br/com/gamemods/j2nwc/WorldConverter.kt b/src/main/kotlin/br/com/gamemods/j2nwc/WorldConverter.kt index a5c9b44..8609021 100644 --- a/src/main/kotlin/br/com/gamemods/j2nwc/WorldConverter.kt +++ b/src/main/kotlin/br/com/gamemods/j2nwc/WorldConverter.kt @@ -4,6 +4,7 @@ import br.com.gamemods.j2nwc.internal.PostWorldConversionHook import br.com.gamemods.j2nwc.internal.convertLevelFile import br.com.gamemods.j2nwc.internal.convertRegionFile import java.io.File +import java.io.IOException /** * A region position extracted from the region file name. @@ -81,7 +82,10 @@ class WorldConverter(val from: File, val to: File) { /** * Executes the conversion in the current thread. Will take a while to complete. + * + * @throws IOException If an error occurs while loading or writing the files */ + @Throws(IOException::class) fun convert() { check(to.isDirectory || to.mkdirs()) { "Failed to create the folder $to"