public interface StackedObject<T>
Modifier and Type | Method and Description |
---|---|
boolean |
canStackInto(StackedObject stackedObject)
Deprecated.
See runStackCheck
|
org.bukkit.Location |
getLocation()
Get the location of the object.
|
int |
getMergeRadius()
Get the merge radius of the object.
|
int |
getStackAmount()
Get the stack amount
|
int |
getStackLimit()
Get the stack limit
|
org.bukkit.World |
getWorld()
Get the world of the object.
|
boolean |
isBlacklisted()
Checks if an object is blacklisted.
|
boolean |
isCached()
Whether or not the object is cached.
|
boolean |
isSimilar(StackedObject stackedObject)
Checks if this object is similar to another object.
|
boolean |
isWhitelisted()
Checks if an object is whitelisted.
|
boolean |
isWorldDisabled()
Checks if the world of the object is disabled.
|
void |
remove()
Remove the stack object from cache and the server
|
java.util.Optional<T> |
runStack()
Stack this object into other objects around it.
|
StackResult |
runStack(StackedObject stackedObject)
Stack this object into another object.
!
|
void |
runStackAsync(java.util.function.Consumer<java.util.Optional<T>> result)
Deprecated.
This object is not async. The async methods were moved to AsyncStackedObject.
You can use runStack() as a replacement.
|
StackCheckResult |
runStackCheck(StackedObject stackedObject)
Checks if this object can stack into another object.
|
UnstackResult |
runUnstack(int amount)
Unstack this object.
|
UnstackResult |
runUnstack(int amount,
org.bukkit.entity.Entity entity)
Unstack this object.
|
void |
setStackAmount(int stackAmount,
boolean updateName)
Update the stack amount
|
void |
spawnStackParticle(boolean checkEnabled)
Spawn the stacking particle of the object.
|
T |
tryStack()
Deprecated.
See runStackAsync(Consumer)
|
boolean |
tryStackInto(StackedObject stackedObject)
Deprecated.
See runStackAsync(StackedObject, Consumer)
|
boolean |
tryUnstack(int amount)
Deprecated.
See runUnstack
|
void |
updateName()
Update the name of the object.
|
org.bukkit.Location getLocation()
org.bukkit.World getWorld()
int getStackAmount()
void setStackAmount(int stackAmount, boolean updateName)
stackAmount
- a new stack amountupdateName
- should the name of the object get updated or notint getStackLimit()
int getMergeRadius()
boolean isBlacklisted()
boolean isWhitelisted()
boolean isWorldDisabled()
boolean isCached()
void remove()
void updateName()
@Deprecated boolean canStackInto(StackedObject stackedObject)
stackedObject
- other object to checkStackCheckResult runStackCheck(StackedObject stackedObject)
stackedObject
- other object to check@Deprecated void runStackAsync(java.util.function.Consumer<java.util.Optional<T>> result)
result
- The object that this object was stacked into.java.util.Optional<T> runStack()
@Deprecated T tryStack()
StackResult runStack(StackedObject stackedObject)
stackedObject
- another object to stack into@Deprecated boolean tryStackInto(StackedObject stackedObject)
stackedObject
- another object to stack intoUnstackResult runUnstack(int amount)
amount
- unstack by this amountUnstackResult runUnstack(int amount, org.bukkit.entity.Entity entity)
amount
- unstack by this amountentity
- The entity that caused the unstack of the object.@Deprecated boolean tryUnstack(int amount)
amount
- unstack by this amountboolean isSimilar(StackedObject stackedObject)
stackedObject
- the object to checkvoid spawnStackParticle(boolean checkEnabled)
checkEnabled
- When true, the particle will be spawned only if enabled in the config.