Class Namespace
java.lang.Object
com.github.darksoulq.abyssallib.server.resource.Namespace
Represents a logical namespace inside a resource pack.
All emitted files are placed under assets/<namespace>/. This class
provides factory methods for all supported asset types (textures, models, lang, etc.)
and maintains a list of registered assets for the final emission process.
-
Constructor Summary
ConstructorsConstructorDescriptionNamespace(@NotNull String namespace, @NotNull ResourcePack pack) Creates a new namespace. -
Method Summary
Modifier and TypeMethodDescription@NotNull Atlas@NotNull Atlasblockstate(String name, boolean autoLoad) Registers a blockstate configuration asset.blockstate(String name, byte[] data) Registers a blockstate with provided data.coreShader(String name) coreShader(String name, byte[] vsh, byte[] fsh, byte[] json) coreShader(String name, String vsh, String fsh, String json) voidIterates through all registered assets and writes them into the provided map.Registers an equipment asset for armor or player-held items.Registers an equipment asset with provided data.@NotNull FontRegisters a font configuration asset.@NotNull FontRegisters a font configuration with provided data.getIcon()@NotNull String@NotNull ResourcePackgetPack()@NotNull org.bukkit.plugin.Pluginvoidicon()Autoloads the icon for this Namespace fromtextures/item/icon.png.voidicon(byte[] data) Sets the icon for this Namespace to show in menus using raw image data.@NotNull StringFormats a path into a namespaced ID (e.g., "myplugin:sword").includeShader(String name) includeShader(String name, byte[] glsl) includeShader(String name, String glsl) @NotNull ItemDefinitionitemDefinition(@NotNull String name) Registers anItemDefinitionasset from the plugin's JAR.@NotNull ItemDefinitionitemDefinition(@NotNull String name, byte[] data) Registers anItemDefinitionwith provided data.itemDefinition(@NotNull String name, @NotNull Selector selector) Programmatically registers an item definition using a selector.itemDefinition(@NotNull String name, @NotNull Selector selector, boolean handAnimationOnSwap) Programmatically registers an item definition with toggleable swap animation.itemDefinition(@NotNull String name, @NotNull Selector selector, boolean handAnimationOnSwap, boolean oversizedInGui, double swapAnimationScale) The master method for programmatic item definitions.itemDefinition(@NotNull String name, @NotNull Selector selector, double swapAnimationScale) Programmatically registers an item definition with custom GUI animation scale.Registers a generic JSON file asset within the namespace.@NotNull LangRegisters a translation language file (e.g., en_us.json).@NotNull LangRegisters a language file with provided data.Registers an .mcmeta file for texture animations or metadata.Registers an .mcmeta file with provided data.@NotNull ModelRegisters a 3D or 2D item/block model asset.@NotNull ModelRegisters a model with provided raw data.@NotNull ModelRegisters a blank model with specific texture resolution hints.postEffect(String name, boolean autoLoad) Registers a post-processing effect asset (Shaders).postEffect(String name, byte[] data) Registers a post-processing effect with provided data.@NotNull Soundssounds()Registers the sounds.json registry for this namespace.@NotNull TextureRegisters a texture and attempts to load it from the plugin's JAR resources.@NotNull TextureRegisters a texture with optional raw byte data.waypointStyle(String name, boolean autoLoad) Registers a waypoints style asset (common in technical modding libraries).waypointStyle(String name, byte[] data) Registers a waypoint style with provided data.
-
Constructor Details
-
Namespace
Creates a new namespace.- Parameters:
namespace- The namespace string (ID).pack- The parent resource pack.
-
-
Method Details
-
atlas
-
atlas
-
coreShader
-
coreShader
-
coreShader
-
includeShader
-
includeShader
-
includeShader
-
texture
-
texture
Registers a texture with optional raw byte data.- Parameters:
path- The relative path to the texture.data- The raw PNG bytes; if null, the system attempts to load from the JAR.- Returns:
- The registered
Textureasset.
-
mcmeta
-
mcmeta
-
waypointStyle
Registers a waypoints style asset (common in technical modding libraries).- Parameters:
name- The style name.autoLoad- Load from JAR.- Returns:
- The registered
WaypointStyleasset.
-
waypointStyle
Registers a waypoint style with provided data.- Parameters:
name- Style name.data- Raw JSON bytes.- Returns:
- The registered
WaypointStyleasset.
-
postEffect
Registers a post-processing effect asset (Shaders).- Parameters:
name- Effect name.autoLoad- Load from JAR.- Returns:
- The registered
PostEffectasset.
-
postEffect
Registers a post-processing effect with provided data.- Parameters:
name- Effect name.data- Raw JSON bytes.- Returns:
- The registered
PostEffectasset.
-
font
-
font
-
model
-
model
-
model
-
blockstate
Registers a blockstate configuration asset.- Parameters:
name- Block ID.autoLoad- Load from JAR.- Returns:
- The registered
BlockStateasset.
-
blockstate
Registers a blockstate with provided data.- Parameters:
name- Block ID.data- Raw JSON bytes.- Returns:
- The registered
BlockStateasset.
-
lang
-
lang
-
sounds
-
itemDefinition
Registers anItemDefinitionasset from the plugin's JAR.- Parameters:
name- The item name.- Returns:
- The registered definition.
-
itemDefinition
Registers anItemDefinitionwith provided data.- Parameters:
name- The item name.data- Raw JSON bytes.- Returns:
- The registered definition.
-
itemDefinition
public ItemDefinition itemDefinition(@NotNull @NotNull String name, @NotNull @NotNull Selector selector) Programmatically registers an item definition using a selector.- Parameters:
name- Item name.selector- TheSelectordefining which model to show.- Returns:
- The registered definition.
-
itemDefinition
public ItemDefinition itemDefinition(@NotNull @NotNull String name, @NotNull @NotNull Selector selector, boolean handAnimationOnSwap) Programmatically registers an item definition with toggleable swap animation.- Parameters:
name- Item name.selector- Model selector.handAnimationOnSwap- If true, plays the "swing" animation when swapping to this item.- Returns:
- The registered definition.
-
itemDefinition
public ItemDefinition itemDefinition(@NotNull @NotNull String name, @NotNull @NotNull Selector selector, double swapAnimationScale) Programmatically registers an item definition with custom GUI animation scale.- Parameters:
name- Item name.selector- Model selector.swapAnimationScale- Scaling factor for the GUI movement on swap.- Returns:
- The registered definition.
-
itemDefinition
public ItemDefinition itemDefinition(@NotNull @NotNull String name, @NotNull @NotNull Selector selector, boolean handAnimationOnSwap, boolean oversizedInGui, double swapAnimationScale) The master method for programmatic item definitions.- Parameters:
name- Item name.selector- Model selector.handAnimationOnSwap- Swing animation toggle.oversizedInGui- Whether the item appears larger in inventories.swapAnimationScale- Animation speed/scale.- Returns:
- The registered definition.
-
equipment
-
equipment
-
json
-
icon
public void icon(byte[] data) Sets the icon for this Namespace to show in menus using raw image data.- Parameters:
data- The PNG bytes.
-
icon
public void icon()Autoloads the icon for this Namespace fromtextures/item/icon.png. -
emit
-
id
-
getPlugin
@NotNull public @NotNull org.bukkit.plugin.Plugin getPlugin()- Returns:
- The Bukkit
Pluginassociated with this namespace.
-
getNamespace
- Returns:
- The ID of this namespace.
-
getPack
- Returns:
- The parent
ResourcePack.
-
getIcon
-