public interface GeneralUtil
Modifier and Type | Method and Description |
---|---|
CrossVersionMaterial |
getBlockType(org.bukkit.block.Block block)
Get the material type of the block.
|
CrossVersionMaterial |
getBlockType(org.bukkit.ChunkSnapshot snapshot,
int x,
int y,
int z)
Get the material of the block in the chunk snapshot at the specified coordinates.
|
int |
getId(org.bukkit.map.MapView view)
Get the id of the MapView as an integer.
|
CrossVersionMaterial |
getItemType(org.bukkit.inventory.ItemStack item)
Get the material type of the item.
|
org.bukkit.inventory.ItemStack |
getMainHandItem(org.bukkit.entity.Player player)
Get the item in the player's main hand
|
org.bukkit.map.MapView |
getMap(int id)
Get a MapView for the id provided.
|
org.bukkit.inventory.ItemStack |
getMapItem(int id)
Get a filled map item with the mapview of the given id.
|
org.bukkit.Material |
getMapMaterial()
Get the material for a filled map.
|
org.bukkit.map.MapView |
getMapViewFrom(org.bukkit.inventory.ItemStack item)
Get the a MapView from a map item.
|
org.bukkit.inventory.ItemStack |
getOffHandItem(org.bukkit.entity.Player player)
Get the item in the player's off hand
|
boolean |
isValidHand(org.bukkit.event.player.PlayerInteractEvent event)
Check if the event is called with the player's main hand.
|
boolean |
isWater(org.bukkit.block.Block block)
Check if a block is water.
|
boolean |
isWater(org.bukkit.ChunkSnapshot snapshot,
int x,
int y,
int z)
Check if a block at the given position is water.
|
boolean |
updateEvent(org.bukkit.event.block.BlockPhysicsEvent event)
Check if this event is significant enough to require updating.
|
org.bukkit.map.MapView getMapViewFrom(org.bukkit.inventory.ItemStack item)
item
- A map item, may be null.org.bukkit.map.MapView getMap(int id)
id
- The id of the map, may not work for values above 32767 depending on the version of Minecraft.int getId(org.bukkit.map.MapView view)
view
- Cannot be null.org.bukkit.inventory.ItemStack getMapItem(int id)
id
- An integer, may have to be below 32767 depending on the version of Minecraft.org.bukkit.Material getMapMaterial()
boolean isValidHand(org.bukkit.event.player.PlayerInteractEvent event)
event
- Cannot be null.org.bukkit.inventory.ItemStack getMainHandItem(org.bukkit.entity.Player player)
player
- The player, cannot be null.org.bukkit.inventory.ItemStack getOffHandItem(org.bukkit.entity.Player player)
player
- The player, cannot null.boolean isWater(org.bukkit.ChunkSnapshot snapshot, int x, int y, int z)
snapshot
- The snapshot to checkx
- X coordinate from 0 to 15.y
- Y coordinate from 0 to 255z
- Z coordinate from 0 to 15.boolean isWater(org.bukkit.block.Block block)
block
- The block to check, cannot be null.CrossVersionMaterial getBlockType(org.bukkit.ChunkSnapshot snapshot, int x, int y, int z)
snapshot
- Cannot be null.x
- Local x value from 0 to 15.y
- Local y value from 0 to 255.z
- Local z value from 0 to 15.CrossVersionMaterial
representing the type.CrossVersionMaterial getItemType(org.bukkit.inventory.ItemStack item)
item
- Cannot be null.CrossVersionMaterial
representing the type.CrossVersionMaterial getBlockType(org.bukkit.block.Block block)
block
- Cannot be null.CrossVersionMaterial
representing the type.boolean updateEvent(org.bukkit.event.block.BlockPhysicsEvent event)
event
- Cannot be null.