Skip to content

Commit

Permalink
Make WorldConverter.convert() throws IOException in java
Browse files Browse the repository at this point in the history
  • Loading branch information
joserobjr committed Jan 25, 2020
1 parent dca6f95 commit c0a865c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions src/main/kotlin/br/com/gamemods/j2nwc/WorldConverter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c0a865c

Please sign in to comment.