mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-11 10:05:58 +00:00
BlockBenchModel - Update Texture class to implictly convert to an image
This commit is contained in:
@@ -138,6 +138,7 @@ namespace PckStudio.External.Format
|
||||
internal class Texture
|
||||
{
|
||||
public static implicit operator Texture(Image image) => new Texture(image);
|
||||
public static implicit operator Image(Texture texture) => texture.GetImage();
|
||||
|
||||
private Texture() { }
|
||||
|
||||
@@ -154,7 +155,7 @@ namespace PckStudio.External.Format
|
||||
[JsonProperty("source")]
|
||||
internal string TextureSource;
|
||||
|
||||
internal Image GetTexture()
|
||||
private Image GetImage()
|
||||
{
|
||||
string data = TextureSource;
|
||||
const string dataHead = "data:image/png;base64,";
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace PckStudio.Internal
|
||||
|
||||
if (blockBenchModel.Textures.IndexInRange(0))
|
||||
{
|
||||
modelInfo.Texture = blockBenchModel.Textures[0].GetTexture();
|
||||
modelInfo.Texture = blockBenchModel.Textures[0];
|
||||
modelInfo.ANIM.SetFlag(SkinAnimFlag.RESOLUTION_64x64, modelInfo.Texture.Size.Width == modelInfo.Texture.Size.Height);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user