Class GlowBlock

java.lang.Object
net.glowstone.block.GlowBlock
All Implemented Interfaces:
org.bukkit.block.Block, org.bukkit.metadata.Metadatable

public class GlowBlock extends Object implements org.bukkit.block.Block
Represents a single block in a world.
  • Constructor Details

    • GlowBlock

      public GlowBlock(GlowChunk chunk, int x, int y, int z)
      Creates an object to refer to a block.
      Parameters:
      chunk - the chunk
      x - the X coordinate
      y - the Y coordinate
      z - the Z coordinate
  • Method Details

    • getChunk

      @NotNull public @NotNull GlowChunk getChunk()
      Specified by:
      getChunk in interface org.bukkit.block.Block
    • getLocation

      @NotNull public @NotNull org.bukkit.Location getLocation()
      Specified by:
      getLocation in interface org.bukkit.block.Block
    • getLocation

      public org.bukkit.Location getLocation(org.bukkit.Location loc)
      Specified by:
      getLocation in interface org.bukkit.block.Block
    • getBlockEntity

      public BlockEntity getBlockEntity()
    • getState

      @NotNull public @NotNull GlowBlockState getState()
      Specified by:
      getState in interface org.bukkit.block.Block
    • getState

      @NotNull public @NotNull GlowBlockState getState(boolean useSnapshot)
      Specified by:
      getState in interface org.bukkit.block.Block
    • getBiome

      @NotNull public @NotNull org.bukkit.block.Biome getBiome()
      Specified by:
      getBiome in interface org.bukkit.block.Block
    • setBiome

      public void setBiome(@NotNull @NotNull org.bukkit.block.Biome bio)
      Specified by:
      setBiome in interface org.bukkit.block.Block
    • getTemperature

      public double getTemperature()
      Specified by:
      getTemperature in interface org.bukkit.block.Block
    • getHumidity

      public double getHumidity()
      Specified by:
      getHumidity in interface org.bukkit.block.Block
    • getFace

      public org.bukkit.block.BlockFace getFace(@NotNull @NotNull org.bukkit.block.Block block)
      Specified by:
      getFace in interface org.bukkit.block.Block
    • getRelative

      @NotNull public @NotNull GlowBlock getRelative(int modX, int modY, int modZ)
      Specified by:
      getRelative in interface org.bukkit.block.Block
    • getRelative

      @NotNull public @NotNull GlowBlock getRelative(org.bukkit.block.BlockFace face)
      Specified by:
      getRelative in interface org.bukkit.block.Block
    • getRelative

      @NotNull public @NotNull GlowBlock getRelative(org.bukkit.block.BlockFace face, int distance)
      Specified by:
      getRelative in interface org.bukkit.block.Block
    • getType

      @NotNull public @NotNull org.bukkit.Material getType()
      Specified by:
      getType in interface org.bukkit.block.Block
    • getId

      public int getId()
    • setType

      public void setType(org.bukkit.Material type)
      Specified by:
      setType in interface org.bukkit.block.Block
    • setType

      public void setType(org.bukkit.Material type, boolean applyPhysics)
      Set the Material type of a block and optionally apply physics.
      Specified by:
      setType in interface org.bukkit.block.Block
    • setType

      public void setType(org.bukkit.Material type, byte data, boolean applyPhysics)
      Set the Material type of a block with data and optionally apply physics.
      Parameters:
      type - The type to set the block to.
      data - The raw data to set the block to.
      applyPhysics - notify this block and surrounding blocks to update physics
    • setTypeId

      @Deprecated public boolean setTypeId(int type)
      Deprecated.
    • setTypeId

      @Deprecated public boolean setTypeId(int type, boolean applyPhysics)
      Deprecated.
    • setTypeIdAndData

      @Deprecated public boolean setTypeIdAndData(int type, byte data, boolean applyPhysics)
      Deprecated.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.bukkit.block.Block
    • isLiquid

      public boolean isLiquid()
      Specified by:
      isLiquid in interface org.bukkit.block.Block
    • isBuildable

      public boolean isBuildable()
      Specified by:
      isBuildable in interface org.bukkit.block.Block
    • isFlammable

      public boolean isFlammable()
      Get block material's flammable ability. (ability to have fire spread to it)
      Returns:
      if this block is flammable
    • isBurnable

      public boolean isBurnable()
      Get block material's burn ability. (ability to have fire consume it)
      Specified by:
      isBurnable in interface org.bukkit.block.Block
      Returns:
      if this block is burnable
    • isReplaceable

      public boolean isReplaceable()
      Specified by:
      isReplaceable in interface org.bukkit.block.Block
    • isSolid

      public boolean isSolid()
      Specified by:
      isSolid in interface org.bukkit.block.Block
    • getMaterialValues

      public MaterialValueManager.ValueCollection getMaterialValues()
    • getData

      public byte getData()
      Specified by:
      getData in interface org.bukkit.block.Block
    • setData

      public void setData(byte data)
    • setData

      public void setData(byte data, boolean applyPhysics)
    • setBlockData

      public void setBlockData(@NotNull @NotNull org.bukkit.block.data.BlockData data, boolean applyPhysics)
      Specified by:
      setBlockData in interface org.bukkit.block.Block
    • setBlockData

      public void setBlockData(@NotNull @NotNull org.bukkit.block.data.BlockData data)
      Specified by:
      setBlockData in interface org.bukkit.block.Block
    • getBlockData

      @NotNull public @NotNull org.bukkit.block.data.BlockData getBlockData()
      Specified by:
      getBlockData in interface org.bukkit.block.Block
    • getLightLevel

      public byte getLightLevel()
      Specified by:
      getLightLevel in interface org.bukkit.block.Block
    • getLightFromSky

      public byte getLightFromSky()
      Specified by:
      getLightFromSky in interface org.bukkit.block.Block
    • getLightFromBlocks

      public byte getLightFromBlocks()
      Specified by:
      getLightFromBlocks in interface org.bukkit.block.Block
    • isValidTool

      public boolean isValidTool(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Specified by:
      isValidTool in interface org.bukkit.block.Block
    • isBlockPowered

      public boolean isBlockPowered()
      Specified by:
      isBlockPowered in interface org.bukkit.block.Block
    • isBlockIndirectlyPowered

      public boolean isBlockIndirectlyPowered()
      Specified by:
      isBlockIndirectlyPowered in interface org.bukkit.block.Block
    • isBlockFacePowered

      public boolean isBlockFacePowered(org.bukkit.block.BlockFace face)
      Specified by:
      isBlockFacePowered in interface org.bukkit.block.Block
    • isBlockFaceIndirectlyPowered

      public boolean isBlockFaceIndirectlyPowered(org.bukkit.block.BlockFace face)
      Specified by:
      isBlockFaceIndirectlyPowered in interface org.bukkit.block.Block
    • getBlockPower

      public int getBlockPower(org.bukkit.block.BlockFace face)
      Specified by:
      getBlockPower in interface org.bukkit.block.Block
    • getBlockPower

      public int getBlockPower()
      Specified by:
      getBlockPower in interface org.bukkit.block.Block
    • getPistonMoveReaction

      @NotNull public @NotNull org.bukkit.block.PistonMoveReaction getPistonMoveReaction()
      Specified by:
      getPistonMoveReaction in interface org.bukkit.block.Block
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • breakNaturally

      public boolean breakNaturally(float yield)
      Break the block naturally, randomly dropping only some of the drops.
      Parameters:
      yield - The approximate portion of the drops to actually drop.
      Returns:
      true if the block was destroyed
    • breakNaturally

      public boolean breakNaturally(float yield, Collection<org.bukkit.inventory.ItemStack> drops)
      Breaks this block and drops items.
      Parameters:
      yield - the probability to drop each item
      drops - the items to potentially drop
      Returns:
      true if broken; false if this block is already air
    • breakNaturally

      public boolean breakNaturally()
      Specified by:
      breakNaturally in interface org.bukkit.block.Block
    • breakNaturally

      public boolean breakNaturally(org.bukkit.inventory.ItemStack tool)
      Specified by:
      breakNaturally in interface org.bukkit.block.Block
    • breakNaturally

      public boolean breakNaturally(@NotNull @NotNull org.bukkit.inventory.ItemStack tool, boolean triggerEffect)
      Specified by:
      breakNaturally in interface org.bukkit.block.Block
    • applyBoneMeal

      public boolean applyBoneMeal(@NotNull @NotNull org.bukkit.block.BlockFace blockFace)
      Specified by:
      applyBoneMeal in interface org.bukkit.block.Block
    • getDrops

      public Collection<org.bukkit.inventory.ItemStack> getDrops()
      Specified by:
      getDrops in interface org.bukkit.block.Block
    • getDrops

      public Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.inventory.ItemStack tool)
      Specified by:
      getDrops in interface org.bukkit.block.Block
    • getDrops

      @NotNull public @NotNull Collection<org.bukkit.inventory.ItemStack> getDrops(@NotNull @NotNull org.bukkit.inventory.ItemStack tool, @Nullable @Nullable org.bukkit.entity.Entity entity)
      Specified by:
      getDrops in interface org.bukkit.block.Block
    • isPreferredTool

      public boolean isPreferredTool(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Specified by:
      isPreferredTool in interface org.bukkit.block.Block
    • isPassable

      public boolean isPassable()
      Specified by:
      isPassable in interface org.bukkit.block.Block
    • rayTrace

      @Nullable public @Nullable org.bukkit.util.RayTraceResult rayTrace(@NotNull @NotNull org.bukkit.Location start, @NotNull @NotNull org.bukkit.util.Vector direction, double maxDistance, @NotNull @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode)
      Specified by:
      rayTrace in interface org.bukkit.block.Block
    • getBoundingBox

      @NotNull public @NotNull org.bukkit.util.BoundingBox getBoundingBox()
      Specified by:
      getBoundingBox in interface org.bukkit.block.Block
    • getSoundGroup

      @NotNull public @NotNull com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup()
      Specified by:
      getSoundGroup in interface org.bukkit.block.Block
    • getTranslationKey

      @NotNull public @NotNull String getTranslationKey()
      Specified by:
      getTranslationKey in interface org.bukkit.block.Block
    • getDestroySpeed

      @NotNull public @org.jetbrains.annotations.NotNull float getDestroySpeed(@NotNull @NotNull org.bukkit.inventory.ItemStack tool)
      Specified by:
      getDestroySpeed in interface org.bukkit.block.Block
    • getDestroySpeed

      @NotNull public @org.jetbrains.annotations.NotNull float getDestroySpeed(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, boolean considerEnchants)
      Specified by:
      getDestroySpeed in interface org.bukkit.block.Block
    • setMetadata

      public void setMetadata(String metadataKey, org.bukkit.metadata.MetadataValue newMetadataValue)
      Specified by:
      setMetadata in interface org.bukkit.metadata.Metadatable
    • getMetadata

      public List<org.bukkit.metadata.MetadataValue> getMetadata(String metadataKey)
      Specified by:
      getMetadata in interface org.bukkit.metadata.Metadatable
    • hasMetadata

      public boolean hasMetadata(String metadataKey)
      Specified by:
      hasMetadata in interface org.bukkit.metadata.Metadatable
    • removeMetadata

      public void removeMetadata(@NotNull @NotNull String metadataKey, @NotNull @NotNull org.bukkit.plugin.Plugin owningPlugin)
      Specified by:
      removeMetadata in interface org.bukkit.metadata.Metadatable
    • applyPhysics

      public void applyPhysics(org.bukkit.Material oldType, org.bukkit.Material newType, byte oldData, byte newData)
      Notify this block and its surrounding blocks that this block has changed type and data.
      Parameters:
      oldType - the old block type
      newType - the new block type
      oldData - the old data
      newData - the new data
    • count

      public void count(int timeout)
      Increments the count of recent state changes. Used to implement redstone-torch burnout.
      Parameters:
      timeout - the number of game ticks before this state change is no longer considered recent
    • getCounter

      public int getCounter()
      Returns the number of recent state changes, as defined by count(int). Used to implement redstone-torch burnout.
      Returns:
      the number of recent state changes
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getX

      public int getX()
      Specified by:
      getX in interface org.bukkit.block.Block
    • getY

      public int getY()
      Specified by:
      getY in interface org.bukkit.block.Block
    • getZ

      public int getZ()
      Specified by:
      getZ in interface org.bukkit.block.Block
    • getWorld

      public GlowWorld getWorld()
      Specified by:
      getWorld in interface org.bukkit.block.Block