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
Modifier and TypeFieldDescriptionstatic ModelEngineAPI
Access point for more specific methods.
Cry about it.protected BoneReaderManager
protected CompatibilityManager
protected ConfigManager
protected MountControllerRegistry
protected ModelGenerator
static final com.google.gson.Gson
Global Gson instance used across the entire plugin.protected InteractionTicker
protected KeyframeReaderRegistry
protected String
protected ModelRegistry
protected ModelTicker
protected MountPairManager
protected NMSHandler
protected org.bukkit.plugin.PluginManager
protected ScriptReaderRegistry
protected int
protected VFXTicker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
callEvent
(org.bukkit.event.Event event) Internal method.static ActiveModel
createActiveModel
(@NotNull ModelBlueprint blueprint) Create an instance ofActiveModel
from aModelBlueprint
.static ActiveModel
createActiveModel
(String modelId) Create an instance ofActiveModel
of this model ID.abstract ActiveModel
createActiveModelImpl
(ModelBlueprint blueprint) static Dummy
Create a newDummy
with a random UUID.
This is mainly used to spawn player-specific models.static Dummy
createDummy
(UUID uuid) Create a newDummy
with a specific UUID.
This is mainly used to spawn player-specific models.static ModeledEntity
createModeledEntity
(BaseEntity<?> base) Create a newModeledEntity
from a custom target.
Use this when your target is not a bukkit entity, or whenDummy
does not satisfy your need.static ModeledEntity
createModeledEntity
(org.bukkit.entity.Entity base) Create a newModeledEntity
from a bukkit entity.
For creating player disguise, usecreateModeledEntity(Player)
static ModeledEntity
createModeledEntity
(org.bukkit.entity.Player base) Create a newModeledEntity
from a bukkit player.
This is mainly used for disguises.abstract ModeledEntity
createModeledEntityImpl
(BaseEntity<?> base) static VFX
createVFX
(BaseEntity<?> entity) Create a newVFX
from a custom target.static VFX
createVFX
(org.bukkit.entity.Entity entity) Create a newVFX
from a bukkit entity.static VFX
createVFX
(org.bukkit.entity.Player player) Create a newVFX
from a bukkit player.abstract VFX
createVFXImpl
(BaseEntity<?> base) static ModelBlueprint
getBlueprint
(@NotNull String modelId) Obtain a blueprint of this model ID.
Do not modify the blueprint unless you know what you are doing!static ConfigManager
static MountControllerRegistry
static EntityHandler
static InteractionTicker
static KeyframeReaderRegistry
static ModeledEntity
getModeledEntity
(UUID uuid) Retrieve the instance ofModeledEntity
associated to this UUID.
For bukkit entities, this would be their entity UUID.
ForDummy
, this would be a random UUID generated on creation.static ModelTicker
static MountPairManager
static ModeledEntity
getMountPair
(UUID uuid) Get the model the passenger is riding on.static NetworkHandler
static ModeledEntity
getOrCreateModeledEntity
(org.bukkit.entity.Entity entity) Shorthand for getting theModeledEntity
of this entity, and create one if none was found.static MountController
getPlayerMountController
(UUID uuid) Get theMountController
used by the player passenger.static ScriptReaderRegistry
static VFXTicker
static WorldHandler
static boolean
isModeledEntity
(UUID uuid) Check if the UUID is associated with aModeledEntity
instance.static void
registerModeledEntity
(BaseEntity<?> base, ModeledEntity model) Register aBaseEntity
-ModeledEntity
pair.
The default implementation ofModeledEntity
registers itself.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.static void
removeModeledEntity
(UUID uuid) Manually unregister aModeledEntity
.
By default, theModeledEntity
would unregister itself whenModeledEntity.tick()
returns false.static void
unregisterMountedPair
(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, toString
Methods 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 newModeledEntity
from a bukkit entity.
For creating player disguise, usecreateModeledEntity(Player)
- Parameters:
base
- the owner of the modeled entity- Returns:
- a
ModeledEntity
instance owned by said entity
-
createModeledEntity
Create a newModeledEntity
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
Create a newModeledEntity
from a custom target.
Use this when your target is not a bukkit entity, or whenDummy
does not satisfy your need.- Parameters:
base
- the owner of the modeled entity- Returns:
- a
ModeledEntity
instance owned by said custom target
-
getModeledEntity
Retrieve the instance ofModeledEntity
associated 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
ModeledEntity
instance of this UUID, or null if no model is associated with it.
-
getOrCreateModeledEntity
Shorthand for getting theModeledEntity
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
Create an instance ofActiveModel
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
Create an instance ofActiveModel
from aModelBlueprint
.- Parameters:
blueprint
- blueprint of the model- Returns:
- an
ActiveModel
instance.
-
createVFX
Create a newVFX
from a bukkit entity.- Parameters:
entity
- carrier of the VFX (the entity becomes the VFX)- Returns:
- a
VFX
instance.
-
createVFX
Create a newVFX
from a bukkit player.- Parameters:
player
- carrier of the VFX (the player becomes the VFX)- Returns:
- a
VFX
instance.
-
createVFX
Create a newVFX
from a custom target.- Parameters:
entity
- carrier of the VFX (the target becomes the VFX)- Returns:
- a
VFX
instance.
-
registerModeledEntity
Register aBaseEntity
-ModeledEntity
pair.
The default implementation ofModeledEntity
registers itself. Hence, it is unnecessary register it manually.- Parameters:
base
- the owner of the modelmodel
- the model instance
-
removeModeledEntity
Manually unregister aModeledEntity
.
By default, theModeledEntity
would unregister itself whenModeledEntity.tick()
returns false.- Parameters:
uuid
- UUID of the owner of the model.
-
isModeledEntity
Check if the UUID is associated with aModeledEntity
instance.- 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
- theMountController
used byentity
to 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
ModeledEntity
ridden by the passenger, or null if the passenger is not riding on any models.
-
getPlayerMountController
Get theMountController
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
Create a newDummy
with a random UUID.
This is mainly used to spawn player-specific models.- Returns:
- the created instance of a
Dummy
-
createDummy
Create a newDummy
with a specific UUID.
This is mainly used to spawn player-specific models.- Returns:
- the created instance of a
Dummy
-
createModeledEntityImpl
-
createActiveModelImpl
-
createVFXImpl
-