Package com.ticxo.modelengine.api.entity
Class BukkitPlayer
java.lang.Object
com.ticxo.modelengine.api.entity.BukkitPlayer
- All Implemented Interfaces:
BaseEntity<org.bukkit.entity.Player>
Default implementation of
This is mainly used for players to disguise themselves as a model.
BaseEntity
to wrap the default bukkit's Player
class.This is mainly used for players to disguise themselves as a model.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when the target becomes invisible.
For bukkit entities and players, useEntityHandler.broadcastDespawnPacket(BaseEntity, boolean)
void
Called when the target becomes visible again.
For bukkit entities and players, useEntityHandler.broadcastSpawnPacket(BaseEntity, boolean)
int
Get the entity ID of this entity.
If the target is not a bukkit entity, you have to be absolutely sure that this ID does not overlap with an existing entity, as it is used to identify interactions between models.
UseEntityHandler.getEntityCounter()
to generate unique integer ID if you are unsure.org.bukkit.inventory.ItemStack
getItemInSlot
(org.bukkit.inventory.EquipmentSlot slot) org.bukkit.Location
Get the location of this entity.List<org.bukkit.entity.Entity>
Get the UUID of this entity.
This UUID is used to retrieve the instance ofModeledEntity
associated with this entity.org.bukkit.World
getWorld()
Get the world of this entity.float
float
float
boolean
isDead()
boolean
boolean
isMoving()
boolean
boolean
onHurt
(IDamageSource damageSource, float damage) Called when a sub-hitbox of this entity detects an attack.
For default bukkit behavior, useEntityHandler.hurt(Entity, IDamageSource, float)
.void
onInteract
(org.bukkit.entity.Player player, org.bukkit.inventory.EquipmentSlot hand) Called when a sub-hitbox of this entity detects an interaction.
For default bukkit behavior, useEntityHandler.interact(Entity, Player, EquipmentSlot)
.void
setCollidableToLiving
(org.bukkit.entity.LivingEntity living, boolean isRemove) Configure whether the targeted living entity can collide with this entityvoid
Set the hitbox of this entity.
For bukkit entities, useEntityHandler.setHitbox(Entity, Hitbox)
.void
setStepHeight
(double height) Set the step height of this entity.
For bukkit entities, useEntityHandler.setStepHeight(Entity, double)
void
setYBodyRot
(float rot) void
setYHeadRot
(float rot) Create a wrapper for the body rotation control of this entity.
For bukkit entities, wrap withEntityHandler.wrapBodyRotationControl(Entity)
.Create a wrapper for the look control of this entity.
For bukkit entities, wrap withEntityHandler.wrapLookControl(Entity)
.Create a wrapper for the movement control of this entity.
For bukkit entities, wrap withEntityHandler.wrapMoveControl(Entity)
.void
Patch Minecraft's faulty pathfinding to accept different hitbox sizes.
For bukkit entities, wrap withEntityHandler.wrapNavigation(Entity)
.wrapRangeManager
(IModel model) Create a wrapper for the render range manager of this entity.
For bukkit entities, wrap withEntityHandler.wrapRangeManager(Entity)
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ticxo.modelengine.api.entity.BaseEntity
getHitbox, getModelHitbox, getOriginal, getRangeManager, getStepHeight
-
Constructor Details
-
BukkitPlayer
public BukkitPlayer(@NotNull @NotNull org.bukkit.entity.Player entity)
-
-
Method Details
-
wrapMoveControl
Description copied from interface:BaseEntity
Create a wrapper for the movement control of this entity.
For bukkit entities, wrap withEntityHandler.wrapMoveControl(Entity)
.- Specified by:
wrapMoveControl
in interfaceBaseEntity<org.bukkit.entity.Player>
-
wrapLookControl
Description copied from interface:BaseEntity
Create a wrapper for the look control of this entity.
For bukkit entities, wrap withEntityHandler.wrapLookControl(Entity)
.- Specified by:
wrapLookControl
in interfaceBaseEntity<org.bukkit.entity.Player>
-
wrapBodyRotationControl
Description copied from interface:BaseEntity
Create a wrapper for the body rotation control of this entity.
For bukkit entities, wrap withEntityHandler.wrapBodyRotationControl(Entity)
.- Specified by:
wrapBodyRotationControl
in interfaceBaseEntity<org.bukkit.entity.Player>
-
wrapRangeManager
Description copied from interface:BaseEntity
Create a wrapper for the render range manager of this entity.
For bukkit entities, wrap withEntityHandler.wrapRangeManager(Entity)
.- Specified by:
wrapRangeManager
in interfaceBaseEntity<org.bukkit.entity.Player>
-
onHurt
Description copied from interface:BaseEntity
Called when a sub-hitbox of this entity detects an attack.
For default bukkit behavior, useEntityHandler.hurt(Entity, IDamageSource, float)
.- Specified by:
onHurt
in interfaceBaseEntity<org.bukkit.entity.Player>
- Parameters:
damageSource
- the damage source of this attackdamage
- raw damage before reduction- Returns:
- false to cancel the attack.
-
onInteract
public void onInteract(org.bukkit.entity.Player player, org.bukkit.inventory.EquipmentSlot hand) Description copied from interface:BaseEntity
Called when a sub-hitbox of this entity detects an interaction.
For default bukkit behavior, useEntityHandler.interact(Entity, Player, EquipmentSlot)
.- Specified by:
onInteract
in interfaceBaseEntity<org.bukkit.entity.Player>
- Parameters:
player
- the triggerhand
- hand used to interact
-
setHitbox
Description copied from interface:BaseEntity
Set the hitbox of this entity.
For bukkit entities, useEntityHandler.setHitbox(Entity, Hitbox)
.- Specified by:
setHitbox
in interfaceBaseEntity<org.bukkit.entity.Player>
-
setStepHeight
public void setStepHeight(double height) Description copied from interface:BaseEntity
Set the step height of this entity.
For bukkit entities, useEntityHandler.setStepHeight(Entity, double)
- Specified by:
setStepHeight
in interfaceBaseEntity<org.bukkit.entity.Player>
- Parameters:
height
- height in blocks
-
setCollidableToLiving
public void setCollidableToLiving(org.bukkit.entity.LivingEntity living, boolean isRemove) Description copied from interface:BaseEntity
Configure whether the targeted living entity can collide with this entity- Specified by:
setCollidableToLiving
in interfaceBaseEntity<org.bukkit.entity.Player>
- Parameters:
living
- The targeted living entityisRemove
- Can be collided
-
broadcastSpawnPacket
public void broadcastSpawnPacket()Description copied from interface:BaseEntity
Called when the target becomes visible again.
For bukkit entities and players, useEntityHandler.broadcastSpawnPacket(BaseEntity, boolean)
- Specified by:
broadcastSpawnPacket
in interfaceBaseEntity<org.bukkit.entity.Player>
-
broadcastDespawnPacket
public void broadcastDespawnPacket()Description copied from interface:BaseEntity
Called when the target becomes invisible.
For bukkit entities and players, useEntityHandler.broadcastDespawnPacket(BaseEntity, boolean)
- Specified by:
broadcastDespawnPacket
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getEntityId
public int getEntityId()Description copied from interface:BaseEntity
Get the entity ID of this entity.
If the target is not a bukkit entity, you have to be absolutely sure that this ID does not overlap with an existing entity, as it is used to identify interactions between models.
UseEntityHandler.getEntityCounter()
to generate unique integer ID if you are unsure.- Specified by:
getEntityId
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getUniqueId
Description copied from interface:BaseEntity
Get the UUID of this entity.
This UUID is used to retrieve the instance ofModeledEntity
associated with this entity. SeeModelEngineAPI.getModeledEntity(UUID)
.- Specified by:
getUniqueId
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getLocation
public org.bukkit.Location getLocation()Description copied from interface:BaseEntity
Get the location of this entity.- Specified by:
getLocation
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getWorld
public org.bukkit.World getWorld()Description copied from interface:BaseEntity
Get the world of this entity.- Specified by:
getWorld
in interfaceBaseEntity<org.bukkit.entity.Player>
-
isDead
public boolean isDead()- Specified by:
isDead
in interfaceBaseEntity<org.bukkit.entity.Player>
-
isGlowing
public boolean isGlowing()- Specified by:
isGlowing
in interfaceBaseEntity<org.bukkit.entity.Player>
-
isOnGround
public boolean isOnGround()- Specified by:
isOnGround
in interfaceBaseEntity<org.bukkit.entity.Player>
-
isMoving
public boolean isMoving()- Specified by:
isMoving
in interfaceBaseEntity<org.bukkit.entity.Player>
-
setYHeadRot
public void setYHeadRot(float rot) - Specified by:
setYHeadRot
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getYHeadRot
public float getYHeadRot()- Specified by:
getYHeadRot
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getXHeadRot
public float getXHeadRot()- Specified by:
getXHeadRot
in interfaceBaseEntity<org.bukkit.entity.Player>
-
setYBodyRot
public void setYBodyRot(float rot) - Specified by:
setYBodyRot
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getYBodyRot
public float getYBodyRot()- Specified by:
getYBodyRot
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getPassengers
- Specified by:
getPassengers
in interfaceBaseEntity<org.bukkit.entity.Player>
-
getItemInSlot
public org.bukkit.inventory.ItemStack getItemInSlot(org.bukkit.inventory.EquipmentSlot slot) - Specified by:
getItemInSlot
in interfaceBaseEntity<org.bukkit.entity.Player>
-