public class GameStageHelper
extends java.lang.Object
| Constructor and Description |
|---|
GameStageHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addStage(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String stage)
Adds a stage to a player.
|
static int |
clearStages(net.minecraft.entity.player.ServerPlayerEntity player)
Removes all stages that a player has unlocked.
|
static java.util.Set<java.lang.String> |
getKnownStages()
Gets all the stages that are known to GameStages.
|
static IStageData |
getPlayerData(net.minecraft.entity.player.PlayerEntity player)
Gets the stage data for the player.
|
static IStageData |
getPlayerData(net.minecraft.entity.player.ServerPlayerEntity player)
Gets the stage data for the player.
|
static boolean |
hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.util.Collection<java.lang.String> stages)
Checks if a player has all of the passed stages.
|
static boolean |
hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
IStageData playerData,
java.util.Collection<java.lang.String> stages)
Checks if a player data has all of the passed stages.
|
static boolean |
hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
IStageData playerData,
java.lang.String... stages)
Checks if a player data has all of the passed stages.
|
static boolean |
hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String... stages)
Checks if a player has all of the passed stages.
|
static boolean |
hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.util.Collection<java.lang.String> stages)
Checks if a player has any of the passed stages.
|
static boolean |
hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
IStageData playerData,
java.util.Collection<java.lang.String> stages)
Checks if a player data has any of the passed stages.
|
static boolean |
hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
IStageData playerData,
java.lang.String... stages)
Checks if a player data has any of the passed stages.
|
static boolean |
hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String... stages)
Checks if a player has any of the passed stages.
|
static boolean |
hasStage(net.minecraft.entity.player.ServerPlayerEntity player,
IStageData data,
java.lang.String stage)
Internal helper method to fire a stage check.
|
static boolean |
hasStage(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String stage)
Checks if a player has a stage.
|
static boolean |
isStageKnown(java.lang.String stage)
Checks if a stage is known to GameStages.
|
static boolean |
isValidStageName(java.lang.String stageName)
Checks if a given string is valid as a stage name.
|
static void |
removeStage(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String stage)
Removes a stages from a player.
|
static void |
syncPlayer(net.minecraft.entity.player.ServerPlayerEntity player)
Syncs a client's data with the data that is on the server.
|
public static boolean isValidStageName(java.lang.String stageName)
stageName - The name to test.public static java.util.Set<java.lang.String> getKnownStages()
public static boolean isStageKnown(java.lang.String stage)
stage - The name of the stage to check.public static boolean hasStage(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String stage)
player - The player to check the stages of.stage - The stage to look for.public static boolean hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String... stages)
player - The player to check the stages of.stages - The stages to look for.public static boolean hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.util.Collection<java.lang.String> stages)
player - The player to check the stages of.stages - The stages to look for.public static boolean hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
@Nullable
IStageData playerData,
java.util.Collection<java.lang.String> stages)
player - The player to check the stages of.playerData - The player data to check.stages - The stages to look for.public static boolean hasAnyOf(net.minecraft.entity.player.ServerPlayerEntity player,
@Nullable
IStageData playerData,
java.lang.String... stages)
player - The player to check the stages of.playerData - The player data to check.stages - The stages to look for.public static boolean hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String... stages)
player - The player to check the stages of.stages - The stages to look for.public static boolean hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
java.util.Collection<java.lang.String> stages)
player - The player to check the stages of.stages - The stages to look for.public static boolean hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
@Nullable
IStageData playerData,
java.util.Collection<java.lang.String> stages)
player - The player to check the stages of.playerData - The player data to check.stages - The stages to look for.public static boolean hasAllOf(net.minecraft.entity.player.ServerPlayerEntity player,
@Nullable
IStageData playerData,
java.lang.String... stages)
player - The player to check the stages of.playerData - The player data to check.stages - The stages to look for.public static boolean hasStage(net.minecraft.entity.player.ServerPlayerEntity player,
@Nullable
IStageData data,
java.lang.String stage)
player - The player to check the stages of.data - The player's stage data. This is to allow multiple stage checks to look this
up only once.stage - The stage to check for.public static void addStage(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String stage)
player - The player to add the stage too.stage - The stage to add.public static void removeStage(net.minecraft.entity.player.ServerPlayerEntity player,
java.lang.String stage)
player - The player to remove the stage from.stage - The stage to remove.public static int clearStages(net.minecraft.entity.player.ServerPlayerEntity player)
player - The player to remove stages from.@Nullable public static IStageData getPlayerData(@Nullable net.minecraft.entity.player.ServerPlayerEntity player)
player - The server player to get stage data for.@Nullable public static IStageData getPlayerData(net.minecraft.entity.player.PlayerEntity player)
player - The player to get stage data for.public static void syncPlayer(net.minecraft.entity.player.ServerPlayerEntity player)
player - The player to sync.