public class OnePhase
extends java.lang.Object
OnePhaseLevel
,
OneChest
Modifier and Type | Field and Description |
---|---|
private java.util.Map<OneChestType,OneChest> |
chests
The chests that can spawn in this phase, indexed by type.
|
private java.util.List<org.bukkit.entity.EntityType> |
hostileMobs
The list of hostile mobs, spawning in the phase.
|
private double |
mobHostileChance
The chance of it being hostile, when a mob spawns.
|
private double |
mobSpawnChance
The chance that a mob spawns, when a block is destroyed.
|
private java.util.List<org.bukkit.entity.EntityType> |
passiveMobs
The list of passive mobs, spawning in the phase.
|
private java.lang.String |
phaseKey
The key of the phase.
|
private java.util.List<OnePhaseLevel> |
phaseLevels
The levels of the phase.
|
private java.lang.String |
phaseName
The display name of the phase.
|
private static java.util.List<OnePhase> |
phases
A list of all one-block phases.
|
Constructor and Description |
---|
OnePhase(java.lang.String phaseKey)
Constructs a phase, based on the one-block file in the /WauzCore folder.
|
Modifier and Type | Method and Description |
---|---|
static int |
count() |
static OnePhase |
get(int phase)
Gets the requested one-block phase.
|
java.util.Map<OneChestType,OneChest> |
getChests() |
java.util.List<org.bukkit.entity.EntityType> |
getHostileMobs() |
OnePhaseLevel |
getLevel(int level)
Gets the requested one-block phase level.
|
double |
getMobHostileChance() |
double |
getMobSpawnChance() |
java.util.List<org.bukkit.entity.EntityType> |
getPassiveMobs() |
java.lang.String |
getPhaseKey() |
java.util.List<OnePhaseLevel> |
getPhaseLevels() |
java.lang.String |
getPhaseName() |
static void |
init()
Initializes all one-block phases from the config and fills the internal phase map.
|
int |
levelCount() |
boolean |
tryToSpawnMob(org.bukkit.Location location)
Spawns a mob at the given location, depending on the phase's chances.
|
private static java.util.List<OnePhase> phases
private java.lang.String phaseKey
private java.lang.String phaseName
private double mobSpawnChance
private double mobHostileChance
private java.util.List<org.bukkit.entity.EntityType> passiveMobs
private java.util.List<org.bukkit.entity.EntityType> hostileMobs
private java.util.List<OnePhaseLevel> phaseLevels
private java.util.Map<OneChestType,OneChest> chests
public OnePhase(java.lang.String phaseKey)
phaseKey
- The key of the phase.public static void init()
OneBlockConfigurator.getAllPhaseKeys()
public static OnePhase get(int phase)
phase
- The number of the phase.public static int count()
public OnePhaseLevel getLevel(int level)
level
- The number of the level.public boolean tryToSpawnMob(org.bukkit.Location location)
location
- The mob spawn location.public int levelCount()
public java.lang.String getPhaseKey()
public java.lang.String getPhaseName()
public double getMobSpawnChance()
public double getMobHostileChance()
public java.util.List<org.bukkit.entity.EntityType> getPassiveMobs()
public java.util.List<org.bukkit.entity.EntityType> getHostileMobs()
public java.util.List<OnePhaseLevel> getPhaseLevels()
public java.util.Map<OneChestType,OneChest> getChests()