tterrag1098

Untitled

Sep 10th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. Author:
  2. Committer:
  3. Parent: a4f280230688e1d02946973d7f67a7e1746cc375 (Add I18n accessor, fix up some mod log messages, make the EnumExtender work.)
  4. Branch:
  5. Follows:
  6. Precedes:
  7.  
  8. Local changes checked in to index but not committed
  9.  
  10. --------- patches/minecraft/net/minecraft/world/chunk/Chunk.java.patch ---------
  11. index 434707fa0..4c162d650 100644
  12. @@ -17,3 +17,23 @@
  13. }
  14.  
  15. public Chunk(World p_i48703_1_, ChunkPrimer p_i48703_2_, int p_i48703_3_, int p_i48703_4_) {
  16. +@@ -1164,4 +1165,19 @@
  17. + QUEUED,
  18. + CHECK;
  19. + }
  20. ++
  21. ++ // FORGE start
  22. ++
  23. ++ @java.lang.Deprecated
  24. ++ @javax.annotation.Nullable
  25. ++ public final NBTTagCompound writeCapsToNBT()
  26. ++ {
  27. ++ return this.serializeCaps();
  28. + }
  29. ++
  30. ++ @java.lang.Deprecated
  31. ++ public final void readCapsFromNBT(NBTTagCompound tag)
  32. ++ {
  33. ++ this.deserializeCaps(tag);
  34. ++ }
  35. ++}
  36.  
  37. patches/minecraft/net/minecraft/world/chunk/storage/AnvilChunkLoader.java.patch
  38. index fad6efd86..88c6d519c 100644
  39. @@ -1,31 +1,32 @@
  40. --- a/net/minecraft/world/chunk/storage/AnvilChunkLoader.java
  41. +++ b/net/minecraft/world/chunk/storage/AnvilChunkLoader.java
  42. -@@ -445,7 +445,19 @@
  43. +@@ -445,7 +445,20 @@
  44.  
  45. compound.setTag("Heightmaps", nbttagcompound2);
  46. compound.setTag("Structures", this.func_202160_a(chunkIn.x, chunkIn.z, chunkIn.func_201609_c(), chunkIn.func_201604_d()));
  47. +
  48. -+ if (chunkIn.getCapabilities() != null)
  49. ++ try
  50. + {
  51. -+ try
  52. ++ final NBTTagCompound capTag = chunkIn.writeCapsToNBT();
  53. ++ if (capTag != null)
  54. + {
  55. -+ compound.setTag("ForgeCaps", chunkIn.getCapabilities().serializeNBT());
  56. ++ compound.setTag("ForgeCaps", capTag);
  57. }
  58. -+ catch (Exception exception)
  59. -+ {
  60. -+ org.apache.logging.log4j.LogManager.getLogger().error("A capability provider has thrown an exception trying to write state. It will not persist. Report this to the mod author", exception);
  61. -+ }
  62. ++ }
  63. ++ catch (Exception exception)
  64. ++ {
  65. ++ org.apache.logging.log4j.LogManager.getLogger().error("A capability provider has thrown an exception trying to write state. It will not persist. Report this to the mod author", exception);
  66. + }
  67. + }
  68.  
  69. private Chunk readChunkFromNBT(IWorld worldIn, NBTTagCompound compound) {
  70. int i = compound.getInteger("xPos");
  71. -@@ -511,6 +523,10 @@
  72. +@@ -511,6 +524,10 @@
  73. chunk.setModified(true);
  74. }
  75.  
  76. -+ if (chunk.getCapabilities() != null && compound.hasKey("ForgeCaps")) {
  77. -+ chunk.getCapabilities().deserializeNBT(compound.getCompoundTag("ForgeCaps"));
  78. ++ if (compound.hasKey("ForgeCaps")) {
  79. ++ chunk.readCapsFromNBT(compound.getCompoundTag("ForgeCaps"));
  80. + }
  81. +
  82. return chunk;
Advertisement
Add Comment
Please, Sign In to add comment