This is the ACNH Modding fork, distributed as AcnhModding.BfevLibrary. It includes serialization fixes used by EventFlowToCode. The assembly name and C# namespaces remain BfevLibrary.
Nintendo Binary cafe Event Flow Libray | Based on evfl by Léo Lam
BfevLibrary has been tested to parse, serialize (json), deserialize (json), and write every BFEV file found in Breath of the Wild byte-perfectly.
// Read from a File Path
BfevFile bfev = BfevFile.FromBinary("path/to/file.bfevfl");// Read from a byte[]
// Do not use with File.ReadAllBytes(), use
// a Stream instead.
SarcFile sarc = SarcFile.FromBinary("D:/Botw/Update/content/Events/100enemy.sbeventpack");
BfevFile bfev = BfevFile.FromBinary(sarc["EventFlow/100enemy.bfevfl"]);// Read from a Stream
using FileStream fs = File.OpenRead("path/to/file.bfevfl");
BfevFile bfev = new(fs);// Read from JSON
string json = File.ReadAllText("path/to/file.bfevfl.json");
BfevFile bfev = BfevFile.FromJson(json);// Write to a File Path
bfev.ToBinary("path/to/file_out.bfevfl");// Write to a byte[]
byte[] data = bfev.ToBinary();// Write to a Stream
using FileStream fs = File.Create("path/to/file_out.bfevfl");
bfev.ToBinary(fs);// Write to Json
string json = bfev.ToJson(format: true);Install-Package AcnhModding.BfevLibrary -PreReleasegit clone https://github.com/acnhmodding/BfevLibrary.git
dotnet build BfevLibrary/src/BfevLibrary.csprojThe nuget.yml workflow publishes version tags such as v0.12.2-acnh.1 using NuGet Trusted Publishing. Configure the policy for repository owner acnhmodding, repository BfevLibrary, workflow file nuget.yml, no environment, and package scope AcnhModding.BfevLibrary. Allow publishing new packages and package versions.
Set the GitHub repository Actions variable NUGET_USER to the nuget.org username that created the policy (not an email address). No API key secret is needed. Push the workflow and package changes before pushing a version tag; the tag determines the package version. Publish the fork before publishing an EventFlowToCode package that depends on it.
- Arch Leaders: C# Re-Implementation & JSON SerDe
- Léo Lam: Original Python Implementation & General Help