From db3c29679296047cd5601ed7a6fd4f20646f2c7a Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Thu, 15 Apr 2021 22:03:25 +0200 Subject: [PATCH] Hotfix --- .../structureMovement/AbstractContraptionEntity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java index 747e005d1..5c651529a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntity.java @@ -385,11 +385,10 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit CompoundNBT compound = new CompoundNBT(); writeAdditional(compound, true); - byte[] byteArray = null; try { ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput(); CompressedStreamTools.write(compound, dataOutput); - byteArray = dataOutput.toByteArray(); + byte[] byteArray = dataOutput.toByteArray(); int estimatedPacketSize = byteArray.length; if (estimatedPacketSize > 2_000_000) { Create.logger.warn("Could not send Contraption Spawn Data (Packet too big): " @@ -404,7 +403,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit return; } - buffer.writeByteArray(byteArray); + buffer.writeCompoundTag(compound); } @Override