Skip to content

Commit

Permalink
change filewriter
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisuika committed Oct 28, 2024
1 parent db1361d commit 13cb57a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/dev/yurisuika/blossom/util/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 13cb57a

Please sign in to comment.