Class RawAsset
- java.lang.Object
-
- dev.linwood.itemmods.pack.DefinedNamedPackObject
-
- dev.linwood.itemmods.pack.asset.PackAsset
-
- dev.linwood.itemmods.pack.asset.CustomNamedAsset
-
- dev.linwood.itemmods.pack.asset.CustomPackAsset
-
- dev.linwood.itemmods.pack.asset.raw.RawAsset
-
- Direct Known Subclasses:
ModelAsset
,SoundAsset
,TextureAsset
public abstract class RawAsset extends CustomPackAsset
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,byte[]>
data
-
Fields inherited from class dev.linwood.itemmods.pack.DefinedNamedPackObject
GSON, name
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
export(java.lang.String namespace, java.lang.String variation, java.nio.file.Path path)
byte[]
getData(java.lang.String variation)
byte[]
getDataOrDefault(java.lang.String variation)
byte[]
getDefaultTexture()
@NotNull java.util.Set<java.lang.String>
getVariations()
void
removeVariation(java.lang.String variation)
com.google.gson.JsonObject
save(java.lang.String namespace)
void
setData(java.lang.String variation, byte[] bytes)
void
setData(java.lang.String variation, @NotNull java.lang.String url)
void
setDefaultData(byte[] bytes)
void
setDefaultData(@NotNull java.lang.String url)
-
Methods inherited from class dev.linwood.itemmods.pack.asset.CustomPackAsset
getTemplates, registerTemplate, registerTemplate, unregisterTemplate, unregisterTemplate
-
Methods inherited from class dev.linwood.itemmods.pack.asset.CustomNamedAsset
getDisplayName, removeDisplayName, setDisplayName
-
Methods inherited from class dev.linwood.itemmods.pack.DefinedNamedPackObject
getName, setName
-
-
-
-
Constructor Detail
-
RawAsset
public RawAsset(@NotNull @NotNull java.lang.String name)
-
RawAsset
public RawAsset(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.String url) throws java.io.IOException
- Throws:
java.io.IOException
-
RawAsset
public RawAsset(@NotNull @NotNull java.lang.String name, @NotNull @NotNull com.google.gson.JsonObject jsonObject)
-
-
Method Detail
-
getDefaultTexture
public byte[] getDefaultTexture()
-
setDefaultData
public void setDefaultData(byte[] bytes)
-
setDefaultData
public void setDefaultData(@NotNull @NotNull java.lang.String url) throws java.io.IOException
- Throws:
java.io.IOException
-
removeVariation
public void removeVariation(java.lang.String variation)
-
getVariations
@NotNull public @NotNull java.util.Set<java.lang.String> getVariations()
-
getData
public byte[] getData(java.lang.String variation)
-
getDataOrDefault
public byte[] getDataOrDefault(java.lang.String variation)
-
setData
public void setData(java.lang.String variation, @NotNull @NotNull java.lang.String url) throws java.io.IOException
- Throws:
java.io.IOException
-
setData
public void setData(java.lang.String variation, byte[] bytes)
-
save
public com.google.gson.JsonObject save(java.lang.String namespace)
- Overrides:
save
in classCustomPackAsset
-
export
public void export(java.lang.String namespace, java.lang.String variation, java.nio.file.Path path) throws java.io.IOException
- Throws:
java.io.IOException
-
-