public class BaseEntity extends Object implements Entity
| Modifier and Type | Field and Description |
|---|---|
protected BitSet |
metadataFlags |
| Constructor and Description |
|---|
BaseEntity(EntityType entityType,
com.flowpowered.math.vector.Vector3f position,
NukkitLevel level,
NukkitServer server) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkIfAlive() |
BedrockPacket |
createAddEntityPacket() |
<C extends EntityComponent> |
get(Class<C> clazz) |
BoundingBox |
getBoundingBox() |
long |
getEntityId() |
protected boolean |
getFlag(MetadataConstants.Flag flag) |
com.flowpowered.math.vector.Vector3f |
getGamePosition() |
float |
getHeight() |
float |
getLength() |
NukkitLevel |
getLevel() |
MetadataDictionary |
getMetadata() |
protected MetadataDictionary |
getMetadataFlags() |
com.flowpowered.math.vector.Vector3f |
getMotion() |
float |
getOffset() |
com.flowpowered.math.vector.Vector3f |
getPosition() |
Rotation |
getRotation() |
NukkitServer |
getServer() |
long |
getTickCreated() |
long |
getTicksLived() |
UUID |
getUniqueId() |
Optional<Entity> |
getVehicle() |
float |
getWidth() |
boolean |
isAffectedByGravity() |
boolean |
isAlive() |
boolean |
isCustomNameVisible() |
boolean |
isGlowing() |
boolean |
isInsideVehicle() |
boolean |
isInvulnerable() |
boolean |
isMovementStale() |
boolean |
isOnGround() |
boolean |
isRemoved() |
boolean |
isSneaking() |
protected boolean |
isTeleported() |
boolean |
leaveVehicle() |
void |
onAttributeUpdate(Attribute attribute) |
boolean |
onItemPickup(ItemInstance item) |
protected void |
onMetadataUpdate(MetadataDictionary metadata) |
Set<Class<? extends EntityComponent>> |
providedComponents() |
<C extends EntityComponent> |
provides(Class<C> clazz) |
protected <C extends EntityComponent> |
registerComponent(Class<C> clazz,
C component) |
void |
remove() |
void |
resetStaleMovement() |
protected void |
save() |
void |
setAffectedByGravity(boolean affectedByGravity) |
void |
setCustomNameVisible(boolean flag) |
protected void |
setEntityId(long entityId) |
protected void |
setFlag(MetadataConstants.Flag flag,
boolean value) |
void |
setGlowing(boolean flag) |
void |
setInvulnerable(boolean flag) |
void |
setMotion(com.flowpowered.math.vector.Vector3f motion) |
void |
setPosition(com.flowpowered.math.vector.Vector3f position) |
void |
setPositionFromSystem(com.flowpowered.math.vector.Vector3f position) |
void |
setRotation(Rotation rotation) |
void |
setSneaking(boolean sneaking) |
void |
setTickCreated(long tickCreated) |
void |
setTicksLived(long ticks) |
boolean |
teleport(Entity destination) |
boolean |
teleport(com.flowpowered.math.vector.Vector3f position) |
boolean |
teleport(com.flowpowered.math.vector.Vector3f location,
Level level) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitensureAndGet, getDirectionVectorprotected final BitSet metadataFlags
public BaseEntity(EntityType entityType, com.flowpowered.math.vector.Vector3f position, NukkitLevel level, NukkitServer server)
public BedrockPacket createAddEntityPacket()
@Nonnull public Rotation getRotation()
getRotation in interface Entity@Nonnull public com.flowpowered.math.vector.Vector3f getMotion()
public UUID getUniqueId()
getUniqueId in interface Entity@Nonnull public com.flowpowered.math.vector.Vector3f getPosition()
getPosition in interface Entitypublic void setPosition(@Nonnull com.flowpowered.math.vector.Vector3f position)
setPosition in interface Entitypublic void setPositionFromSystem(@Nonnull com.flowpowered.math.vector.Vector3f position)
setPositionFromSystem in interface Entity@Nonnull public com.flowpowered.math.vector.Vector3f getGamePosition()
getGamePosition in interface Entity@Nonnull public BoundingBox getBoundingBox()
getBoundingBox in interface Entitypublic void setMotion(com.flowpowered.math.vector.Vector3f motion)
public float getLength()
public boolean isOnGround()
isOnGround in interface Entitypublic NukkitLevel getLevel()
public boolean teleport(com.flowpowered.math.vector.Vector3f position)
public boolean teleport(com.flowpowered.math.vector.Vector3f location,
Level level)
public long getEntityId()
getEntityId in interface Entitypublic final void checkIfAlive()
@Nonnull public NukkitServer getServer()
public long getTickCreated()
getTickCreated in interface Entitypublic void setTickCreated(long tickCreated)
setTickCreated in interface Entitypublic long getTicksLived()
getTicksLived in interface Entitypublic void setTicksLived(long ticks)
setTicksLived in interface Entitypublic boolean isInsideVehicle()
isInsideVehicle in interface Entitypublic boolean leaveVehicle()
leaveVehicle in interface Entitypublic Optional<Entity> getVehicle()
getVehicle in interface Entitypublic boolean isCustomNameVisible()
isCustomNameVisible in interface Entitypublic void setCustomNameVisible(boolean flag)
setCustomNameVisible in interface Entitypublic void setGlowing(boolean flag)
setGlowing in interface Entitypublic boolean isInvulnerable()
isInvulnerable in interface Entitypublic void setInvulnerable(boolean flag)
setInvulnerable in interface Entitypublic boolean isSneaking()
isSneaking in interface Entitypublic void setSneaking(boolean sneaking)
setSneaking in interface Entitypublic boolean isRemoved()
public boolean isAffectedByGravity()
isAffectedByGravity in interface Entitypublic void setAffectedByGravity(boolean affectedByGravity)
setAffectedByGravity in interface Entitypublic Set<Class<? extends EntityComponent>> providedComponents()
providedComponents in interface Entitypublic <C extends EntityComponent> boolean provides(@Nonnull Class<C> clazz)
protected <C extends EntityComponent> void registerComponent(Class<C> clazz, C component)
public <C extends EntityComponent> Optional<C> get(@Nonnull Class<C> clazz)
protected void setFlag(MetadataConstants.Flag flag, boolean value)
protected void onMetadataUpdate(MetadataDictionary metadata)
protected boolean getFlag(MetadataConstants.Flag flag)
protected void setEntityId(long entityId)
protected boolean isTeleported()
protected MetadataDictionary getMetadataFlags()
public MetadataDictionary getMetadata()
public void onAttributeUpdate(Attribute attribute)
public boolean isMovementStale()
public void resetStaleMovement()
public boolean onItemPickup(ItemInstance item)
protected void save()
Copyright © 2017–2018 NukkitX. All rights reserved.