public class WauzResourceSpawn
extends java.lang.Object
WauzResource
Modifier and Type | Field and Description |
---|---|
private org.bukkit.Location |
location
The location of the resource instance.
|
private SkillParticle |
particle
The particles to highlight the resource location.
|
private java.util.Map<org.bukkit.entity.Player,WauzResourceCache> |
playerResourceCacheMap
A map to cache player specific data of a resource spawn.
|
private WauzResource |
resource
The instanced resource.
|
Constructor and Description |
---|
WauzResourceSpawn(WauzResource resource,
org.bukkit.Location location)
Instantiates a block of a gatherable resource.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canCollectResource(org.bukkit.entity.Player player)
Checks if the given player can collect the resource.
|
void |
collectResource(org.bukkit.entity.Player player)
Lets the player collect the resource.
|
org.bukkit.Location |
getLocation() |
WauzResourceCache |
getPlayerResourceCache(org.bukkit.entity.Player player)
Gets the player specific cache of the resource spawn.
|
WauzResource |
getResource() |
void |
tryToCollectResource(org.bukkit.entity.Player player)
Lets the player collect the resource, if it is ready.
|
void |
tryToDamageResource(org.bukkit.entity.Player player)
Lets the player damage the resource, if it is ready to collect.
|
void |
tryToHighlightResource(org.bukkit.entity.Player player)
Highlights the resoure for a player, if it is ready to collect.
|
private WauzResource resource
private org.bukkit.Location location
private SkillParticle particle
private java.util.Map<org.bukkit.entity.Player,WauzResourceCache> playerResourceCacheMap
public WauzResourceSpawn(WauzResource resource, org.bukkit.Location location)
resource
- The instanced resource.location
- The location of the resource instance.public void tryToHighlightResource(org.bukkit.entity.Player player)
player
- The player to highlight the resource for.public void tryToDamageResource(org.bukkit.entity.Player player)
player
- The player damaging the resource.public void tryToCollectResource(org.bukkit.entity.Player player)
player
- The player collecting the resource.public void collectResource(org.bukkit.entity.Player player)
player
- The player collecting the resource.public boolean canCollectResource(org.bukkit.entity.Player player)
player
- The player to check for.public WauzResourceCache getPlayerResourceCache(org.bukkit.entity.Player player)
player
- The player to get the cache for.public WauzResource getResource()
public org.bukkit.Location getLocation()