Package net.glowstone.block
Class GlowBlock
java.lang.Object
net.glowstone.block.GlowBlock
- All Implemented Interfaces:
org.bukkit.block.Block
,org.bukkit.metadata.Metadatable
Represents a single block in a world.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
applyBoneMeal
(@NotNull org.bukkit.block.BlockFace blockFace) 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.boolean
boolean
breakNaturally
(float yield) Break the block naturally, randomly dropping only some of the drops.boolean
breakNaturally
(float yield, Collection<org.bukkit.inventory.ItemStack> drops) Breaks this block and drops items.boolean
breakNaturally
(@NotNull org.bukkit.inventory.ItemStack tool, boolean triggerEffect) boolean
breakNaturally
(org.bukkit.inventory.ItemStack tool) void
count
(int timeout) Increments the count of recent state changes.boolean
@NotNull org.bukkit.block.Biome
getBiome()
@NotNull org.bukkit.block.data.BlockData
int
int
getBlockPower
(org.bukkit.block.BlockFace face) @NotNull org.bukkit.util.BoundingBox
@NotNull GlowChunk
getChunk()
int
Returns the number of recent state changes, as defined bycount(int)
.byte
getData()
@org.jetbrains.annotations.NotNull float
getDestroySpeed
(@NotNull org.bukkit.inventory.ItemStack tool) @org.jetbrains.annotations.NotNull float
getDestroySpeed
(@NotNull org.bukkit.inventory.ItemStack itemStack, boolean considerEnchants) Collection<org.bukkit.inventory.ItemStack>
getDrops()
@NotNull Collection<org.bukkit.inventory.ItemStack>
getDrops
(@NotNull org.bukkit.inventory.ItemStack tool, @Nullable org.bukkit.entity.Entity entity) Collection<org.bukkit.inventory.ItemStack>
getDrops
(org.bukkit.inventory.ItemStack tool) org.bukkit.block.BlockFace
getFace
(@NotNull org.bukkit.block.Block block) double
int
getId()
byte
byte
byte
@NotNull org.bukkit.Location
org.bukkit.Location
getLocation
(org.bukkit.Location loc) List<org.bukkit.metadata.MetadataValue>
getMetadata
(String metadataKey) @NotNull org.bukkit.block.PistonMoveReaction
@NotNull GlowBlock
getRelative
(int modX, int modY, int modZ) @NotNull GlowBlock
getRelative
(org.bukkit.block.BlockFace face) @NotNull GlowBlock
getRelative
(org.bukkit.block.BlockFace face, int distance) @NotNull com.destroystokyo.paper.block.BlockSoundGroup
@NotNull GlowBlockState
getState()
@NotNull GlowBlockState
getState
(boolean useSnapshot) double
@NotNull String
@NotNull org.bukkit.Material
getType()
getWorld()
int
getX()
int
getY()
int
getZ()
int
hashCode()
boolean
hasMetadata
(String metadataKey) boolean
isBlockFaceIndirectlyPowered
(org.bukkit.block.BlockFace face) boolean
isBlockFacePowered
(org.bukkit.block.BlockFace face) boolean
boolean
boolean
boolean
Get block material's burn ability.boolean
isEmpty()
boolean
Get block material's flammable ability.boolean
isLiquid()
boolean
boolean
isPreferredTool
(@NotNull org.bukkit.inventory.ItemStack itemStack) boolean
boolean
isSolid()
boolean
isValidTool
(@NotNull org.bukkit.inventory.ItemStack itemStack) @Nullable org.bukkit.util.RayTraceResult
rayTrace
(@NotNull org.bukkit.Location start, @NotNull org.bukkit.util.Vector direction, double maxDistance, @NotNull org.bukkit.FluidCollisionMode fluidCollisionMode) void
removeMetadata
(@NotNull String metadataKey, @NotNull org.bukkit.plugin.Plugin owningPlugin) void
setBiome
(@NotNull org.bukkit.block.Biome bio) void
setBlockData
(@NotNull org.bukkit.block.data.BlockData data) void
setBlockData
(@NotNull org.bukkit.block.data.BlockData data, boolean applyPhysics) void
setData
(byte data) void
setData
(byte 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) Set the Material type of a block and optionally apply physics.void
setType
(org.bukkit.Material type, byte data, boolean applyPhysics) Set the Material type of a block with data and optionally apply physics.boolean
setTypeId
(int type) Deprecated.boolean
setTypeId
(int type, boolean applyPhysics) Deprecated.boolean
setTypeIdAndData
(int type, byte data, boolean applyPhysics) Deprecated.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bukkit.block.Block
getBlockKey
-
Constructor Details
-
GlowBlock
Creates an object to refer to a block.- Parameters:
chunk
- the chunkx
- the X coordinatey
- the Y coordinatez
- the Z coordinate
-
-
Method Details
-
getChunk
- Specified by:
getChunk
in interfaceorg.bukkit.block.Block
-
getLocation
@NotNull public @NotNull org.bukkit.Location getLocation()- Specified by:
getLocation
in interfaceorg.bukkit.block.Block
-
getLocation
public org.bukkit.Location getLocation(org.bukkit.Location loc) - Specified by:
getLocation
in interfaceorg.bukkit.block.Block
-
getBlockEntity
-
getState
- Specified by:
getState
in interfaceorg.bukkit.block.Block
-
getState
- Specified by:
getState
in interfaceorg.bukkit.block.Block
-
getBiome
@NotNull public @NotNull org.bukkit.block.Biome getBiome()- Specified by:
getBiome
in interfaceorg.bukkit.block.Block
-
setBiome
public void setBiome(@NotNull @NotNull org.bukkit.block.Biome bio) - Specified by:
setBiome
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
-
getFace
public org.bukkit.block.BlockFace getFace(@NotNull @NotNull org.bukkit.block.Block block) - Specified by:
getFace
in interfaceorg.bukkit.block.Block
-
getRelative
- Specified by:
getRelative
in interfaceorg.bukkit.block.Block
-
getRelative
- Specified by:
getRelative
in interfaceorg.bukkit.block.Block
-
getRelative
- Specified by:
getRelative
in interfaceorg.bukkit.block.Block
-
getType
@NotNull public @NotNull org.bukkit.Material getType()- Specified by:
getType
in interfaceorg.bukkit.block.Block
-
getId
public int getId() -
setType
public void setType(org.bukkit.Material type) - Specified by:
setType
in interfaceorg.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 interfaceorg.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. -
setTypeId
Deprecated. -
setTypeIdAndData
Deprecated. -
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
-
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 interfaceorg.bukkit.block.Block
- Returns:
- if this block is burnable
-
isReplaceable
public boolean isReplaceable()- Specified by:
isReplaceable
in interfaceorg.bukkit.block.Block
-
isSolid
public boolean isSolid()- Specified by:
isSolid
in interfaceorg.bukkit.block.Block
-
getMaterialValues
-
getData
public byte getData()- Specified by:
getData
in interfaceorg.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 interfaceorg.bukkit.block.Block
-
setBlockData
public void setBlockData(@NotNull @NotNull org.bukkit.block.data.BlockData data) - Specified by:
setBlockData
in interfaceorg.bukkit.block.Block
-
getBlockData
@NotNull public @NotNull org.bukkit.block.data.BlockData getBlockData()- Specified by:
getBlockData
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
-
isValidTool
public boolean isValidTool(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) - Specified by:
isValidTool
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
-
getPistonMoveReaction
@NotNull public @NotNull org.bukkit.block.PistonMoveReaction getPistonMoveReaction()- Specified by:
getPistonMoveReaction
in interfaceorg.bukkit.block.Block
-
toString
-
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
Breaks this block and drops items.- Parameters:
yield
- the probability to drop each itemdrops
- the items to potentially drop- Returns:
- true if broken; false if this block is already air
-
breakNaturally
public boolean breakNaturally()- Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
breakNaturally
public boolean breakNaturally(org.bukkit.inventory.ItemStack tool) - Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
breakNaturally
public boolean breakNaturally(@NotNull @NotNull org.bukkit.inventory.ItemStack tool, boolean triggerEffect) - Specified by:
breakNaturally
in interfaceorg.bukkit.block.Block
-
applyBoneMeal
public boolean applyBoneMeal(@NotNull @NotNull org.bukkit.block.BlockFace blockFace) - Specified by:
applyBoneMeal
in interfaceorg.bukkit.block.Block
-
getDrops
- Specified by:
getDrops
in interfaceorg.bukkit.block.Block
-
getDrops
- Specified by:
getDrops
in interfaceorg.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 interfaceorg.bukkit.block.Block
-
isPreferredTool
public boolean isPreferredTool(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) - Specified by:
isPreferredTool
in interfaceorg.bukkit.block.Block
-
isPassable
public boolean isPassable()- Specified by:
isPassable
in interfaceorg.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 interfaceorg.bukkit.block.Block
-
getBoundingBox
@NotNull public @NotNull org.bukkit.util.BoundingBox getBoundingBox()- Specified by:
getBoundingBox
in interfaceorg.bukkit.block.Block
-
getSoundGroup
@NotNull public @NotNull com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup()- Specified by:
getSoundGroup
in interfaceorg.bukkit.block.Block
-
getTranslationKey
- Specified by:
getTranslationKey
in interfaceorg.bukkit.block.Block
-
getDestroySpeed
@NotNull public @org.jetbrains.annotations.NotNull float getDestroySpeed(@NotNull @NotNull org.bukkit.inventory.ItemStack tool) - Specified by:
getDestroySpeed
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
-
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
public void removeMetadata(@NotNull @NotNull String metadataKey, @NotNull @NotNull org.bukkit.plugin.Plugin owningPlugin) - Specified by:
removeMetadata
in interfaceorg.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 typenewType
- the new block typeoldData
- the old datanewData
- 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 bycount(int)
. Used to implement redstone-torch burnout.- Returns:
- the number of recent state changes
-
hashCode
public int hashCode() -
equals
-
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
-
getWorld
- Specified by:
getWorld
in interfaceorg.bukkit.block.Block
-