public class WauzResourceCache
extends java.lang.Object
WauzResourceSpawn
Modifier and Type | Field and Description |
---|---|
private long |
cooldown
The cooldown timestamp, indicating when the resource can be collected again.
|
private int |
health
The current health of the resource.
|
private WauzResourceSpawn |
resourceSpawn
The resource spawn, the cache is referring to.
|
private java.lang.String |
uuid
The uuid of the resource cache.
|
Constructor and Description |
---|
WauzResourceCache(WauzResourceSpawn resourceSpawn)
Creates a new player specific cache for the given resource spawn.
|
Modifier and Type | Method and Description |
---|---|
long |
getCooldown() |
int |
getHealth() |
WauzResourceSpawn |
getResourceSpawn() |
java.lang.String |
getUuid() |
boolean |
reduceHealth(org.bukkit.entity.Player player,
double damage)
Reduces the cached health of the resource spawn.
|
void |
setCooldown(long cooldown) |
void |
setHealth(int health) |
void |
setResourceSpawn(WauzResourceSpawn resourceSpawn) |
private java.lang.String uuid
private long cooldown
private int health
private WauzResourceSpawn resourceSpawn
public WauzResourceCache(WauzResourceSpawn resourceSpawn)
resourceSpawn
- The resource spawn, the cache is referring to.public boolean reduceHealth(org.bukkit.entity.Player player, double damage)
player
- The player that damaged the resource.damage
- The damage done to the resource.public java.lang.String getUuid()
public long getCooldown()
public void setCooldown(long cooldown)
cooldown
- The new cooldown timestamp, indicating when the resource can be collected again.public int getHealth()
public void setHealth(int health)
health
- The new current health of the resource.public WauzResourceSpawn getResourceSpawn()
public void setResourceSpawn(WauzResourceSpawn resourceSpawn)
resourceSpawn
- The resource spawn, the cache is referring to.