Package net.glowstone.block.blocktype
Class BlockObserver
java.lang.Object
net.glowstone.block.itemtype.ItemType
net.glowstone.block.blocktype.BlockType
net.glowstone.block.blocktype.BlockDirectional
net.glowstone.block.blocktype.BlockObserver
-
Nested Class Summary
Nested classes/interfaces inherited from class net.glowstone.block.itemtype.ItemType
ItemType.Context
-
Field Summary
Fields inherited from class net.glowstone.block.blocktype.BlockType
ADJACENT, drops, placeSound, SIDES, soundGroup
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.block.BlockFace
Returns the direction the given block is facing, if it's an observer, or null otherwise.static boolean
void
onNearBlockChanged
(GlowBlock block, org.bukkit.block.BlockFace face, GlowBlock changedBlock, org.bukkit.Material oldType, byte oldData, org.bukkit.Material newType, byte newData) Called when a neighboring block (within a 3x3x3 cube) has changed its type or data and physics checks should occur.void
receivePulse
(GlowBlock block) Called when the BlockType gets pulsed as requested.Methods inherited from class net.glowstone.block.blocktype.BlockDirectional
calculateFace, getFace, getRawFace, placeBlock
Methods inherited from class net.glowstone.block.blocktype.BlockType
afterDestroy, afterPlace, blockDestroy, blockInteract, canAbsorb, canOverride, canPlaceAt, canTickRandomly, createBlockEntity, getCastedBlockData, getDrops, getMinedDrops, getOppositeBlockFace, getPlaceAs, getPlaceSound, getPulseTickSpeed, getSoundGroup, isPulseOnce, leftClickBlock, onBlockChanged, onEntityStep, onRedstoneUpdate, requestPulse, rightClickBlock, setDrops, setPlaceSound, updateBlock, updatePhysics, updatePhysicsAfterEvent, warnMaterialData
Methods inherited from class net.glowstone.block.itemtype.ItemType
getContext, getMaterial, getMaterials, getMaxStackSize, rightClickAir, setMaterial, setMaxStackSize, setPlaceAs, setPlaceAs, toString
-
Constructor Details
-
BlockObserver
public BlockObserver()
-
-
Method Details
-
isPowered
-
getFace
Returns the direction the given block is facing, if it's an observer, or null otherwise.- Parameters:
block
- a block- Returns:
- the direction the block is facing, or null if the block isn't an observer
-
onNearBlockChanged
public void onNearBlockChanged(GlowBlock block, org.bukkit.block.BlockFace face, GlowBlock changedBlock, org.bukkit.Material oldType, byte oldData, org.bukkit.Material newType, byte newData) Description copied from class:BlockType
Called when a neighboring block (within a 3x3x3 cube) has changed its type or data and physics checks should occur.- Overrides:
onNearBlockChanged
in classBlockType
- Parameters:
block
- The block to perform physics checks forface
- The BlockFace to the changed block, or null if unavailablechangedBlock
- The neighboring block that has changedoldType
- The old type of the changed blockoldData
- The old data of the changed blocknewType
- The new type of the changed blocknewData
- The new data of the changed block
-
receivePulse
Description copied from class:BlockType
Called when the BlockType gets pulsed as requested.- Overrides:
receivePulse
in classBlockType
- Parameters:
block
- The block that was pulsed
-