public class InstanceMobArena
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
currentWave
The current wave number.
|
private int |
maximumWave
The maximum wave number.
|
private int |
mobsLeft
How many mobs of the current wave are left.
|
private java.util.List<java.util.List<MobSpawn>> |
waves
The list of lists of mobs that spawn in arena waves.
|
private org.bukkit.World |
world
The instance world of the arena.
|
Constructor and Description |
---|
InstanceMobArena(InstanceMobArena arena,
org.bukkit.World world)
Constructs an arena, that is an exact copy of another arena.
|
InstanceMobArena(java.lang.String instanceName)
Creates an arena template, based on the instance file in the /WauzCore/InstanceData folder.
|
Modifier and Type | Method and Description |
---|---|
void |
broadcastMessage(java.lang.String message,
org.bukkit.Sound sound)
Broadcasts a title message with sound effect to all players in the arena.
|
void |
checkIfNewWaveShouldStart()
Starts a new wave, if requirements are met.
|
void |
decreaseMobCount()
Decreases how many mobs are left in the current wave.
|
int |
getCurrentWave() |
int |
getMaximumWave() |
int |
getMobsLeft() |
java.util.List<java.util.List<MobSpawn>> |
getWaves() |
void |
handOutMedals()
Give every player in the arena a medal for completing the current wave.
|
void |
increaseMobCount()
Increases how many mobs are left in the current wave.
|
void |
setCurrentWave(int currentWave) |
void |
setMaximumWave(int maximumWave) |
void |
setWaves(java.util.List<java.util.List<MobSpawn>> waves) |
void |
startNewWave()
Increases the wave counter and spawns the mobs for the new wave.
|
static void |
tryToDecreaseMobCount(org.bukkit.entity.Entity entity)
If the given entity is part of a mob arena, the arena's mob count gets decreased.
|
static void |
tryToIncreaseMobCount(org.bukkit.entity.Entity entity)
If the given entity is part of a mob arena, the arena's mob count gets increased.
|
void |
tryToManuallyStartNewWave(org.bukkit.entity.Player player)
Lets a player try to start a new wave manually.
|
private org.bukkit.World world
private int currentWave
private int maximumWave
private java.util.List<java.util.List<MobSpawn>> waves
private int mobsLeft
public InstanceMobArena(java.lang.String instanceName)
instanceName
- The name of the instance, the arena is located in.public InstanceMobArena(InstanceMobArena arena, org.bukkit.World world)
arena
- The arena to clone.world
- The instance world for the cloned arena.public void tryToManuallyStartNewWave(org.bukkit.entity.Player player)
player
- The player who tries to start the wave.startNewWave()
public void checkIfNewWaveShouldStart()
startNewWave()
,
broadcastMessage(String, Sound)
public void startNewWave()
public void broadcastMessage(java.lang.String message, org.bukkit.Sound sound)
message
- The message to display.sound
- The sound effect to play.public void handOutMedals()
public static void tryToIncreaseMobCount(org.bukkit.entity.Entity entity)
entity
- The entity that could have appeared in an arena.public void increaseMobCount()
public static void tryToDecreaseMobCount(org.bukkit.entity.Entity entity)
entity
- The entity that could have disappeared from an arena.public void decreaseMobCount()
checkIfNewWaveShouldStart()
public int getCurrentWave()
public void setCurrentWave(int currentWave)
currentWave
- The new current wave number.public int getMaximumWave()
public void setMaximumWave(int maximumWave)
maximumWave
- The new maximum wave number.public java.util.List<java.util.List<MobSpawn>> getWaves()
public void setWaves(java.util.List<java.util.List<MobSpawn>> waves)
waves
- The new list of lists of mobs that spawn in arena waves.public int getMobsLeft()