Package dev.linwood.itemmods.pack
Class PackObject
- java.lang.Object
-
- dev.linwood.itemmods.pack.PackObject
-
public class PackObject extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull Pattern
IDENTIFIER_PATTERN
static @NotNull Pattern
NAME_PATTERN
-
Constructor Summary
Constructors Constructor Description PackObject(@NotNull String identifier)
PackObject(@NotNull org.bukkit.NamespacedKey key)
PackObject(String namespace, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description @Nullable PackAsset
getAsset()
Deprecated.Deprecated because assets can have the same pack object if they have a different type.<T extends PackAsset>
TgetAssetByType(Class<T> assetClass)
Get the asset by the class@Nullable BlockAsset
getBlock()
@Nullable CustomAssetGenerator<BlockAsset>
getBlockGenerator()
@Nullable Integer
getCustomModel()
<T extends PackAsset>
@Nullable CustomAssetGenerator<T>getGeneratorByType(Class<T> assetClass)
@Nullable ItemAsset
getItem()
@Nullable CustomAssetGenerator<ItemAsset>
getItemGenerator()
@Nullable ModelAsset
getModel()
@Nullable CustomAssetGenerator<ModelAsset>
getModelGenerator()
String
getName()
String
getNamespace()
@Nullable ItemModsPack
getPack()
@Nullable CustomTemplate
getTemplate()
@Nullable TextureAsset
getTexture()
@Nullable CustomAssetGenerator<TextureAsset>
getTextureGenerator()
void
save()
@NotNull String
toString()
-
-
-
Constructor Detail
-
PackObject
public PackObject(@NotNull @NotNull String identifier) throws UnsupportedOperationException
- Throws:
UnsupportedOperationException
-
PackObject
public PackObject(@NotNull @NotNull org.bukkit.NamespacedKey key)
-
-
Method Detail
-
getNamespace
public String getNamespace()
-
getName
public String getName()
-
getPack
@Nullable public @Nullable ItemModsPack getPack()
-
getAsset
@Nullable @Deprecated public @Nullable PackAsset getAsset()
Deprecated.Deprecated because assets can have the same pack object if they have a different type. Use for this- Returns:
- Returns the asset by the given namespace and key
-
getItem
@Nullable public @Nullable ItemAsset getItem()
-
getBlock
@Nullable public @Nullable BlockAsset getBlock()
-
getTemplate
@Nullable public @Nullable CustomTemplate getTemplate()
-
getModel
@Nullable public @Nullable ModelAsset getModel()
-
getTexture
@Nullable public @Nullable TextureAsset getTexture()
-
getCustomModel
@Nullable public @Nullable Integer getCustomModel()
-
save
public void save()
-
getAssetByType
@Nullable public <T extends PackAsset> T getAssetByType(Class<T> assetClass)
Get the asset by the class- Parameters:
assetClass
- The class of the searched asset- Returns:
- Returns null if nothing found or the asset
-
getGeneratorByType
@Nullable public <T extends PackAsset> @Nullable CustomAssetGenerator<T> getGeneratorByType(Class<T> assetClass)
-
getItemGenerator
@Nullable public @Nullable CustomAssetGenerator<ItemAsset> getItemGenerator()
-
getBlockGenerator
@Nullable public @Nullable CustomAssetGenerator<BlockAsset> getBlockGenerator()
-
getTextureGenerator
@Nullable public @Nullable CustomAssetGenerator<TextureAsset> getTextureGenerator()
-
getModelGenerator
@Nullable public @Nullable CustomAssetGenerator<ModelAsset> getModelGenerator()
-
-