Package net.glowstone.entity.objects
Class GlowPainting
java.lang.Object
net.glowstone.entity.GlowEntity
net.glowstone.entity.GlowHangingEntity
net.glowstone.entity.objects.GlowPainting
- All Implemented Interfaces:
net.kyori.adventure.audience.Audience
,net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>
,org.bukkit.command.CommandSender
,org.bukkit.entity.Entity
,org.bukkit.entity.Hanging
,org.bukkit.entity.Painting
,org.bukkit.material.Attachable
,org.bukkit.material.Directional
,org.bukkit.metadata.Metadatable
,org.bukkit.Nameable
,org.bukkit.permissions.Permissible
,org.bukkit.permissions.ServerOperator
,org.bukkit.persistence.PersistentDataHolder
-
Nested Class Summary
Nested classes/interfaces inherited from class net.glowstone.entity.GlowHangingEntity
GlowHangingEntity.HangingFace
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
org.bukkit.entity.Entity.Spigot
-
Field Summary
Fields inherited from class net.glowstone.entity.GlowHangingEntity
facing
Fields inherited from class net.glowstone.entity.GlowEntity
active, airDrag, applyDragBeforeAccel, boundingBox, ENTITY_ID_NOBODY, entityId, gravityAccel, liquidDrag, location, metadata, passengerChanged, previousLocation, removed, server, slipMultiplier, teleported, ticksLived, vehicle, velocity, velocityChanged, world, worldLock
-
Constructor Summary
ConstructorDescriptionGlowPainting
(org.bukkit.Location center) GlowPainting
(org.bukkit.Location center, org.bukkit.block.BlockFace facing) Creates a painting with the default art. -
Method Summary
Modifier and TypeMethodDescriptionList<com.flowpowered.network.Message>
Creates a list ofMessage
s which can be sent to a client to spawn this entity.boolean
entityInteract
(GlowPlayer player, InteractEntityMessage message) org.bukkit.Art
getArt()
org.bukkit.Location
static org.bukkit.Art
getArtFromTitle
(String title) double
@NotNull org.bukkit.entity.EntityType
getType()
double
getWidth()
boolean
Check if the painting is obstructed at the current location.void
pulse()
Called every game cycle.protected void
boolean
setArt
(@NotNull org.bukkit.Art art) boolean
setArt
(@NotNull org.bukkit.Art art, boolean force) void
setArtInternal
(org.bukkit.Art art) Sets the art of this painting, regardless of available space.void
setFacingDirection
(@NotNull org.bukkit.block.BlockFace blockFace) boolean
setFacingDirection
(@NotNull org.bukkit.block.BlockFace blockFace, boolean force) void
setRawLocation
(org.bukkit.Location location, boolean fall) Sets this entity's location.protected void
Methods inherited from class net.glowstone.entity.GlowHangingEntity
getAttachedFace, getFacing, getYaw
Methods inherited from class net.glowstone.entity.GlowEntity
addAttachment, addAttachment, addAttachment, addAttachment, addPassenger, addScoreboardTag, collide, createAfterSpawnMessage, createUpdateMessage, customName, customName, damage, damage, damage, damage, eject, equals, fromMobSpawner, getBoundingBox, getCardinalFacing, getChunk, getCustomName, getCustomTags, getDismountLocation, getEffectivePermissions, getEntityId, getEntitySpawnReason, getFallDistance, getFireTicks, getGravityAccel, getLastDamageCause, getLeashedEntities, getLeashHolder, getLocation, getLocation, getMaxFireTicks, getMetadata, getMetadata, getMountLocation, getName, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPersistentDataContainer, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getUniqueId, getVehicle, getVelocity, getWorld, hasDefaultLandingBehavior, hasFriction, hasGravity, hashCode, hasMetadata, hasMoved, hasPermission, hasPermission, hasRotated, intersects, isCustomNameVisible, isDead, isEmpty, isGlowing, isInBubbleColumn, isInLava, isInMaterial, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isLeashed, isOnGround, isOp, isPermissionSet, isPermissionSet, isPersistent, isRemoved, isSilent, isTeleported, isTicking, isTouchingMaterial, isValid, isWithinDistance, isWithinDistance, leaveVehicle, playEffect, playEffectKnownAndSelf, recalculatePermissions, remove, removeAttachment, removeMetadata, removePassenger, removeScoreboardTag, reset, sendMessage, sendMessage, sendMessage, sendMessage, setAirDrag, setApplyDragBeforeAccel, setBoundingBox, setCustomName, setCustomNameVisible, setFallDistance, setFireTicks, setFriction, setGlowing, setGravity, setGravityAccel, setInvulnerable, setLastDamageCause, setLeashHolder, setLeashHolderUniqueId, setLiquidDrag, setMetadata, setOnGround, setOp, setPassenger, setPersistent, setPortalCooldown, setRawLocation, setRotation, setSilent, setSize, setTicksLived, setUniqueId, setVelocity, shouldSave, spigot, teleport, teleport, teleport, teleport, teleportToEnd, teleportToSpawn, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bukkit.material.Attachable
getAttachedFace
Methods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, hideBossBar, openBook, openBook, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, showBossBar, showTitle, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage
Methods inherited from interface org.bukkit.material.Directional
getFacing
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getUniqueId, getVehicle, getVelocity, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInBubbleColumn, isInLava, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, spigot, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomName
Methods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
Methods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Constructor Details
-
GlowPainting
public GlowPainting(org.bukkit.Location center) -
GlowPainting
public GlowPainting(org.bukkit.Location center, org.bukkit.block.BlockFace facing) Creates a painting with the default art.- Parameters:
center
- the center of the paintingfacing
- the direction for the painting to face
-
-
Method Details
-
getArtFromTitle
-
getArtTitle
-
getType
@NotNull public @NotNull org.bukkit.entity.EntityType getType()- Specified by:
getType
in interfaceorg.bukkit.entity.Entity
- Overrides:
getType
in classGlowEntity
-
entityInteract
- Overrides:
entityInteract
in classGlowEntity
-
createSpawnMessage
Description copied from class:GlowEntity
Creates a list ofMessage
s which can be sent to a client to spawn this entity. Implementations in concrete subclasses may return a shallowly immutable list.- Specified by:
createSpawnMessage
in classGlowEntity
- Returns:
- A list of messages which can spawn this entity.
-
setArt
public boolean setArt(@NotNull @NotNull org.bukkit.Art art) - Specified by:
setArt
in interfaceorg.bukkit.entity.Painting
-
setArt
public boolean setArt(@NotNull @NotNull org.bukkit.Art art, boolean force) - Specified by:
setArt
in interfaceorg.bukkit.entity.Painting
-
setArtInternal
public void setArtInternal(org.bukkit.Art art) Sets the art of this painting, regardless of available space.This matches the behaviour of
setArt(art, true)
, but the painting does not get refreshed.Null values are ignored.
- Parameters:
art
- the Art of the painting
-
setFacingDirection
public void setFacingDirection(@NotNull @NotNull org.bukkit.block.BlockFace blockFace) - Specified by:
setFacingDirection
in interfaceorg.bukkit.material.Directional
-
setFacingDirection
public boolean setFacingDirection(@NotNull @NotNull org.bukkit.block.BlockFace blockFace, boolean force) - Specified by:
setFacingDirection
in interfaceorg.bukkit.entity.Hanging
-
pulse
public void pulse()Description copied from class:GlowEntity
Called every game cycle. Subclasses should implement this to implement periodic functionality e.g. mob AI.- Overrides:
pulse
in classGlowEntity
-
pulsePhysics
protected void pulsePhysics()- Overrides:
pulsePhysics
in classGlowEntity
-
isObstructed
public boolean isObstructed()Check if the painting is obstructed at the current location.Survivability is defined as:
- The wall behind the painting is completely solid
- The painting is not inside a block
- The painting is not inside another entity
- Returns:
- true if the painting should drop, false otherwise
-
getWidth
public double getWidth()- Specified by:
getWidth
in interfaceorg.bukkit.entity.Entity
- Overrides:
getWidth
in classGlowEntity
-
getHeight
public double getHeight()- Specified by:
getHeight
in interfaceorg.bukkit.entity.Entity
- Overrides:
getHeight
in classGlowEntity
-
updateBoundingBox
protected void updateBoundingBox()- Overrides:
updateBoundingBox
in classGlowEntity
-
setRawLocation
public void setRawLocation(org.bukkit.Location location, boolean fall) Description copied from class:GlowEntity
Sets this entity's location.- Overrides:
setRawLocation
in classGlowEntity
- Parameters:
location
- The new location.fall
- Whether to calculate fall damage or not.
-
getArt
public org.bukkit.Art getArt()- Specified by:
getArt
in interfaceorg.bukkit.entity.Painting
-
getArtCenter
public org.bukkit.Location getArtCenter()
-