public class BlockResponse
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static BlockResponse |
CUSTOM
A response indicating success, but that that ExperienceMod should leave everything up to the caller.
|
static BlockResponse |
FAILURE
A response indicating failure.
|
Constructor and Description |
---|
BlockResponse(boolean success) |
BlockResponse(boolean success,
org.bukkit.event.inventory.InventoryType defaultBehavior,
java.lang.String actionType,
java.lang.String permission) |
BlockResponse(org.bukkit.event.inventory.InventoryType defaultBehavior,
java.lang.String actionType,
java.lang.String permission) |
BlockResponse(java.lang.String actionType,
java.lang.String permission) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getActionType()
Retrieves the current action type (or trigger).
|
org.bukkit.inventory.ItemStack |
getCurrentItem()
The current item to override with InventoryClickEvent.
|
org.bukkit.event.inventory.InventoryType |
getDefaultBehavior()
Retrieves the default behavior that will handle the inventory event.
|
org.bukkit.inventory.ItemStack |
getOverridableCurrentItem(org.bukkit.event.inventory.InventoryClickEvent event)
If override current is FALSE, return the current item in the given event.
|
java.lang.String |
getPermission()
Retrieves the permission this player must have in order to be rewarded.
|
boolean |
hasDefaultBehavior()
Whether or not this response contains a default behavior.
|
int |
hashCode() |
boolean |
isForceHack()
Whether or not to always derive the crafted items from how the player inventory changed.
|
boolean |
isOverrideCurrent()
Whether or not to override the default current item in InventoryClickEvent.
|
boolean |
isSuccess()
Whether or not this block provider can handle the current inventory event.
|
static boolean |
isSuccessful(BlockResponse response)
Determines if a given block response is successful.
|
void |
setActionType(java.lang.String actionType)
Sets the current action type.
|
void |
setCurrentItem(org.bukkit.inventory.ItemStack currentItem)
Sets the current overriden item (if isOverrideCurrent is TRUE).
|
void |
setDefaultBehavior(org.bukkit.event.inventory.InventoryType defaultBehavior)
Sets the default behavior that will handle the inventory event.
|
void |
setForceHack(boolean forceHack)
Sets whether or not to always derive the crafted items from how the player inventory changed.
|
void |
setOverrideCurrent(boolean overrideCurrent)
Sets whether or not to override the default current item in InventoryClickEvent.
|
void |
setPermission(java.lang.String permission)
Sets the permission the player must have in order to be rewarded.
|
java.lang.String |
toString() |
public static BlockResponse FAILURE
public static BlockResponse CUSTOM
public BlockResponse(java.lang.String actionType, java.lang.String permission)
public BlockResponse(org.bukkit.event.inventory.InventoryType defaultBehavior, java.lang.String actionType, java.lang.String permission)
public BlockResponse(boolean success)
public BlockResponse(boolean success, org.bukkit.event.inventory.InventoryType defaultBehavior, java.lang.String actionType, java.lang.String permission)
public boolean isSuccess()
public org.bukkit.event.inventory.InventoryType getDefaultBehavior()
public void setDefaultBehavior(org.bukkit.event.inventory.InventoryType defaultBehavior)
defaultBehavior
- - new default behavior, or NULL for a custom behavior.public boolean hasDefaultBehavior()
public static boolean isSuccessful(BlockResponse response)
response
- - block response to test.public boolean isForceHack()
public void setForceHack(boolean forceHack)
forceHack
- - TRUE to force the hack method, FALSE otherwise.public java.lang.String getActionType()
public void setActionType(java.lang.String actionType)
actionType
- - new action type.public boolean isOverrideCurrent()
public void setOverrideCurrent(boolean overrideCurrent)
overrideCurrent
- - TRUE to override it, FALSE otherwise.public org.bukkit.inventory.ItemStack getCurrentItem()
public void setCurrentItem(org.bukkit.inventory.ItemStack currentItem)
currentItem
- - the new overriden item.public java.lang.String getPermission()
public void setPermission(java.lang.String permission)
permission
- - the new permission the player must have.public org.bukkit.inventory.ItemStack getOverridableCurrentItem(org.bukkit.event.inventory.InventoryClickEvent event)
event
- - event to draw from.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object