Class ModelEngineAPI

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
com.ticxo.modelengine.api.ModelEngineAPI
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

public abstract class ModelEngineAPI extends org.bukkit.plugin.java.JavaPlugin
  • Field Details

  • Constructor Details

    • ModelEngineAPI

      public ModelEngineAPI()
  • Method Details

    • callEvent

      public static void callEvent(org.bukkit.event.Event event)
      Internal method. Do no use.
      Parameters:
      event -
    • getConfigManager

      public static ConfigManager getConfigManager()
      Returns:
      an existing instance of ConfigManager
    • getEntityHandler

      public static EntityHandler getEntityHandler()
      Returns:
      an existing instance of EntityHandler
    • getWorldHandler

      public static WorldHandler getWorldHandler()
      Returns:
      an existing instance of WorldHandler
    • getNetworkHandler

      public static NetworkHandler getNetworkHandler()
      Returns:
      an existing instance of NetworkHandler
    • getModelTicker

      public static ModelTicker getModelTicker()
      Returns:
      an existing instance of ModelTicker
    • getVFXTicker

      public static VFXTicker getVFXTicker()
      Returns:
      an existing instance of VFXTicker
    • getControllerRegistry

      public static MountControllerRegistry getControllerRegistry()
      Returns:
      an existing instance of MountControllerRegistry
    • getMountManager

      public static MountPairManager getMountManager()
      Returns:
      an existing instance of MountPairManager
    • getKeyframeReaderRegistry

      public static KeyframeReaderRegistry getKeyframeReaderRegistry()
    • getScriptReaderRegistry

      public static ScriptReaderRegistry getScriptReaderRegistry()
    • getInteractionTicker

      public static InteractionTicker getInteractionTicker()
    • createModeledEntity

      public static ModeledEntity createModeledEntity(org.bukkit.entity.Entity base)
      Create a new ModeledEntity from a bukkit entity.
      For creating player disguise, use createModeledEntity(Player)
      Parameters:
      base - the owner of the modeled entity
      Returns:
      a ModeledEntity instance owned by said entity
    • createModeledEntity

      public static ModeledEntity createModeledEntity(org.bukkit.entity.Player base)
      Create a new ModeledEntity from a bukkit player.
      This is mainly used for disguises.
      Parameters:
      base - the owner of the modeled entity
      Returns:
      a ModeledEntity instance owned by said player
    • createModeledEntity

      public static ModeledEntity createModeledEntity(BaseEntity<?> base)
      Create a new ModeledEntity from a custom target.
      Use this when your target is not a bukkit entity, or when Dummy does not satisfy your need.
      Parameters:
      base - the owner of the modeled entity
      Returns:
      a ModeledEntity instance owned by said custom target
    • getModeledEntity

      public static ModeledEntity getModeledEntity(UUID uuid)
      Retrieve the instance of ModeledEntity associated to this UUID.
      For bukkit entities, this would be their entity UUID.
      For Dummy, this would be a random UUID generated on creation. Use BaseEntity.getUniqueId() to retrieve the UUID.
      Parameters:
      uuid - the UUID of the model owner.
      Returns:
      the ModeledEntity instance of this UUID, or null if no model is associated with it.
    • getOrCreateModeledEntity

      public static ModeledEntity getOrCreateModeledEntity(org.bukkit.entity.Entity entity)
      Shorthand for getting the ModeledEntity of this entity, and create one if none was found.
      Parameters:
      entity - owner of the modeled entity
      Returns:
      a ModeledEntity instance owned by said entity.
    • createActiveModel

      public static ActiveModel createActiveModel(String modelId)
      Create an instance of ActiveModel of this model ID.
      Parameters:
      modelId - model ID of the model (case-insensitive)
      Returns:
      an ActiveModel instance, or null if the model does not exist.
    • createActiveModel

      public static ActiveModel createActiveModel(@NotNull @NotNull ModelBlueprint blueprint)
      Create an instance of ActiveModel from a ModelBlueprint.
      Parameters:
      blueprint - blueprint of the model
      Returns:
      an ActiveModel instance.
    • createVFX

      public static VFX createVFX(org.bukkit.entity.Entity entity)
      Create a new VFX from a bukkit entity.
      Parameters:
      entity - carrier of the VFX (the entity becomes the VFX)
      Returns:
      a VFX instance.
    • createVFX

      public static VFX createVFX(org.bukkit.entity.Player player)
      Create a new VFX from a bukkit player.
      Parameters:
      player - carrier of the VFX (the player becomes the VFX)
      Returns:
      a VFX instance.
    • createVFX

      public static VFX createVFX(BaseEntity<?> entity)
      Create a new VFX from a custom target.
      Parameters:
      entity - carrier of the VFX (the target becomes the VFX)
      Returns:
      a VFX instance.
    • registerModeledEntity

      public static void registerModeledEntity(BaseEntity<?> base, ModeledEntity model)
      Register a BaseEntity-ModeledEntity pair.
      The default implementation of ModeledEntity registers itself. Hence, it is unnecessary register it manually.
      Parameters:
      base - the owner of the model
      model - the model instance
    • removeModeledEntity

      public static void removeModeledEntity(UUID uuid)
      Manually unregister a ModeledEntity.
      By default, the ModeledEntity would unregister itself when ModeledEntity.tick() returns false.
      Parameters:
      uuid - UUID of the owner of the model.
    • isModeledEntity

      public static boolean isModeledEntity(UUID uuid)
      Check if the UUID is associated with a ModeledEntity instance.
      Parameters:
      uuid - UUID of a potential owner with a model associated.
      Returns:
      true if it is associated.
    • getBlueprint

      public static ModelBlueprint getBlueprint(@NotNull @NotNull String modelId)
      Obtain a blueprint of this model ID.
      Do not modify the blueprint unless you know what you are doing!
      Parameters:
      modelId - model ID of the model blueprint (case-insensitive)
      Returns:
      the blueprint of the model of this ID, or null if no model is registered under this ID.
    • registerMountedPair

      public static void registerMountedPair(org.bukkit.entity.Entity entity, ModeledEntity model, MountController controller)
      Register a passenger-vehicle pair.
      A vehicle can have multiple passengers, but a passenger can only have one vehicle.
      Parameters:
      entity - driver or passenger
      model - vehicle
      controller - the MountController used by entity to control model.
    • unregisterMountedPair

      public static void unregisterMountedPair(UUID uuid)
      Unregister a passenger-vehicle pair.
      Parameters:
      uuid - UUID of the passenger.
    • getMountPair

      public static ModeledEntity getMountPair(UUID uuid)
      Get the model the passenger is riding on.
      Parameters:
      uuid - UUID of the passenger.
      Returns:
      the ModeledEntity ridden by the passenger, or null if the passenger is not riding on any models.
    • getPlayerMountController

      public static MountController getPlayerMountController(UUID uuid)
      Get the MountController used by the player passenger.
      Parameters:
      uuid - UUID of a player passenger.
      Returns:
      the MountController of the player, or null if the player is either not using a controller or not riding on a model.
    • createDummy

      public static Dummy createDummy()
      Create a new Dummy with a random UUID.
      This is mainly used to spawn player-specific models.
      Returns:
      the created instance of a Dummy
    • createDummy

      public static Dummy createDummy(UUID uuid)
      Create a new Dummy with a specific UUID.
      This is mainly used to spawn player-specific models.
      Returns:
      the created instance of a Dummy
    • createModeledEntityImpl

      public abstract ModeledEntity createModeledEntityImpl(BaseEntity<?> base)
    • createActiveModelImpl

      public abstract ActiveModel createActiveModelImpl(ModelBlueprint blueprint)
    • createVFXImpl

      public abstract VFX createVFXImpl(BaseEntity<?> base)