Skip to content

Commit

Permalink
1.20.4 (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Binero authored Dec 20, 2023
1 parent 71db8e3 commit 9971471
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.22
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.2
# Mod Properties
mod_version=1.4.13
maven_group=us.potatoboy
archives_base_name=InvView
# Dependencies
# check this on https://fabricmc.net/develop/
fabric_version=0.90.0+1.20.2
fabric_version=0.91.2+1.20.4
trinkets_version=3.8.0
apoli_version=2.10.1
apoli_version=2.10.3
sgui_version=1.3.0+1.20.2
6 changes: 4 additions & 2 deletions src/main/java/us/potatoboy/invview/InvView.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.apache.logging.log4j.LogManager;

import java.io.File;
import java.io.FileOutputStream;

public class InvView implements ModInitializer {
private static MinecraftServer minecraftServer;
Expand Down Expand Up @@ -94,10 +95,11 @@ public static void savePlayerData(ServerPlayerEntity player) {
try {
NbtCompound compoundTag = player.writeNbt(new NbtCompound());
File file = File.createTempFile(player.getUuidAsString() + "-", ".dat", playerDataDir);
NbtIo.writeCompressed(compoundTag, file);
final FileOutputStream fos = new FileOutputStream(file);
NbtIo.writeCompressed(compoundTag, fos);
File file2 = new File(playerDataDir, player.getUuidAsString() + ".dat");
File file3 = new File(playerDataDir, player.getUuidAsString() + ".dat_old");
Util.backupAndReplace(file2, file, file3);
Util.backupAndReplace(file2.toPath(), file.toPath(), file3.toPath());
} catch (Exception var6) {
LogManager.getLogger().warn("Failed to save player data for {}", player.getName().getString());
}
Expand Down

0 comments on commit 9971471

Please sign in to comment.