Class ResourcePack
java.lang.Object
com.github.darksoulq.abyssallib.server.resource.ResourcePack
Handles creation, namespacing, and compilation of a resource pack.
Output is written to a ZIP at
pluginFolder/pack/output.zip.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResourcePack(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull String pluginId) Creates a new resource pack instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcompile(boolean override) Compiles and zips the pack contents asynchronously.@NotNull Collection<Namespace> @NotNull Path@NotNull org.bukkit.plugin.Pluginvoidicon()Autoloads the Icon for this pack fromresourcepack/pack.pngvoidicon(byte[] data) Sets the Icon for the pack.voidmcmeta(PackMcMeta mcmeta) Sets the pack.mcmeta of this resourcepack@NotNull NamespaceReturns or creates a namespace container.voidregister(boolean override) Compiles and registers the pack for sending to players.voidResends pack to either a list of players or whole server depending on argument Resends to everyone if RSPM is being used instead of builtin servervoid
-
Field Details
-
EXTERNAL_CACHE
-
UUID_MAP
-
HASH_MAP
-
-
Constructor Details
-
ResourcePack
public ResourcePack(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull String pluginId) Creates a new resource pack instance.- Parameters:
plugin- Owning pluginpluginId- The modid
-
-
Method Details
-
namespace
-
icon
public void icon(byte[] data) Sets the Icon for the pack.- Parameters:
data- The icon image data
-
icon
public void icon()Autoloads the Icon for this pack fromresourcepack/pack.png -
mcmeta
Sets the pack.mcmeta of this resourcepack- Parameters:
mcmeta- The PackMcMeta instance
-
getNamespaces
- Returns:
- All namespaces in this pack
-
getOutputFile
- Returns:
- Final path to the compiled ZIP
-
getPlugin
@NotNull public @NotNull org.bukkit.plugin.Plugin getPlugin()- Returns:
- Owning plugin
-
compile
public void compile(boolean override) Compiles and zips the pack contents asynchronously.- Parameters:
override- whether to generate zip if it has been generated before
-
register
public void register(boolean override) Compiles and registers the pack for sending to players.- Parameters:
override- whether to generate zip if it has been generated before.
-
unregister
public void unregister() -
resend
Resends pack to either a list of players or whole server depending on argument Resends to everyone if RSPM is being used instead of builtin server- Parameters:
players- The players to send to, or null if to whole server
-