Package be.seeseemelk.mockbukkit.entity
Class EntityMock
java.lang.Object
org.bukkit.command.CommandSender.Spigot
org.bukkit.entity.Entity.Spigot
be.seeseemelk.mockbukkit.entity.EntityMock
- All Implemented Interfaces:
MessageTarget,org.bukkit.command.CommandSender,org.bukkit.entity.Entity,org.bukkit.metadata.Metadatable,org.bukkit.Nameable,org.bukkit.permissions.Permissible,org.bukkit.permissions.ServerOperator,org.bukkit.persistence.PersistentDataHolder
- Direct Known Subclasses:
ExperienceOrbMock,ItemEntityMock,LivingEntityMock,ProjectileMock,SimpleEntityMock
public abstract class EntityMock
extends org.bukkit.entity.Entity.Spigot
implements org.bukkit.entity.Entity, MessageTarget
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
org.bukkit.entity.Entity.Spigot -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityMock(@NotNull ServerMock server, @NotNull UUID uuid) -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.permissions.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin) org.bukkit.permissions.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin, int ticks) org.bukkit.permissions.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin, String name, boolean value) org.bukkit.permissions.PermissionAttachmentaddAttachment(org.bukkit.plugin.Plugin plugin, String name, boolean value, int ticks) booleanaddPassenger(org.bukkit.entity.Entity passenger) booleanaddScoreboardTag(String tag) voidassertLocation(org.bukkit.Location expectedLocation, double maximumDistance) Assert that the actual location of the player is within a certain distance to a given location.voidAssert that the player hasn't teleported.voidassertTeleported(@NotNull org.bukkit.Location expectedLocation, double maximumDistance) Assert that the player teleported to a certain location within a certain distance to a given location.voidClears the teleported flag.booleaneject()final booleanorg.bukkit.util.BoundingBoxSet<org.bukkit.permissions.PermissionAttachmentInfo>intorg.bukkit.block.BlockFacefloatintintdoubleorg.bukkit.event.entity.EntityDamageEventorg.bukkit.Locationorg.bukkit.LocationgetLocation(org.bukkit.Location loc) intintList<org.bukkit.metadata.MetadataValue>getMetadata(String metadataKey) getName()List<org.bukkit.entity.Entity>getNearbyEntities(double x, double y, double z) org.bukkit.entity.EntityList<org.bukkit.entity.Entity>@NotNull org.bukkit.persistence.PersistentDataContainerorg.bukkit.block.PistonMoveReactionintorg.bukkit.entity.PosegetPose()org.bukkit.event.player.PlayerTeleportEvent.TeleportCauseGet the cause of the last teleport.intorg.bukkit.entity.Entityorg.bukkit.util.VectordoublegetWidth()org.bukkit.WorldgetWorld()booleanfinal inthashCode()booleanhasMetadata(String metadataKey) booleanhasPermission(String name) booleanhasPermission(org.bukkit.permissions.Permission perm) booleanChecks if the player has been teleported since the last assert orclearTeleported().booleanbooleanisDead()booleanisEmpty()booleanisFrozen()booleanbooleanbooleanbooleanbooleanbooleanisOp()booleanisPermissionSet(String name) booleanisPermissionSet(org.bukkit.permissions.Permission perm) booleanbooleanisSilent()booleanisValid()booleanbooleanReturns the next message that was sent to the target.voidplayEffect(org.bukkit.EntityEffect type) voidvoidremove()voidremoveAttachment(org.bukkit.permissions.PermissionAttachment attachment) voidremoveMetadata(String metadataKey, org.bukkit.plugin.Plugin owningPlugin) booleanremovePassenger(org.bukkit.entity.Entity passenger) booleanvoidsendMessage(String message) voidsendMessage(String... messages) voidsendMessage(UUID sender, String message) voidsendMessage(UUID sender, String... messages) voidsetCustomName(String name) voidsetCustomNameVisible(boolean flag) voidsetFallDistance(float distance) voidsetFireTicks(int ticks) voidsetFreezeTicks(int ticks) voidsetGlowing(boolean flag) voidsetGravity(boolean gravity) voidsetInvulnerable(boolean flag) voidsetLastDamageCause(org.bukkit.event.entity.EntityDamageEvent event) voidsetLocation(org.bukkit.Location location) Sets the location of the entity.voidsetMetadata(String metadataKey, org.bukkit.metadata.MetadataValue newMetadataValue) voidSets the name of this entity.voidsetOp(boolean isOperator) booleansetPassenger(org.bukkit.entity.Entity passenger) voidsetPersistent(boolean persistent) voidsetPortalCooldown(int cooldown) voidsetRotation(float yaw, float pitch) voidsetSilent(boolean flag) voidsetTicksLived(int value) voidsetVelocity(@NotNull org.bukkit.util.Vector velocity) voidsetVisualFire(boolean fire) org.bukkit.entity.Entity.Spigotspigot()booleanteleport(org.bukkit.entity.Entity destination) booleanteleport(org.bukkit.entity.Entity destination, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) booleanteleport(org.bukkit.Location location) booleanteleport(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) Methods inherited from class org.bukkit.command.CommandSender.Spigot
sendMessage, sendMessage, sendMessage, sendMessageMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.entity.Entity
getSpawnCategory, getTypeMethods inherited from interface be.seeseemelk.mockbukkit.command.MessageTarget
assertNoMoreSaid, assertSaid
-
Constructor Details
-
EntityMock
-
-
Method Details
-
hashCode
public final int hashCode() -
equals
-
assertLocation
public void assertLocation(org.bukkit.Location expectedLocation, double maximumDistance) Assert that the actual location of the player is within a certain distance to a given location.- Parameters:
expectedLocation- The location the player should be at.maximumDistance- The distance the player may maximumly be separated from the expected location.
-
assertTeleported
public void assertTeleported(@NotNull @NotNull org.bukkit.Location expectedLocation, double maximumDistance) Assert that the player teleported to a certain location within a certain distance to a given location. Also clears the teleported flag.- Parameters:
expectedLocation- The location the player should be at.maximumDistance- The distance the player may maximumly be separated from the expected location.
-
assertNotTeleported
public void assertNotTeleported()Assert that the player hasn't teleported. Also clears the teleported flag. -
hasTeleported
public boolean hasTeleported()Checks if the player has been teleported since the last assert orclearTeleported().- Returns:
trueif the player has been teleported,falseif he hasn't been teleported.
-
clearTeleported
public void clearTeleported()Clears the teleported flag. -
getTeleportCause
public org.bukkit.event.player.PlayerTeleportEvent.TeleportCause getTeleportCause()Get the cause of the last teleport.- Returns:
- The cause of the last teleport.
-
getUniqueId
- Specified by:
getUniqueIdin interfaceorg.bukkit.entity.Entity
-
getLocation
public org.bukkit.Location getLocation()- Specified by:
getLocationin interfaceorg.bukkit.entity.Entity
-
getLocation
public org.bukkit.Location getLocation(org.bukkit.Location loc) - Specified by:
getLocationin interfaceorg.bukkit.entity.Entity
-
setLocation
public void setLocation(org.bukkit.Location location) Sets the location of the entity. Note that this will not fire a teleport event.- Parameters:
location- The new location of the entity.
-
getWorld
public org.bukkit.World getWorld()- Specified by:
getWorldin interfaceorg.bukkit.entity.Entity
-
setMetadata
- Specified by:
setMetadatain interfaceorg.bukkit.metadata.Metadatable
-
getMetadata
- Specified by:
getMetadatain interfaceorg.bukkit.metadata.Metadatable
-
hasMetadata
- Specified by:
hasMetadatain interfaceorg.bukkit.metadata.Metadatable
-
removeMetadata
- Specified by:
removeMetadatain interfaceorg.bukkit.metadata.Metadatable
-
getPersistentDataContainer
@NotNull public @NotNull org.bukkit.persistence.PersistentDataContainer getPersistentDataContainer()- Specified by:
getPersistentDataContainerin interfaceorg.bukkit.persistence.PersistentDataHolder
-
teleport
public boolean teleport(org.bukkit.Location location) - Specified by:
teleportin interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) - Specified by:
teleportin interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.entity.Entity destination) - Specified by:
teleportin interfaceorg.bukkit.entity.Entity
-
teleport
public boolean teleport(org.bukkit.entity.Entity destination, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause) - Specified by:
teleportin interfaceorg.bukkit.entity.Entity
-
isOp
public boolean isOp()- Specified by:
isOpin interfaceorg.bukkit.permissions.ServerOperator
-
setOp
public void setOp(boolean isOperator) - Specified by:
setOpin interfaceorg.bukkit.permissions.ServerOperator
-
getName
- Specified by:
getNamein interfaceorg.bukkit.command.CommandSender
-
setName
Sets the name of this entity.- Parameters:
name- The new name of the entity.
-
sendMessage
- Specified by:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
sendMessage
- Specified by:
sendMessagein interfaceorg.bukkit.command.CommandSender
-
nextMessage
Description copied from interface:MessageTargetReturns the next message that was sent to the target.- Specified by:
nextMessagein interfaceMessageTarget- Returns:
- The next message sent to the target.
-
isPermissionSet
- Specified by:
isPermissionSetin interfaceorg.bukkit.permissions.Permissible
-
isPermissionSet
public boolean isPermissionSet(org.bukkit.permissions.Permission perm) - Specified by:
isPermissionSetin interfaceorg.bukkit.permissions.Permissible
-
hasPermission
- Specified by:
hasPermissionin interfaceorg.bukkit.permissions.Permissible
-
hasPermission
public boolean hasPermission(org.bukkit.permissions.Permission perm) - Specified by:
hasPermissionin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String name, boolean value) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, String name, boolean value, int ticks) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
addAttachment
public org.bukkit.permissions.PermissionAttachment addAttachment(org.bukkit.plugin.Plugin plugin, int ticks) - Specified by:
addAttachmentin interfaceorg.bukkit.permissions.Permissible
-
removeAttachment
public void removeAttachment(org.bukkit.permissions.PermissionAttachment attachment) - Specified by:
removeAttachmentin interfaceorg.bukkit.permissions.Permissible
-
recalculatePermissions
public void recalculatePermissions()- Specified by:
recalculatePermissionsin interfaceorg.bukkit.permissions.Permissible
-
getEffectivePermissions
- Specified by:
getEffectivePermissionsin interfaceorg.bukkit.permissions.Permissible
-
getCustomName
- Specified by:
getCustomNamein interfaceorg.bukkit.Nameable
-
setCustomName
- Specified by:
setCustomNamein interfaceorg.bukkit.Nameable
-
setVelocity
public void setVelocity(@NotNull @NotNull org.bukkit.util.Vector velocity) - Specified by:
setVelocityin interfaceorg.bukkit.entity.Entity
-
getVelocity
public org.bukkit.util.Vector getVelocity()- Specified by:
getVelocityin interfaceorg.bukkit.entity.Entity
-
getHeight
public double getHeight()- Specified by:
getHeightin interfaceorg.bukkit.entity.Entity
-
getWidth
public double getWidth()- Specified by:
getWidthin interfaceorg.bukkit.entity.Entity
-
isOnGround
public boolean isOnGround()- Specified by:
isOnGroundin interfaceorg.bukkit.entity.Entity
-
getNearbyEntities
- Specified by:
getNearbyEntitiesin interfaceorg.bukkit.entity.Entity
-
getEntityId
public int getEntityId()- Specified by:
getEntityIdin interfaceorg.bukkit.entity.Entity
-
getFireTicks
public int getFireTicks()- Specified by:
getFireTicksin interfaceorg.bukkit.entity.Entity
-
getMaxFireTicks
public int getMaxFireTicks()- Specified by:
getMaxFireTicksin interfaceorg.bukkit.entity.Entity
-
setFireTicks
public void setFireTicks(int ticks) - Specified by:
setFireTicksin interfaceorg.bukkit.entity.Entity
-
setVisualFire
public void setVisualFire(boolean fire) - Specified by:
setVisualFirein interfaceorg.bukkit.entity.Entity
-
isVisualFire
public boolean isVisualFire()- Specified by:
isVisualFirein interfaceorg.bukkit.entity.Entity
-
setFreezeTicks
public void setFreezeTicks(int ticks) - Specified by:
setFreezeTicksin interfaceorg.bukkit.entity.Entity
-
isFrozen
public boolean isFrozen()- Specified by:
isFrozenin interfaceorg.bukkit.entity.Entity
-
getFreezeTicks
public int getFreezeTicks()- Specified by:
getFreezeTicksin interfaceorg.bukkit.entity.Entity
-
getMaxFreezeTicks
public int getMaxFreezeTicks()- Specified by:
getMaxFreezeTicksin interfaceorg.bukkit.entity.Entity
-
remove
public void remove()- Specified by:
removein interfaceorg.bukkit.entity.Entity
-
isDead
public boolean isDead()- Specified by:
isDeadin interfaceorg.bukkit.entity.Entity
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceorg.bukkit.entity.Entity
-
getServer
- Specified by:
getServerin interfaceorg.bukkit.command.CommandSender- Specified by:
getServerin interfaceorg.bukkit.entity.Entity
-
getPassenger
public org.bukkit.entity.Entity getPassenger()- Specified by:
getPassengerin interfaceorg.bukkit.entity.Entity
-
setPassenger
public boolean setPassenger(org.bukkit.entity.Entity passenger) - Specified by:
setPassengerin interfaceorg.bukkit.entity.Entity
-
getPassengers
- Specified by:
getPassengersin interfaceorg.bukkit.entity.Entity
-
addPassenger
public boolean addPassenger(org.bukkit.entity.Entity passenger) - Specified by:
addPassengerin interfaceorg.bukkit.entity.Entity
-
removePassenger
public boolean removePassenger(org.bukkit.entity.Entity passenger) - Specified by:
removePassengerin interfaceorg.bukkit.entity.Entity
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceorg.bukkit.entity.Entity
-
eject
public boolean eject()- Specified by:
ejectin interfaceorg.bukkit.entity.Entity
-
getFallDistance
public float getFallDistance()- Specified by:
getFallDistancein interfaceorg.bukkit.entity.Entity
-
setFallDistance
public void setFallDistance(float distance) - Specified by:
setFallDistancein interfaceorg.bukkit.entity.Entity
-
setLastDamageCause
public void setLastDamageCause(org.bukkit.event.entity.EntityDamageEvent event) - Specified by:
setLastDamageCausein interfaceorg.bukkit.entity.Entity
-
getLastDamageCause
public org.bukkit.event.entity.EntityDamageEvent getLastDamageCause()- Specified by:
getLastDamageCausein interfaceorg.bukkit.entity.Entity
-
getTicksLived
public int getTicksLived()- Specified by:
getTicksLivedin interfaceorg.bukkit.entity.Entity
-
setTicksLived
public void setTicksLived(int value) - Specified by:
setTicksLivedin interfaceorg.bukkit.entity.Entity
-
playEffect
public void playEffect(org.bukkit.EntityEffect type) - Specified by:
playEffectin interfaceorg.bukkit.entity.Entity
-
isInsideVehicle
public boolean isInsideVehicle()- Specified by:
isInsideVehiclein interfaceorg.bukkit.entity.Entity
-
leaveVehicle
public boolean leaveVehicle()- Specified by:
leaveVehiclein interfaceorg.bukkit.entity.Entity
-
getVehicle
public org.bukkit.entity.Entity getVehicle()- Specified by:
getVehiclein interfaceorg.bukkit.entity.Entity
-
setCustomNameVisible
public void setCustomNameVisible(boolean flag) - Specified by:
setCustomNameVisiblein interfaceorg.bukkit.entity.Entity
-
isCustomNameVisible
public boolean isCustomNameVisible()- Specified by:
isCustomNameVisiblein interfaceorg.bukkit.entity.Entity
-
setGlowing
public void setGlowing(boolean flag) - Specified by:
setGlowingin interfaceorg.bukkit.entity.Entity
-
isGlowing
public boolean isGlowing()- Specified by:
isGlowingin interfaceorg.bukkit.entity.Entity
-
setInvulnerable
public void setInvulnerable(boolean flag) - Specified by:
setInvulnerablein interfaceorg.bukkit.entity.Entity
-
isInvulnerable
public boolean isInvulnerable()- Specified by:
isInvulnerablein interfaceorg.bukkit.entity.Entity
-
isSilent
public boolean isSilent()- Specified by:
isSilentin interfaceorg.bukkit.entity.Entity
-
setSilent
public void setSilent(boolean flag) - Specified by:
setSilentin interfaceorg.bukkit.entity.Entity
-
hasGravity
public boolean hasGravity()- Specified by:
hasGravityin interfaceorg.bukkit.entity.Entity
-
setGravity
public void setGravity(boolean gravity) - Specified by:
setGravityin interfaceorg.bukkit.entity.Entity
-
getPortalCooldown
public int getPortalCooldown()- Specified by:
getPortalCooldownin interfaceorg.bukkit.entity.Entity
-
setPortalCooldown
public void setPortalCooldown(int cooldown) - Specified by:
setPortalCooldownin interfaceorg.bukkit.entity.Entity
-
getScoreboardTags
- Specified by:
getScoreboardTagsin interfaceorg.bukkit.entity.Entity
-
addScoreboardTag
- Specified by:
addScoreboardTagin interfaceorg.bukkit.entity.Entity
-
removeScoreboardTag
- Specified by:
removeScoreboardTagin interfaceorg.bukkit.entity.Entity
-
getPistonMoveReaction
public org.bukkit.block.PistonMoveReaction getPistonMoveReaction()- Specified by:
getPistonMoveReactionin interfaceorg.bukkit.entity.Entity
-
setRotation
public void setRotation(float yaw, float pitch) - Specified by:
setRotationin interfaceorg.bukkit.entity.Entity
-
getBoundingBox
public org.bukkit.util.BoundingBox getBoundingBox()- Specified by:
getBoundingBoxin interfaceorg.bukkit.entity.Entity
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin interfaceorg.bukkit.entity.Entity
-
setPersistent
public void setPersistent(boolean persistent) - Specified by:
setPersistentin interfaceorg.bukkit.entity.Entity
-
getFacing
public org.bukkit.block.BlockFace getFacing()- Specified by:
getFacingin interfaceorg.bukkit.entity.Entity
-
getPose
public org.bukkit.entity.Pose getPose()- Specified by:
getPosein interfaceorg.bukkit.entity.Entity
-
isInWater
public boolean isInWater()- Specified by:
isInWaterin interfaceorg.bukkit.entity.Entity
-
spigot
public org.bukkit.entity.Entity.Spigot spigot()- Specified by:
spigotin interfaceorg.bukkit.command.CommandSender- Specified by:
spigotin interfaceorg.bukkit.entity.Entity
-