public class BlockDoublePlant extends BlockNeedsAttached implements IBlockGrowable
ItemType.Context
ADJACENT, drops, placeSound, SIDES
Constructor and Description |
---|
BlockDoublePlant() |
Modifier and Type | Method and Description |
---|---|
void |
afterPlace(GlowPlayer player,
GlowBlock block,
org.bukkit.inventory.ItemStack holding,
GlowBlockState oldState)
Called after a block has been placed by a player.
|
void |
blockDestroy(GlowPlayer player,
GlowBlock block,
org.bukkit.block.BlockFace face)
Called when a player attempts to destroy a block.
|
boolean |
canAbsorb(GlowBlock block,
org.bukkit.block.BlockFace face,
org.bukkit.inventory.ItemStack holding)
Called when a player attempts to place a block on an existing block of this type.
|
boolean |
canGrowWithChance(GlowBlock block)
Called to check if the block will effectively grow.
|
boolean |
canPlaceAt(GlowPlayer player,
GlowBlock block,
org.bukkit.block.BlockFace against)
Check whether the block can be placed at the given location.
|
Collection<org.bukkit.inventory.ItemStack> |
getDrops(GlowBlock block,
org.bukkit.inventory.ItemStack tool)
Get the items that will be dropped by digging the block.
|
void |
grow(GlowPlayer player,
GlowBlock block)
Called to grow a growable block.
|
boolean |
isFertilizable(GlowBlock block)
Called to check if a block can be fertilized.
|
canAttachTo, dropMe, getAttachedFace, onNearBlockChanged, updatePhysicsAfterEvent
afterDestroy, blockInteract, canOverride, canTickRandomly, createBlockEntity, getMinedDrops, getOppositeBlockFace, getPlaceAs, getPlaceSound, getPulseTickSpeed, isPulseOnce, leftClickBlock, onBlockChanged, onEntityStep, onRedstoneUpdate, placeBlock, receivePulse, requestPulse, rightClickBlock, setDrops, setPlaceSound, updateBlock, updatePhysics, warnMaterialData
getContext, getId, getMaterial, getMaxStackSize, rightClickAir, setId, setMaterial, setMaxStackSize, setPlaceAs, setPlaceAs, toString
public boolean canPlaceAt(GlowPlayer player, GlowBlock block, org.bukkit.block.BlockFace against)
BlockType
canPlaceAt
in class BlockNeedsAttached
player
- The player who placed the block.block
- The location the block is being placed at.against
- The face the block is being placed against.public void afterPlace(GlowPlayer player, GlowBlock block, org.bukkit.inventory.ItemStack holding, GlowBlockState oldState)
BlockType
afterPlace
in class BlockType
player
- the player who placed the blockblock
- the block that was placedholding
- the the ItemStack that was being heldoldState
- The old block state before the block was placed.public Collection<org.bukkit.inventory.ItemStack> getDrops(GlowBlock block, org.bukkit.inventory.ItemStack tool)
BlockType
public void blockDestroy(GlowPlayer player, GlowBlock block, org.bukkit.block.BlockFace face)
BlockType
blockDestroy
in class BlockType
player
- The player interactingblock
- The block the player destroyedface
- The block facepublic boolean isFertilizable(GlowBlock block)
IBlockGrowable
isFertilizable
in interface IBlockGrowable
block
- the targeted block to fertilizepublic boolean canGrowWithChance(GlowBlock block)
IBlockGrowable
canGrowWithChance
in interface IBlockGrowable
block
- the targeted block to growpublic void grow(GlowPlayer player, GlowBlock block)
IBlockGrowable
grow
in interface IBlockGrowable
player
- the player who triggered the growth, this can be null if the growth is natural
or by plugin sourceblock
- the targeted block to growpublic boolean canAbsorb(GlowBlock block, org.bukkit.block.BlockFace face, org.bukkit.inventory.ItemStack holding)
BlockType
Copyright © 2021. All rights reserved.