T
- - type of Entitypublic class CommonEntity<T extends org.bukkit.entity.Entity> extends ExtendedEntity<T>
entity, handle, last, loc, MIN_MOVE_SPEED, vel
Constructor and Description |
---|
CommonEntity(T entity) |
Modifier and Type | Method and Description |
---|---|
static void |
clearControllers(org.bukkit.entity.Entity entity)
Clears possible network or Entity controllers from the Entity.
|
static CommonEntity |
create(org.bukkit.entity.EntityType entityType,
org.bukkit.Location location)
Creates a new Entity instance by calling its default World constructor, and initialized position.
|
static CommonEntity |
createNull(org.bukkit.entity.EntityType entityType)
Creates a new Entity instance without validly constructing it.
|
void |
doPostTick()
Performs all the logic normally performed after ticking a single Entity.
|
static CommonItem |
get(org.bukkit.entity.Item item)
Obtains a (new)
CommonItem instance providing additional methods
for the Item specified. |
static CommonPlayer |
get(org.bukkit.entity.Player player)
Obtains a (new)
CommonPlayer instance providing additional
methods for the Player specified. |
static <T extends org.bukkit.entity.Entity> |
get(T entity)
Obtains a (new)
CommonEntity instance providing additional
methods for the Entity specified. |
static <T extends org.bukkit.entity.LivingEntity,C extends CommonLivingEntity<? extends T>> |
get(T livingEntity)
Obtains a (new)
CommonLivingEntity instance providing additional
methods for the Living Entity specified. |
static <T extends org.bukkit.entity.Entity,C extends CommonEntity<? extends T>> |
get(T entity,
Class<C> type)
Obtains a (new)
CommonEntity instance providing additional
methods for the Entity specified. |
EntityController<CommonEntity<T>> |
getController()
Gets the Entity Controller currently assigned to this Entity.
|
<C extends EntityController<?>> |
getController(Class<? extends C> controllerType)
Gets the Entity Controller currently assigned to this Entity, checking to make sure
the controller is of a certain Class type.
|
EntityNetworkController<CommonEntity<T>> |
getNetworkController()
Gets the Entity Network Controller currently assigned to this Entity.
|
boolean |
hasControllerSupport()
Checks whether this particular Entity supports the use of Entity
Controllers.
|
protected boolean |
isHooked()
Checks whether the Entity is a BKCommonLib hook
|
protected void |
prepareHook()
Replaces the current entity, if needed, with the BKCommonLib Hook entity
type
|
void |
setController(EntityController controller)
Sets an Entity Controller for this Entity.
|
void |
setNetworkController(EntityNetworkController controller)
Sets an Entity Network Controller for this Entity.
|
static CommonEntity |
spawn(org.bukkit.entity.EntityType entityType,
org.bukkit.Location location,
EntityController controller,
EntityNetworkController networkController)
Creates a new Entity and spawns it at the Location and using the controllers
specified.
|
boolean |
teleport(org.bukkit.Location location,
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) |
addPassenger, eject, equals, getAllowTeleportation, getChunkX, getChunkY, getChunkZ, getDataItem, getDataWatcher, getEntity, getEntityId, getFallDistance, getFireTicks, getHandle, getHandle, getHeadRotation, getHeight, getLastDamageCause, getLastLocation, getLastLocation, getLeashHolder, getLength, getLocation, getLocation, getMaxFireTicks, getMetaData, getMetadata, getMovedDistance, getMovedDistanceSquared, getMovedX, getMovedXZDistance, getMovedXZDistanceSquared, getMovedY, getMovedZ, getNearbyEntities, getNearbyEntities, getPassenger, getPassengers, getPlayerPassenger, getPlayerPassengers, getPortalCooldown, getPortalCooldownMaximum, getRandom, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hashCode, hasMetadata, hasMoved, hasMovedHorizontally, hasMovedVertically, hasPassenger, hasPlayerPassenger, isDead, isEmpty, isInLoadedChunk, isInsideVehicle, isInWater, isInWater, isMovementImpaired, isMoving, isMovingHorizontally, isMovingVertically, isOnGround, isPassenger, isPositionChanged, isPreventBlockPlace, isSpawned, isValid, isVehicle, isVelocityChanged, leaveVehicle, makeRandomSound, makeRandomSound, makeSound, makeSound, makeSound, makeStepSound, makeStepSound, playEffect, read, remove, removeMetadata, removePassenger, sendPacketNearby, setAllowTeleportation, setChunkX, setChunkY, setChunkZ, setDead, setEntity, setFallDistance, setFireTicks, setFootLocation, setLastDamageCause, setLocation, setMetadata, setMovementImpaired, setOnGround, setPassenger, setPassengerSilent, setPassengersSilent, setPortalCooldown, setPosition, setPositionChanged, setPreventBlockPlace, setRotation, setSize, setTicksLived, setVelocity, setVelocity, setVelocityChanged, setWorld, spawnItemDrop, spawnItemDrop, teleport, teleport, teleport, toString, write
public CommonEntity(T entity)
public EntityNetworkController<CommonEntity<T>> getNetworkController()
DefaultEntityNetworkController
instance.public void setNetworkController(EntityNetworkController controller)
DefaultEntityNetworkController
instance.controller
- to set topublic <C extends EntityController<?>> C getController(Class<? extends C> controllerType)
getController()
by not instantiating a new
default controller when no controller is set.controllerType
- to getpublic EntityController<CommonEntity<T>> getController()
DefaultEntityController
instance.public void setController(EntityController controller)
controller
- to set topublic boolean hasControllerSupport()
setController(EntityController)
can be used.protected boolean isHooked()
protected void prepareHook()
public void doPostTick()
public boolean teleport(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause)
teleport
in class ExtendedEntity<T extends org.bukkit.entity.Entity>
public static final CommonEntity spawn(org.bukkit.entity.EntityType entityType, org.bukkit.Location location, EntityController controller, EntityNetworkController networkController)
entityType
- to spawnlocation
- to spawn atcontroller
- to assign to the Entity after spawningnetworkController
- to assign to the Entity after spawning#spawn(Location)
public static final CommonEntity create(org.bukkit.entity.EntityType entityType, org.bukkit.Location location)
#spawn()
this does not spawn the entity in the world, and it will stay detached.entityType
- to createlocation
- of the entitypublic static final CommonEntity createNull(org.bukkit.entity.EntityType entityType)
entityType
- type to createpublic static CommonItem get(org.bukkit.entity.Item item)
CommonItem
instance providing additional methods
for the Item specified. This method never returns null, unless the input
Entity is null.item
- to get a CommonItem forpublic static CommonPlayer get(org.bukkit.entity.Player player)
CommonPlayer
instance providing additional
methods for the Player specified. This method never returns null, unless
the input Entity is null.player
- to get a CommonPlayer forpublic static <T extends org.bukkit.entity.LivingEntity,C extends CommonLivingEntity<? extends T>> C get(T livingEntity)
CommonLivingEntity
instance providing additional
methods for the Living Entity specified. This method never returns null,
unless the input Entity is null.livingEntity
- to get a CommonLivingEntity forpublic static <T extends org.bukkit.entity.Entity,C extends CommonEntity<? extends T>> C get(T entity, Class<C> type)
CommonEntity
instance providing additional
methods for the Entity specified. A specific CommonEntity extension that
best fits the input Entity can be requested using this method. This
method never returns null, unless the input Entity is null.entity
- to get a CommonEntity fortype
- of CommonEntity to getpublic static <T extends org.bukkit.entity.Entity> CommonEntity<T> get(T entity)
CommonEntity
instance providing additional
methods for the Entity specified. This method never returns null, unless
the input Entity is null.entity
- to get a CommonEntity forpublic static void clearControllers(org.bukkit.entity.Entity entity)
entity
- to clear the controllers ofCopyright © 2019. All rights reserved.