Files
CatServer/patches/net/minecraft/nbt/CompressedStreamTools.java.patch
2019-02-24 22:29:41 +08:00

54 lines
1.7 KiB
Diff

--- ../src-base/minecraft/net/minecraft/nbt/CompressedStreamTools.java
+++ ../src-work/minecraft/net/minecraft/nbt/CompressedStreamTools.java
@@ -18,8 +18,6 @@
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.util.ReportedException;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
public class CompressedStreamTools
{
@@ -54,7 +52,6 @@
}
}
- @SideOnly(Side.CLIENT)
public static void safeWrite(NBTTagCompound compound, File fileIn) throws IOException
{
File file1 = new File(fileIn.getAbsolutePath() + "_tmp");
@@ -119,6 +116,7 @@
private static NBTBase read(DataInput input, int depth, NBTSizeTracker accounter) throws IOException
{
byte b0 = input.readByte();
+ accounter.read(8); // Forge: Count everything!
if (b0 == 0)
{
@@ -126,7 +124,8 @@
}
else
{
- input.readUTF();
+ NBTSizeTracker.readUTF(accounter, input.readUTF()); //Forge: Count this string.
+ accounter.read(32); //Forge: 4 extra bytes for the object allocation.
NBTBase nbtbase = NBTBase.createNewByType(b0);
try
@@ -144,7 +143,6 @@
}
}
- @SideOnly(Side.CLIENT)
public static void write(NBTTagCompound compound, File fileIn) throws IOException
{
DataOutputStream dataoutputstream = new DataOutputStream(new FileOutputStream(fileIn));
@@ -160,7 +158,6 @@
}
@Nullable
- @SideOnly(Side.CLIENT)
public static NBTTagCompound read(File fileIn) throws IOException
{
if (!fileIn.exists())