diff --git a/src/main/java/com/simibubi/create/compat/computercraft/ComputerBehaviour.java b/src/main/java/com/simibubi/create/compat/computercraft/ComputerBehaviour.java index dc2c8cbba..86c4c19b7 100644 --- a/src/main/java/com/simibubi/create/compat/computercraft/ComputerBehaviour.java +++ b/src/main/java/com/simibubi/create/compat/computercraft/ComputerBehaviour.java @@ -7,6 +7,7 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; import dan200.computercraft.api.peripheral.IPeripheral; +import net.minecraft.nbt.CompoundTag; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityManager; import net.minecraftforge.common.capabilities.CapabilityToken; @@ -46,6 +47,18 @@ public class ComputerBehaviour extends TileEntityBehaviour { } } + @Override + public void read(CompoundTag nbt, boolean clientPacket) { + hasAttachedComputer = nbt.getBoolean("HasAttachedComputer"); + super.read(nbt, clientPacket); + } + + @Override + public void write(CompoundTag nbt, boolean clientPacket) { + nbt.putBoolean("HasAttachedComputer", hasAttachedComputer); + super.write(nbt, clientPacket); + } + public void setHasAttachedComputer(boolean hasAttachedComputer) { this.hasAttachedComputer = hasAttachedComputer; }