Skip to content

Commit

Permalink
make flag only affect player saving, not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Aug 28, 2024
1 parent e8484e6 commit d2f3d61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/main/java/net/modfest/fireblanket/FireblanketMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return !ALLOW_FOOTGUNS;
}

if (mixinClassName.contains("footgun")) {
return !ALLOW_FOOTGUNS;
}

if (mixinClassName.contains("MixinRegionFile") || mixinClassName.contains("MixinPersistentState") || mixinClassName.contains("MixinLevelStorageSession")) {
if (mixinClassName.contains("MixinRegionFile") || mixinClassName.contains("MixinPersistentState")) {
return !AVOID_ZTSD;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

public class ZestyPlayerSaveHandler extends PlayerSaveHandler {
private static final Logger LOGGER = LogUtils.getLogger();
public static final boolean AVOID_ZTSD = Boolean.getBoolean("fireblanket.saveAsDat");

private final File playerDataDir;

Expand Down Expand Up @@ -64,6 +65,10 @@ public Optional<NbtCompound> loadPlayerData(PlayerEntity player) {

@Override
public void savePlayerData(PlayerEntity player) {
if (AVOID_ZTSD) {
super.savePlayerData(player);
return;
}
try {
NbtCompound nbt = player.writeNbt(new NbtCompound());
File tmp = File.createTempFile(player.getUuidAsString() + "-", ".zat", playerDataDir);
Expand Down

0 comments on commit d2f3d61

Please sign in to comment.