Class PluginBase

java.lang.Object
com.hypixel.hytale.server.core.plugin.PluginBase
All Implemented Interfaces:
CommandOwner
Direct Known Subclasses:
JavaPlugin

public abstract class PluginBase extends Object implements CommandOwner
Represents a single plugin instance, extended by specific plugin types
  • Field Details

    • METRICS_REGISTRY

      @Nonnull public static final MetricsRegistry<PluginBase> METRICS_REGISTRY
      Metrics specifically associated with plugins

      We don't include configs to avoid dumping possibly sensitive config, plugin makers can always add support themselves

  • Constructor Details

    • PluginBase

      public PluginBase(@Nonnull PluginInit init)
      Default Constructor for a PluginBase instance
      Parameters:
      init - The plugin initialization step for this plugin
  • Method Details

    • preLoad

      @Nullable public CompletableFuture<Void> preLoad()
    • getName

      @Nonnull public String getName()
      Specified by:
      getName in interface CommandOwner
    • getLogger

      @Nonnull public HytaleLogger getLogger()
      Returns:
      the logger associated with this plugin
    • getIdentifier

      @Nonnull public PluginIdentifier getIdentifier()
      Returns:
      the identifier for this plugin
    • getManifest

      @Nonnull public PluginManifest getManifest()
      Returns:
      the manifest for this plugin
    • getDataDirectory

      @Nonnull public Path getDataDirectory()
      Returns:
      The data folder path for this plugin
    • getState

      @Nonnull public PluginState getState()
      Returns:
      The current state of this plugin
    • getClientFeatureRegistry

      @Nonnull public ClientFeatureRegistry getClientFeatureRegistry()
      Returns:
      the client feature registry for this plugin
    • getCommandRegistry

      @Nonnull public CommandRegistry getCommandRegistry()
      Returns:
      the command registry for this plugin
    • getEventRegistry

      @Nonnull public EventRegistry getEventRegistry()
      Returns:
      the event registry for this plugin
    • getEntityRegistry

      @Nonnull public EntityRegistry getEntityRegistry()
      Returns:
      The entity registry for this plugin
    • getTaskRegistry

      @Nonnull public TaskRegistry getTaskRegistry()
      Returns:
      the task registry for this plugin
    • getEntityStoreRegistry

      @Nonnull public ComponentRegistryProxy<EntityStore> getEntityStoreRegistry()
      Returns:
      the entity store component registry proxy for this plugin
    • getChunkStoreRegistry

      @Nonnull public ComponentRegistryProxy<ChunkStore> getChunkStoreRegistry()
      Returns:
      the chunk store component registry for this plugin
    • getAssetRegistry

      @Nonnull public AssetRegistry getAssetRegistry()
      Returns:
      The asset registry for this plugin
    • getCodecRegistry

      @Nonnull public <T, C extends Codec<? extends T>> CodecMapRegistry<T,C> getCodecRegistry(@Nonnull StringCodecMapCodec<T,C> mapCodec)
      Returns the codec registry for the given string codec from this plugin
      Type Parameters:
      T - The codec type
      C - The codec type
      Parameters:
      mapCodec - The map registry to return
      Returns:
      the affiliated codec registry
    • getCodecRegistry

      @Nonnull public <K, T extends JsonAsset<K>> CodecMapRegistry.Assets<T,?> getCodecRegistry(@Nonnull AssetCodecMapCodec<K,T> mapCodec)
      Returns the codec registry for the given asset codec from this plugin
      Type Parameters:
      K - The codec type
      T - The Json asset type
      Parameters:
      mapCodec - The map registry to return
      Returns:
      the affiliated codec registry
    • getCodecRegistry

      @Nonnull public <V> MapKeyMapRegistry<V> getCodecRegistry(@Nonnull MapKeyMapCodec<V> mapCodec)
      Returns the codec registry for the given map key codec from this plugin
      Type Parameters:
      V - The codec type
      Parameters:
      mapCodec - The map registry to return
      Returns:
      the affiliated codec registry
    • getBasePermission

      @Nonnull public final String getBasePermission()
      Returns:
      the base permission for this plugin
    • isDisabled

      public boolean isDisabled()
      Returns:
      true if this plugin is in a disabled state, false otherwise
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if this plugin is in an enabled state, false otherwise
    • getType

      @Nonnull public abstract PluginType getType()
      Returns:
      the plugin type for this plugin