Class 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

public class GlowPainting extends GlowHangingEntity implements org.bukkit.entity.Painting
  • 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 painting
      facing - the direction for the painting to face
  • Method Details

    • getArtFromTitle

      public static org.bukkit.Art getArtFromTitle(String title)
    • getArtTitle

      public String getArtTitle()
    • getType

      @NotNull public @NotNull org.bukkit.entity.EntityType getType()
      Specified by:
      getType in interface org.bukkit.entity.Entity
      Overrides:
      getType in class GlowEntity
    • entityInteract

      public boolean entityInteract(GlowPlayer player, InteractEntityMessage message)
      Overrides:
      entityInteract in class GlowEntity
    • createSpawnMessage

      public List<com.flowpowered.network.Message> createSpawnMessage()
      Description copied from class: GlowEntity
      Creates a list of Messages 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 class GlowEntity
      Returns:
      A list of messages which can spawn this entity.
    • setArt

      public boolean setArt(@NotNull @NotNull org.bukkit.Art art)
      Specified by:
      setArt in interface org.bukkit.entity.Painting
    • setArt

      public boolean setArt(@NotNull @NotNull org.bukkit.Art art, boolean force)
      Specified by:
      setArt in interface org.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 interface org.bukkit.material.Directional
    • setFacingDirection

      public boolean setFacingDirection(@NotNull @NotNull org.bukkit.block.BlockFace blockFace, boolean force)
      Specified by:
      setFacingDirection in interface org.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 class GlowEntity
    • pulsePhysics

      protected void pulsePhysics()
      Overrides:
      pulsePhysics in class GlowEntity
    • 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 interface org.bukkit.entity.Entity
      Overrides:
      getWidth in class GlowEntity
    • getHeight

      public double getHeight()
      Specified by:
      getHeight in interface org.bukkit.entity.Entity
      Overrides:
      getHeight in class GlowEntity
    • updateBoundingBox

      protected void updateBoundingBox()
      Overrides:
      updateBoundingBox in class GlowEntity
    • setRawLocation

      public void setRawLocation(org.bukkit.Location location, boolean fall)
      Description copied from class: GlowEntity
      Sets this entity's location.
      Overrides:
      setRawLocation in class GlowEntity
      Parameters:
      location - The new location.
      fall - Whether to calculate fall damage or not.
    • getArt

      public org.bukkit.Art getArt()
      Specified by:
      getArt in interface org.bukkit.entity.Painting
    • getArtCenter

      public org.bukkit.Location getArtCenter()