diff --git a/src/main/java/dev/yurisuika/blossom/util/config/Config.java b/src/main/java/dev/yurisuika/blossom/util/config/Config.java index a165a86..b0b7f74 100644 --- a/src/main/java/dev/yurisuika/blossom/util/config/Config.java +++ b/src/main/java/dev/yurisuika/blossom/util/config/Config.java @@ -7,6 +7,7 @@ import java.io.File; import java.io.FileWriter; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; public class Config { @@ -25,7 +26,7 @@ public static void setOptions(Options options) { public static void saveConfig() { try { - FileWriter fileWriter = new FileWriter(file); + FileWriter fileWriter = new FileWriter(file, StandardCharsets.UTF_8); fileWriter.write(gson.toJson(getOptions())); fileWriter.close(); } catch (Exception e) { diff --git a/src/main/java/dev/yurisuika/blossom/world/level/block/FloweringLeavesBlock.java b/src/main/java/dev/yurisuika/blossom/world/level/block/FloweringLeavesBlock.java index b3c608a..8c885b8 100644 --- a/src/main/java/dev/yurisuika/blossom/world/level/block/FloweringLeavesBlock.java +++ b/src/main/java/dev/yurisuika/blossom/world/level/block/FloweringLeavesBlock.java @@ -121,7 +121,7 @@ public void randomTick(BlockState state, ServerLevel level, BlockPos pos, Random if (level.isRaining() && precipitation == Precipitation.RAIN) { f = 5.0F; } - if (random.nextInt((int)(25.0F / f) + 1) == 0) { + if (random.nextInt((int) (25.0F / f) + 1) == 0) { level.setBlock(pos, defaultBlockState().setValue(AGE, i + 1) .setValue(DISTANCE, state.getValue(DISTANCE)) .setValue(PERSISTENT, state.getValue(PERSISTENT)) diff --git a/src/main/java/dev/yurisuika/blossom/world/level/block/FruitingLeavesBlock.java b/src/main/java/dev/yurisuika/blossom/world/level/block/FruitingLeavesBlock.java index 43ddc1d..2bc502f 100644 --- a/src/main/java/dev/yurisuika/blossom/world/level/block/FruitingLeavesBlock.java +++ b/src/main/java/dev/yurisuika/blossom/world/level/block/FruitingLeavesBlock.java @@ -123,7 +123,7 @@ public void randomTick(BlockState state, ServerLevel level, BlockPos pos, Random if (level.isRaining() && precipitation == Precipitation.RAIN) { f = 5.0F; } - if (random.nextInt((int)(25.0F / f) + 1) == 0) { + if (random.nextInt((int) (25.0F / f) + 1) == 0) { level.setBlock(pos, defaultBlockState().setValue(AGE, i + 1) .setValue(DISTANCE, state.getValue(DISTANCE)) .setValue(PERSISTENT, state.getValue(PERSISTENT))