mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-07 05:25:49 +00:00
31 lines
869 B
C#
31 lines
869 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using OMI.Formats.Pck;
|
|
using OMI.Workers;
|
|
|
|
namespace PckStudio.Extensions
|
|
{
|
|
internal static class PckFileExtensions
|
|
{
|
|
internal static PckAsset CreateNewAssetIf(this PckFile pck, bool condition, string filename, PckAssetType filetype, IDataFormatWriter writer)
|
|
{
|
|
if (condition)
|
|
{
|
|
return pck.CreateNewAsset(filename, filetype, writer);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
internal static PckAsset CreateNewAsset(this PckFile pck, string filename, PckAssetType filetype, IDataFormatWriter writer)
|
|
{
|
|
var asset = pck.CreateNewAsset(filename, filetype);
|
|
asset.SetData(writer);
|
|
return asset;
|
|
}
|
|
}
|
|
}
|