Package ch.njol.skript.util
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
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 Summary
ConstructorDescriptionBlockStateBlock
(org.bukkit.block.BlockState state) BlockStateBlock
(org.bukkit.block.BlockState state, boolean delayChanges) -
Method Summary
Modifier and TypeMethodDescriptionboolean
applyBoneMeal
(org.bukkit.block.BlockFace blockFace) boolean
boolean
breakNaturally
(boolean triggerEffect) boolean
breakNaturally
(boolean triggerEffect, boolean dropExperience) boolean
breakNaturally
(@NotNull org.bukkit.inventory.ItemStack tool, boolean triggerEffect, boolean dropExperience) boolean
breakNaturally
(@Nullable org.bukkit.inventory.ItemStack tool) boolean
breakNaturally
(org.bukkit.inventory.ItemStack tool, boolean triggerEffect) boolean
canPlace
(@NotNull org.bukkit.block.data.BlockData data) void
org.bukkit.block.Biome
getBiome()
org.bukkit.block.data.BlockData
int
int
getBlockPower
(org.bukkit.block.BlockFace face) @NotNull org.bukkit.SoundGroup
org.bukkit.util.BoundingBox
float
getBreakSpeed
(@NotNull org.bukkit.entity.Player player) org.bukkit.Chunk
getChunk()
@NotNull org.bukkit.util.VoxelShape
@NotNull org.bukkit.block.Biome
byte
getData()
@org.jetbrains.annotations.NotNull float
getDestroySpeed
(@NotNull org.bukkit.inventory.ItemStack itemStack, boolean considerEnchants) float
getDestroySpeed
(org.bukkit.inventory.ItemStack itemStack) Collection
<org.bukkit.inventory.ItemStack> getDrops()
Collection
<org.bukkit.inventory.ItemStack> getDrops
(@Nullable org.bukkit.inventory.ItemStack tool) Collection
<org.bukkit.inventory.ItemStack> getDrops
(org.bukkit.inventory.ItemStack tool, @Nullable org.bukkit.entity.Entity entity) @Nullable org.bukkit.block.BlockFace
getFace
(org.bukkit.block.Block block) double
byte
byte
byte
org.bukkit.Location
@Nullable org.bukkit.Location
getLocation
(@Nullable org.bukkit.Location loc) List
<org.bukkit.metadata.MetadataValue> getMetadata
(String metadataKey) org.bukkit.block.PistonMoveReaction
org.bukkit.block.Block
getRelative
(int modX, int modY, int modZ) org.bukkit.block.Block
getRelative
(org.bukkit.block.BlockFace face) org.bukkit.block.Block
getRelative
(org.bukkit.block.BlockFace face, int distance) com.destroystokyo.paper.block.BlockSoundGroup
org.bukkit.block.BlockState
getState()
org.bukkit.block.BlockState
getState
(boolean useSnapshot) double
org.bukkit.Material
getType()
org.bukkit.World
getWorld()
int
getX()
int
getY()
int
getZ()
boolean
hasMetadata
(String metadataKey) boolean
isBlockFaceIndirectlyPowered
(org.bukkit.block.BlockFace face) boolean
isBlockFacePowered
(org.bukkit.block.BlockFace face) boolean
boolean
boolean
boolean
boolean
boolean
isEmpty()
boolean
isLiquid()
boolean
boolean
isPreferredTool
(@NotNull org.bukkit.inventory.ItemStack tool) boolean
boolean
isSolid()
boolean
isValidTool
(@NotNull org.bukkit.inventory.ItemStack itemStack) void
@Nullable org.bukkit.util.RayTraceResult
rayTrace
(org.bukkit.Location start, org.bukkit.util.Vector direction, double maxDistance, org.bukkit.FluidCollisionMode fluidCollisionMode) void
removeMetadata
(String metadataKey, org.bukkit.plugin.Plugin owningPlugin) void
setBiome
(org.bukkit.block.Biome bio) void
setBlockData
(org.bukkit.block.data.BlockData data) void
setBlockData
(org.bukkit.block.data.BlockData data, boolean applyPhysics) void
setMetadata
(String metadataKey, org.bukkit.metadata.MetadataValue newMetadataValue) void
setType
(org.bukkit.Material type) void
setType
(org.bukkit.Material type, boolean applyPhysics) void
tick()
@NotNull String
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bukkit.block.Block
getBlockKey
-
Constructor Details
-
BlockStateBlock
public BlockStateBlock(org.bukkit.block.BlockState state) -
BlockStateBlock
public BlockStateBlock(org.bukkit.block.BlockState state, boolean delayChanges)
-
-
Method Details
-
setMetadata
- Specified by:
setMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
getMetadata
- Specified by:
getMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
hasMetadata
- Specified by:
hasMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
removeMetadata
- Specified by:
removeMetadata
in interfaceorg.bukkit.metadata.Metadatable
-
getData
public byte getData()- Specified by:
getData
in interfaceorg.bukkit.block.Block
-
getRelative
public org.bukkit.block.Block getRelative(int modX, int modY, int modZ) - Specified by:
getRelative
in interfaceorg.bukkit.block.Block
-
getRelative
public org.bukkit.block.Block getRelative(org.bukkit.block.BlockFace face) - Specified by:
getRelative
in interfaceorg.bukkit.block.Block
-
getRelative
public org.bukkit.block.Block getRelative(org.bukkit.block.BlockFace face, int distance) - Specified by:
getRelative
in interfaceorg.bukkit.block.Block
-
getType
public org.bukkit.Material getType()- Specified by:
getType
in interfaceorg.bukkit.block.Block
-
getLightLevel
public byte getLightLevel()- Specified by:
getLightLevel
in interfaceorg.bukkit.block.Block
-
getLightFromSky
public byte getLightFromSky()- Specified by:
getLightFromSky
in interfaceorg.bukkit.block.Block
-
getLightFromBlocks
public byte getLightFromBlocks()- Specified by:
getLightFromBlocks
in interfaceorg.bukkit.block.Block
-
getWorld
public org.bukkit.World getWorld()- Specified by:
getWorld
in interfaceorg.bukkit.block.Block
-
getX
public int getX()- Specified by:
getX
in interfaceorg.bukkit.block.Block
-
getY
public int getY()- Specified by:
getY
in interfaceorg.bukkit.block.Block
-
getZ
public int getZ()- Specified by:
getZ
in interfaceorg.bukkit.block.Block
-
getLocation
public org.bukkit.Location getLocation()- Specified by:
getLocation
in interfaceorg.bukkit.block.Block
-
getChunk
public org.bukkit.Chunk getChunk()- Specified by:
getChunk
in interfaceorg.bukkit.block.Block
-
setType
public void setType(org.bukkit.Material type) - Specified by:
setType
in interfaceorg.bukkit.block.Block
-
getFace
@Nullable public @Nullable org.bukkit.block.BlockFace getFace(org.bukkit.block.Block block) - Specified by:
getFace
in interfaceorg.bukkit.block.Block
-
getState
public org.bukkit.block.BlockState getState()- Specified by:
getState
in interfaceorg.bukkit.block.Block
-
getState
public org.bukkit.block.BlockState getState(boolean useSnapshot) - Specified by:
getState
in interfaceorg.bukkit.block.Block
-
getBiome
public org.bukkit.block.Biome getBiome()- Specified by:
getBiome
in interfaceorg.bukkit.block.Block
-
getComputedBiome
@NotNull public @NotNull org.bukkit.block.Biome getComputedBiome()- Specified by:
getComputedBiome
in interfaceorg.bukkit.block.Block
-
setBiome
public void setBiome(org.bukkit.block.Biome bio) - Specified by:
setBiome
in interfaceorg.bukkit.block.Block
-
isBlockPowered
public boolean isBlockPowered()- Specified by:
isBlockPowered
in interfaceorg.bukkit.block.Block
-
isBlockIndirectlyPowered
public boolean isBlockIndirectlyPowered()- Specified by:
isBlockIndirectlyPowered
in interfaceorg.bukkit.block.Block
-
isBlockFacePowered
public boolean isBlockFacePowered(org.bukkit.block.BlockFace face) - Specified by:
isBlockFacePowered
in interfaceorg.bukkit.block.Block
-
isBlockFaceIndirectlyPowered
public boolean isBlockFaceIndirectlyPowered(org.bukkit.block.BlockFace face) - Specified by:
isBlockFaceIndirectlyPowered
in interfaceorg.bukkit.block.Block
-
getBlockPower
public int getBlockPower(org.bukkit.block.BlockFace face) - Specified by:
getBlockPower
in interfaceorg.bukkit.block.Block
-
getBlockPower
public int getBlockPower()- Specified by:
getBlockPower
in interfaceorg.bukkit.block.Block
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceorg.bukkit.block.Block
-
isLiquid
public boolean isLiquid()- Specified by:
isLiquid
in interfaceorg.bukkit.block.Block
-
isBuildable
public boolean isBuildable()- Specified by:
isBuildable
in interfaceorg.bukkit.block.Block
-
isBurnable
public boolean isBurnable()- Specified by:
isBurnable
in interfaceorg.bukkit.block.Block
-
isReplaceable
public boolean isReplaceable()- Specified by:
isReplaceable
in interfaceorg.bukkit.block.Block
-
isSolid
public boolean isSolid()- Specified by:
isSolid
in interfaceorg.bukkit.block.Block
-
isCollidable
public boolean isCollidable()- Specified by:
isCollidable
in interfaceorg.bukkit.block.Block
-
getTemperature
public double getTemperature()- Specified by:
getTemperature
in interfaceorg.bukkit.block.Block
-
getHumidity
public double getHumidity()- Specified by:
getHumidity
in interfaceorg.bukkit.block.Block
-
getPistonMoveReaction
public org.bukkit.block.PistonMoveReaction getPistonMoveReaction()- Specified by:
getPistonMoveReaction
in interfaceorg.bukkit.block.Block
-
breakNaturally
public boolean breakNaturally()- Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
breakNaturally
public boolean breakNaturally(@Nullable @Nullable org.bukkit.inventory.ItemStack tool) - Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
breakNaturally
public boolean breakNaturally(boolean triggerEffect) - Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
breakNaturally
public boolean breakNaturally(org.bukkit.inventory.ItemStack tool, boolean triggerEffect) - Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
tick
public void tick()- Specified by:
tick
in interfaceorg.bukkit.block.Block
-
fluidTick
public void fluidTick()- Specified by:
fluidTick
in interfaceorg.bukkit.block.Block
-
randomTick
public void randomTick()- Specified by:
randomTick
in interfaceorg.bukkit.block.Block
-
applyBoneMeal
public boolean applyBoneMeal(org.bukkit.block.BlockFace blockFace) - Specified by:
applyBoneMeal
in interfaceorg.bukkit.block.Block
-
getDrops
- Specified by:
getDrops
in interfaceorg.bukkit.block.Block
-
getDrops
public Collection<org.bukkit.inventory.ItemStack> getDrops(@Nullable @Nullable org.bukkit.inventory.ItemStack tool) - Specified by:
getDrops
in interfaceorg.bukkit.block.Block
-
getDrops
public Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.inventory.ItemStack tool, @Nullable @Nullable org.bukkit.entity.Entity entity) - Specified by:
getDrops
in interfaceorg.bukkit.block.Block
-
getLocation
@Nullable public @Nullable org.bukkit.Location getLocation(@Nullable @Nullable org.bukkit.Location loc) - Specified by:
getLocation
in interfaceorg.bukkit.block.Block
-
setType
public void setType(org.bukkit.Material type, boolean applyPhysics) - Specified by:
setType
in interfaceorg.bukkit.block.Block
-
getBlockData
public org.bukkit.block.data.BlockData getBlockData()- Specified by:
getBlockData
in interfaceorg.bukkit.block.Block
-
setBlockData
public void setBlockData(org.bukkit.block.data.BlockData data) - Specified by:
setBlockData
in interfaceorg.bukkit.block.Block
-
setBlockData
public void setBlockData(org.bukkit.block.data.BlockData data, boolean applyPhysics) - Specified by:
setBlockData
in interfaceorg.bukkit.block.Block
-
rayTrace
@Nullable 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 interfaceorg.bukkit.block.Block
-
isPassable
public boolean isPassable()- Specified by:
isPassable
in interfaceorg.bukkit.block.Block
-
getBoundingBox
public org.bukkit.util.BoundingBox getBoundingBox()- Specified by:
getBoundingBox
in interfaceorg.bukkit.block.Block
-
getSoundGroup
public com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup()- Specified by:
getSoundGroup
in interfaceorg.bukkit.block.Block
-
getBlockSoundGroup
@NotNull public @NotNull org.bukkit.SoundGroup getBlockSoundGroup()- Specified by:
getBlockSoundGroup
in interfaceorg.bukkit.block.Block
-
getTranslationKey
- Specified by:
getTranslationKey
in interfaceorg.bukkit.block.Block
- Specified by:
getTranslationKey
in interfaceorg.bukkit.Translatable
-
getDestroySpeed
public float getDestroySpeed(org.bukkit.inventory.ItemStack itemStack) - Specified by:
getDestroySpeed
in interfaceorg.bukkit.block.Block
-
isPreferredTool
public boolean isPreferredTool(@NotNull @NotNull org.bukkit.inventory.ItemStack tool) - Specified by:
isPreferredTool
in interfaceorg.bukkit.block.Block
-
isValidTool
public boolean isValidTool(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) - Specified by:
isValidTool
in interfaceorg.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 interfaceorg.bukkit.block.Block
-
getCollisionShape
@NotNull public @NotNull org.bukkit.util.VoxelShape getCollisionShape()- Specified by:
getCollisionShape
in interfaceorg.bukkit.block.Block
-
canPlace
public boolean canPlace(@NotNull @NotNull org.bukkit.block.data.BlockData data) - Specified by:
canPlace
in interfaceorg.bukkit.block.Block
-
getBreakSpeed
public float getBreakSpeed(@NotNull @NotNull org.bukkit.entity.Player player) - Specified by:
getBreakSpeed
in interfaceorg.bukkit.block.Block
-
translationKey
- Specified by:
translationKey
in interfacenet.kyori.adventure.translation.Translatable
-
breakNaturally
public boolean breakNaturally(boolean triggerEffect, boolean dropExperience) - Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
breakNaturally
public boolean breakNaturally(@NotNull @NotNull org.bukkit.inventory.ItemStack tool, boolean triggerEffect, boolean dropExperience) - Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-