Class BlockStateBlock

java.lang.Object
ch.njol.skript.util.BlockStateBlock
All Implemented Interfaces:
net.kyori.adventure.translation.Translatable, org.bukkit.block.Block, org.bukkit.metadata.Metadatable, org.bukkit.Translatable
Direct Known Subclasses:
BlockInventoryHolder

public class BlockStateBlock extends Object implements org.bukkit.block.Block
A block that gets all data from a BlockState, and either reflects changes on the BlockState or delays them to the real block by 1 tick depending on which constructor is used.
  • Constructor Details

    • BlockStateBlock

      public BlockStateBlock(org.bukkit.block.BlockState state)
    • BlockStateBlock

      public BlockStateBlock(org.bukkit.block.BlockState state, boolean delayChanges)
  • Method Details

    • 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(String metadataKey, org.bukkit.plugin.Plugin owningPlugin)
      Specified by:
      removeMetadata in interface org.bukkit.metadata.Metadatable
    • getData

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

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

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

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

      public org.bukkit.Material getType()
      Specified by:
      getType 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
    • getWorld

      public org.bukkit.World getWorld()
      Specified by:
      getWorld in interface org.bukkit.block.Block
    • 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
    • getLocation

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

      public org.bukkit.Chunk getChunk()
      Specified by:
      getChunk in interface org.bukkit.block.Block
    • setType

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

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

      public org.bukkit.block.BlockState getState()
      Specified by:
      getState in interface org.bukkit.block.Block
    • getState

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

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

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

      public void setBiome(org.bukkit.block.Biome bio)
      Specified by:
      setBiome 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
    • 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
    • isBurnable

      public boolean isBurnable()
      Specified by:
      isBurnable in interface org.bukkit.block.Block
    • 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
    • isCollidable

      public boolean isCollidable()
      Specified by:
      isCollidable 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
    • getPistonMoveReaction

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

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

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

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

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

      public void tick()
      Specified by:
      tick in interface org.bukkit.block.Block
    • randomTick

      public void randomTick()
      Specified by:
      randomTick in interface org.bukkit.block.Block
    • applyBoneMeal

      public boolean applyBoneMeal(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(@Nullable org.bukkit.inventory.ItemStack tool)
      Specified by:
      getDrops in interface org.bukkit.block.Block
    • getDrops

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

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

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

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

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

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

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

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

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

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

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

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

      public float getDestroySpeed(org.bukkit.inventory.ItemStack itemStack)
      Specified by:
      getDestroySpeed in interface org.bukkit.block.Block
    • isPreferredTool

      public boolean isPreferredTool(@NotNull @NotNull org.bukkit.inventory.ItemStack tool)
      Specified by:
      isPreferredTool 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
    • 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
    • getCollisionShape

      @NotNull public @NotNull org.bukkit.util.VoxelShape getCollisionShape()
      Specified by:
      getCollisionShape in interface org.bukkit.block.Block
    • canPlace

      public boolean canPlace(@NotNull @NotNull org.bukkit.block.data.BlockData data)
      Specified by:
      canPlace in interface org.bukkit.block.Block
    • getBreakSpeed

      public float getBreakSpeed(@NotNull @NotNull org.bukkit.entity.Player player)
      Specified by:
      getBreakSpeed in interface org.bukkit.block.Block
    • translationKey

      @NotNull public @NotNull String translationKey()
      Specified by:
      translationKey in interface net.kyori.adventure.translation.Translatable
    • breakNaturally

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

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