public class BlockSource
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
BlockSource.BlockSourceType
An enum representation of the source types available for bending
abilities.
|
Constructor and Description |
---|
BlockSource() |
Modifier and Type | Method and Description |
---|---|
static BlockSourceInformation |
getBlockSourceInformation(org.bukkit.entity.Player player,
BlockSource.BlockSourceType sourceType,
ClickType clickType)
Access a block's source information, depending on a
BlockSource.BlockSourceType and ClickType . |
static org.bukkit.block.Block |
getEarthOrLavaSourceBlock(org.bukkit.entity.Player player,
double range,
ClickType clickType)
Attempts to access a Lava bendable block or an Earth block that was
recently shifted or clicked on by the player.
|
static org.bukkit.block.Block |
getEarthSourceBlock(org.bukkit.entity.Player player,
double range,
ClickType clickType)
Attempts to access a Earth bendable block that was recently shifted or
clicked on by the player.
|
static org.bukkit.block.Block |
getEarthSourceBlock(org.bukkit.entity.Player player,
double range,
ClickType clickType,
boolean allowNearbySubstitute)
Attempts to access a Earth bendable block that was recently shifted or
clicked on by the player.
|
static org.bukkit.block.Block |
getLavaSourceBlock(org.bukkit.entity.Player player,
double range,
ClickType clickType)
Attempts to access a Lava bendable block that was recently shifted or
clicked on by the player.
|
static org.bukkit.block.Block |
getSourceBlock(org.bukkit.entity.Player player,
double range,
BlockSource.BlockSourceType sourceType,
ClickType clickType)
Access a specific type of source block depending on a range and
ClickType . |
static BlockSourceInformation |
getValidBlockSourceInformation(org.bukkit.entity.Player player,
double range,
BlockSource.BlockSourceType sourceType,
ClickType clickType)
Access a block source information depending on a range,
BlockSource.BlockSourceType , and ClickType . |
static org.bukkit.block.Block |
getWaterSourceBlock(org.bukkit.entity.Player player,
double range)
Attempts to access a Water bendable block that was recently shifted or
clicked on by the player.
|
static org.bukkit.block.Block |
getWaterSourceBlock(org.bukkit.entity.Player player,
double range,
boolean allowWater,
boolean allowIce,
boolean allowPlant)
Attempts to access a Water bendable block that was recently shifted or
clicked on by the player.
|
static org.bukkit.block.Block |
getWaterSourceBlock(org.bukkit.entity.Player player,
double range,
ClickType clickType)
Attempts to access a Water bendable block that was recently shifted or
clicked on by the player.
|
static org.bukkit.block.Block |
getWaterSourceBlock(org.bukkit.entity.Player player,
double range,
ClickType clickType,
boolean allowWater,
boolean allowIce,
boolean allowPlant)
Attempts to access a Water bendable block that was recently shifted or
clicked on by the player.
|
static org.bukkit.block.Block |
getWaterSourceBlock(org.bukkit.entity.Player player,
double range,
ClickType clickType,
boolean allowWater,
boolean allowIce,
boolean allowPlant,
boolean allowSnow,
boolean allowWaterBottles)
Attempts to access a Water bendable block that was recently shifted or
clicked on by the player.
|
static void |
update(org.bukkit.entity.Player player,
ClickType clickType)
Updates all of the player's sources.
|
public static void update(org.bukkit.entity.Player player, ClickType clickType)
player
- the player performing the bending.clickType
- either ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICKpublic static BlockSourceInformation getBlockSourceInformation(org.bukkit.entity.Player player, BlockSource.BlockSourceType sourceType, ClickType clickType)
BlockSource.BlockSourceType
and ClickType
.player
- the player that is trying to bend.clickType
- the action that was performed to access the source, either
ClickType.SHIFT_DOWN or ClickType.LEFT_CLICK.public static BlockSourceInformation getValidBlockSourceInformation(org.bukkit.entity.Player player, double range, BlockSource.BlockSourceType sourceType, ClickType clickType)
BlockSource.BlockSourceType
, and ClickType
.player
- the player that is trying to bend.range
- the maximum range to access the block.sourceType
- the elemental type of block to find.clickType
- the action that was performed to access the source, either
ClickType.SHIFT_DOWN or ClickType.LEFT_CLICK.public static org.bukkit.block.Block getSourceBlock(org.bukkit.entity.Player player, double range, BlockSource.BlockSourceType sourceType, ClickType clickType)
ClickType
.player
- the player that is trying to bend.range
- the maximum range to access the block.sourceType
- the elemental type of block to find.clickType
- the action that was performed to access the source, either
ClickType.SHIFT_DOWN or ClickType.LEFT_CLICK.public static org.bukkit.block.Block getWaterSourceBlock(org.bukkit.entity.Player player, double range)
player
- the player that is trying to bend.range
- the maximum range to access the block.public static org.bukkit.block.Block getWaterSourceBlock(org.bukkit.entity.Player player, double range, ClickType clickType)
player
- the player that is trying to bend.range
- the maximum range to access the block.clickType
- the action that was performed to access the source, either
ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICK.public static org.bukkit.block.Block getWaterSourceBlock(org.bukkit.entity.Player player, double range, boolean allowWater, boolean allowIce, boolean allowPlant)
player
- the player that is trying to bend.range
- the maximum range to access the block.allowWater
- true if water blocks are allowed.allowIce
- true if ice blocks are allowed.allowPlant
- true if plant blocks are allowed.public static org.bukkit.block.Block getWaterSourceBlock(org.bukkit.entity.Player player, double range, ClickType clickType, boolean allowWater, boolean allowIce, boolean allowPlant)
player
- the player that is trying to bend.range
- the maximum range to access the block.clickType
- the action that was performed to access the source, either
ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICK.allowWater
- true if water blocks are allowed.allowIce
- true if ice blocks are allowed.allowPlant
- true if plant blocks are allowed.public static org.bukkit.block.Block getWaterSourceBlock(org.bukkit.entity.Player player, double range, ClickType clickType, boolean allowWater, boolean allowIce, boolean allowPlant, boolean allowSnow, boolean allowWaterBottles)
player
- the player that is trying to bend.range
- the maximum range to access the block.clickType
- the action that was performed to access the source, either
ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICK.allowWater
- true if water blocks are allowed.allowIce
- true if ice blocks are allowed.allowPlant
- true if plant blocks are allowed.allowWaterBottles
- true if we should look for a close water block, that may have
been created by a WaterBottle.public static org.bukkit.block.Block getEarthSourceBlock(org.bukkit.entity.Player player, double range, ClickType clickType)
player
- the player that is trying to bend.range
- the maximum range to access the block.clickType
- the action that was performed to access the source, either
ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICK.public static org.bukkit.block.Block getEarthSourceBlock(org.bukkit.entity.Player player, double range, ClickType clickType, boolean allowNearbySubstitute)
player
- the player that is trying to bend.range
- the maximum range to access the block.clickType
- the action that was performed to access the source, either
ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICK.allowNearbySubstitute
- if a valid earth source could not be found then this method
will attempt to find a nearby valid earth block.public static org.bukkit.block.Block getLavaSourceBlock(org.bukkit.entity.Player player, double range, ClickType clickType)
player
- the player that is trying to bend.range
- the maximum range to access the block.clickType
- the action that was performed to access the source, either
ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICK.public static org.bukkit.block.Block getEarthOrLavaSourceBlock(org.bukkit.entity.Player player, double range, ClickType clickType)
player
- the player that is trying to bend.range
- the maximum range to access the block.clickType
- the action that was performed to access the source, either
ClickType
.SHIFT_DOWN or ClickType.LEFT_CLICK.