mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-24 07:55:33 +00:00
25 lines
741 B
C#
25 lines
741 B
C#
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)
|
|
{
|
|
PckAsset asset = pck.CreateNewAsset(filename, filetype);
|
|
asset.SetData(writer);
|
|
return asset;
|
|
}
|
|
}
|
|
}
|