ForgePatch/patches/minecraft/net/minecraft/world/storage/PlayerData.java.patch

28 lines
1.2 KiB
Diff

--- a/net/minecraft/world/storage/PlayerData.java
+++ b/net/minecraft/world/storage/PlayerData.java
@@ -33,6 +33,7 @@
File file2 = new File(this.field_237333_c_, p_237335_1_.func_189512_bd() + ".dat");
File file3 = new File(this.field_237333_c_, p_237335_1_.func_189512_bd() + ".dat_old");
Util.func_240977_a_(file2, file1, file3);
+ net.minecraftforge.event.ForgeEventFactory.firePlayerSavingEvent(p_237335_1_, field_237333_c_, p_237335_1_.func_189512_bd());
} catch (Exception exception) {
field_237332_b_.warn("Failed to save player data for {}", (Object)p_237335_1_.func_200200_C_().getString());
}
@@ -56,6 +57,7 @@
int i = compoundnbt.func_150297_b("DataVersion", 3) ? compoundnbt.func_74762_e("DataVersion") : -1;
p_237336_1_.func_70020_e(NBTUtil.func_210822_a(this.field_237331_a_, DefaultTypeReferences.PLAYER, compoundnbt, i));
}
+ net.minecraftforge.event.ForgeEventFactory.firePlayerLoadingEvent(p_237336_1_, field_237333_c_, p_237336_1_.func_189512_bd());
return compoundnbt;
}
@@ -74,4 +76,8 @@
return astring;
}
+
+ public File getPlayerDataFolder() {
+ return field_237333_c_;
+ }
}