Package com.ticxo.modelengine.api
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 Summary
FieldsModifier and TypeFieldDescriptionstatic ModelEngineAPIAccess point for more specific methods.
Cry about it.protected BoneReaderManagerprotected CompatibilityManagerprotected ConfigManagerprotected MountControllerRegistryprotected ModelGeneratorstatic final com.google.gson.GsonGlobal Gson instance used across the entire plugin.protected InteractionTickerprotected KeyframeReaderRegistryprotected Stringprotected ModelRegistryprotected ModelTickerprotected MountPairManagerprotected NMSHandlerprotected org.bukkit.plugin.PluginManagerprotected ScriptReaderRegistryprotected intprotected VFXTicker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcallEvent(org.bukkit.event.Event event) Internal method.static ActiveModelcreateActiveModel(@NotNull ModelBlueprint blueprint) Create an instance ofActiveModelfrom aModelBlueprint.static ActiveModelcreateActiveModel(String modelId) Create an instance ofActiveModelof this model ID.abstract ActiveModelcreateActiveModelImpl(ModelBlueprint blueprint) static DummyCreate a newDummywith a random UUID.
This is mainly used to spawn player-specific models.static DummycreateDummy(UUID uuid) Create a newDummywith a specific UUID.
This is mainly used to spawn player-specific models.static ModeledEntitycreateModeledEntity(BaseEntity<?> base) Create a newModeledEntityfrom a custom target.
Use this when your target is not a bukkit entity, or whenDummydoes not satisfy your need.static ModeledEntitycreateModeledEntity(org.bukkit.entity.Entity base) Create a newModeledEntityfrom a bukkit entity.
For creating player disguise, usecreateModeledEntity(Player)static ModeledEntitycreateModeledEntity(org.bukkit.entity.Player base) Create a newModeledEntityfrom a bukkit player.
This is mainly used for disguises.abstract ModeledEntitycreateModeledEntityImpl(BaseEntity<?> base) static VFXcreateVFX(BaseEntity<?> entity) Create a newVFXfrom a custom target.static VFXcreateVFX(org.bukkit.entity.Entity entity) Create a newVFXfrom a bukkit entity.static VFXcreateVFX(org.bukkit.entity.Player player) Create a newVFXfrom a bukkit player.abstract VFXcreateVFXImpl(BaseEntity<?> base) static ModelBlueprintgetBlueprint(@NotNull String modelId) Obtain a blueprint of this model ID.
Do not modify the blueprint unless you know what you are doing!static ConfigManagerstatic MountControllerRegistrystatic EntityHandlerstatic InteractionTickerstatic KeyframeReaderRegistrystatic ModeledEntitygetModeledEntity(UUID uuid) Retrieve the instance ofModeledEntityassociated to this UUID.
For bukkit entities, this would be their entity UUID.
ForDummy, this would be a random UUID generated on creation.static ModelTickerstatic MountPairManagerstatic ModeledEntitygetMountPair(UUID uuid) Get the model the passenger is riding on.static NetworkHandlerstatic ModeledEntitygetOrCreateModeledEntity(org.bukkit.entity.Entity entity) Shorthand for getting theModeledEntityof this entity, and create one if none was found.static MountControllergetPlayerMountController(UUID uuid) Get theMountControllerused by the player passenger.static ScriptReaderRegistrystatic VFXTickerstatic WorldHandlerstatic booleanisModeledEntity(UUID uuid) Check if the UUID is associated with aModeledEntityinstance.static voidregisterModeledEntity(BaseEntity<?> base, ModeledEntity model) Register aBaseEntity-ModeledEntitypair.
The default implementation ofModeledEntityregisters itself.static voidregisterMountedPair(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.static voidremoveModeledEntity(UUID uuid) Manually unregister aModeledEntity.
By default, theModeledEntitywould unregister itself whenModeledEntity.tick()returns false.static voidunregisterMountedPair(UUID uuid) Unregister a passenger-vehicle pair.Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onDisable, onEnable, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode
-
Field Details
-
api
Access point for more specific methods.
Cry about it. -
gson
public static final com.google.gson.Gson gsonGlobal Gson instance used across the entire plugin. -
minecraftVersion
-
versionNumber
protected int versionNumber -
pluginManager
protected org.bukkit.plugin.PluginManager pluginManager -
compatibilityManager
-
configManager
-
modelRegistry
-
generator
-
boneReader
-
modelTicker
-
vfxTicker
-
controllerRegistry
-
mountManager
-
keyframeReaderRegistry
-
scriptReaderRegistry
-
nms
-
interactionTicker
-
-
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
- Returns:
- an existing instance of
ConfigManager
-
getEntityHandler
- Returns:
- an existing instance of
EntityHandler
-
getWorldHandler
- Returns:
- an existing instance of
WorldHandler
-
getNetworkHandler
- Returns:
- an existing instance of
NetworkHandler
-
getModelTicker
- Returns:
- an existing instance of
ModelTicker
-
getVFXTicker
- Returns:
- an existing instance of
VFXTicker
-
getControllerRegistry
- Returns:
- an existing instance of
MountControllerRegistry
-
getMountManager
- Returns:
- an existing instance of
MountPairManager
-
getKeyframeReaderRegistry
-
getScriptReaderRegistry
-
getInteractionTicker
-
createModeledEntity
Create a newModeledEntityfrom a bukkit entity.
For creating player disguise, usecreateModeledEntity(Player)- Parameters:
base- the owner of the modeled entity- Returns:
- a
ModeledEntityinstance owned by said entity
-
createModeledEntity
Create a newModeledEntityfrom a bukkit player.
This is mainly used for disguises.- Parameters:
base- the owner of the modeled entity- Returns:
- a
ModeledEntityinstance owned by said player
-
createModeledEntity
Create a newModeledEntityfrom a custom target.
Use this when your target is not a bukkit entity, or whenDummydoes not satisfy your need.- Parameters:
base- the owner of the modeled entity- Returns:
- a
ModeledEntityinstance owned by said custom target
-
getModeledEntity
Retrieve the instance ofModeledEntityassociated to this UUID.
For bukkit entities, this would be their entity UUID.
ForDummy, this would be a random UUID generated on creation. UseBaseEntity.getUniqueId()to retrieve the UUID.- Parameters:
uuid- the UUID of the model owner.- Returns:
- the
ModeledEntityinstance of this UUID, or null if no model is associated with it.
-
getOrCreateModeledEntity
Shorthand for getting theModeledEntityof this entity, and create one if none was found.- Parameters:
entity- owner of the modeled entity- Returns:
- a
ModeledEntityinstance owned by said entity.
-
createActiveModel
Create an instance ofActiveModelof this model ID.- Parameters:
modelId- model ID of the model (case-insensitive)- Returns:
- an
ActiveModelinstance, or null if the model does not exist.
-
createActiveModel
Create an instance ofActiveModelfrom aModelBlueprint.- Parameters:
blueprint- blueprint of the model- Returns:
- an
ActiveModelinstance.
-
createVFX
Create a newVFXfrom a bukkit entity.- Parameters:
entity- carrier of the VFX (the entity becomes the VFX)- Returns:
- a
VFXinstance.
-
createVFX
Create a newVFXfrom a bukkit player.- Parameters:
player- carrier of the VFX (the player becomes the VFX)- Returns:
- a
VFXinstance.
-
createVFX
Create a newVFXfrom a custom target.- Parameters:
entity- carrier of the VFX (the target becomes the VFX)- Returns:
- a
VFXinstance.
-
registerModeledEntity
Register aBaseEntity-ModeledEntitypair.
The default implementation ofModeledEntityregisters itself. Hence, it is unnecessary register it manually.- Parameters:
base- the owner of the modelmodel- the model instance
-
removeModeledEntity
Manually unregister aModeledEntity.
By default, theModeledEntitywould unregister itself whenModeledEntity.tick()returns false.- Parameters:
uuid- UUID of the owner of the model.
-
isModeledEntity
Check if the UUID is associated with aModeledEntityinstance.- Parameters:
uuid- UUID of a potential owner with a model associated.- Returns:
- true if it is associated.
-
getBlueprint
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 passengermodel- vehiclecontroller- theMountControllerused byentityto controlmodel.
-
unregisterMountedPair
Unregister a passenger-vehicle pair.- Parameters:
uuid- UUID of the passenger.
-
getMountPair
Get the model the passenger is riding on.- Parameters:
uuid- UUID of the passenger.- Returns:
- the
ModeledEntityridden by the passenger, or null if the passenger is not riding on any models.
-
getPlayerMountController
Get theMountControllerused by the player passenger.- Parameters:
uuid- UUID of a player passenger.- Returns:
- the
MountControllerof the player, or null if the player is either not using a controller or not riding on a model.
-
createDummy
Create a newDummywith a random UUID.
This is mainly used to spawn player-specific models.- Returns:
- the created instance of a
Dummy
-
createDummy
Create a newDummywith a specific UUID.
This is mainly used to spawn player-specific models.- Returns:
- the created instance of a
Dummy
-
createModeledEntityImpl
-
createActiveModelImpl
-
createVFXImpl
-