public class BattleRegistry
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
deRegisterBattle(BattleController bc)
Removes a battle from the battle list.
|
static BattleController |
getBattle(java.lang.Integer index)
Finds a battle from its index.
|
static BattleController |
getBattle(net.minecraft.entity.player.PlayerEntity player)
Finds the battle a player is in.
|
static BattleController |
getBattleExcludeSpectate(net.minecraft.entity.player.PlayerEntity player)
Finds the battle a player is battling in.
|
static BattleController |
getSpectatedBattle(net.minecraft.entity.player.PlayerEntity player)
Finds the battle a player is spectating.
|
static void |
registerBattle(BattleController bc)
Registers a battle in the battle list.
|
static void |
registerSpectator(Spectator spectator,
BattleController bc)
Registers a spectator in a battle.
|
static boolean |
removeSpectator(net.minecraft.entity.player.ServerPlayerEntity player)
Removes the player from the battle being spectated.
|
static BattleController |
startBattle(BattleParticipant[] team1,
BattleParticipant[] team2,
BattleRules rules)
Sets up a battle with participants and registers it.
|
static BattleController |
startBattle(BattleParticipant[] team1,
BattleParticipant[] team2,
BattleType type)
Sets up a singles battle between two participants.
|
static BattleController |
startBattle(BattleParticipant team1,
BattleParticipant team2)
Sets up a singles battle between two participants.
|
static void |
unregisterSpectator(Spectator spectator)
Unregisters a spectator from a battle.
|
static void |
updateBattles()
Updates each battle in the battle list.
|
@Nullable public static BattleController startBattle(BattleParticipant[] team1, BattleParticipant[] team2, BattleRules rules)
team1
- One side of the battle.team2
- The other side of the battle.rules
- The rules of the battle.BattleStartedEvent
was canceled.public static BattleController startBattle(BattleParticipant[] team1, BattleParticipant[] team2, BattleType type)
team1
- One participant in the battle.team2
- The other participant in the battle.type
- The type of battle to start.BattleStartedEvent
was canceled.public static BattleController startBattle(BattleParticipant team1, BattleParticipant team2)
team1
- One participant in the battle.team2
- The other participant in the battle.BattleStartedEvent
was canceled.public static void registerBattle(BattleController bc)
bc
- The battle to register.public static BattleController getBattle(java.lang.Integer index)
index
- The index of the battle to find.public static BattleController getBattle(net.minecraft.entity.player.PlayerEntity player)
player
- The player to find a battle for.public static BattleController getBattleExcludeSpectate(net.minecraft.entity.player.PlayerEntity player)
player
- The player to find a battle for.public static BattleController getSpectatedBattle(net.minecraft.entity.player.PlayerEntity player)
player
- The player to find a battle for.public static void registerSpectator(Spectator spectator, BattleController bc)
spectator
- The spectator to register.bc
- The battle to register the spectator to.public static void unregisterSpectator(Spectator spectator)
spectator
- The spectator to unregister.public static boolean removeSpectator(net.minecraft.entity.player.ServerPlayerEntity player)
player
- The player to remove from a battle.public static void deRegisterBattle(BattleController bc)
bc
- The battle to remove.public static void updateBattles()