Class AssetPack

java.lang.Object
com.hypixel.hytale.assetstore.AssetPack
All Implemented Interfaces:
Mod

public class AssetPack extends Object implements Mod
  • Constructor Details

  • Method Details

    • getName

      @Nonnull public String getName()
    • getRoot

      @Nonnull public Path getRoot()
    • getFileSystem

      @Nullable public FileSystem getFileSystem()
    • getManifest

      public PluginManifest getManifest()
      Specified by:
      getManifest in interface Mod
    • isImmutable

      public boolean isImmutable()
    • getPackLocation

      public Path getPackLocation()
    • getSource

      @Nonnull public AssetPack.PackSource getSource()
    • contains

      public boolean contains(@Nonnull Path path)
      Checks whether the given path is inside this pack. Safe to call with paths from other filesystems (returns false).
    • resolve

      @Nullable public Path resolve(@Nonnull Path relativePath)
      Resolves a relative path within this pack, preventing path traversal. Accepts paths from other filesystems, see PathUtil.resolvePathWithinDir(Path, Path).
      Returns:
      the resolved path, or null if the path would escape the pack
    • tryRelativize

      @Nullable public Path tryRelativize(@Nonnull Path path)
      Relativizes the given path against this pack's root.
      Returns:
      the pack-relative path, or null if the path is not inside this pack
    • existsOnDisk

      public boolean existsOnDisk()
      Checks whether the pack still exists on disk. Zip and jar backed packs are always considered present while their filesystem is open.
    • isCoreMod

      public boolean isCoreMod()
      Specified by:
      isCoreMod in interface Mod
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object