Package dev.scsupercraft.teamstages.data
Class TeamStageHelper.TeamHelper
java.lang.Object
dev.scsupercraft.teamstages.data.TeamStageHelper.TeamHelper
- Enclosing class:
- TeamStageHelper
A helper class for managing team stages.
Get an instance of this class using TeamStageHelper.team().
-
Method Summary
Modifier and TypeMethodDescriptionvoidAttempts to give a team a stage.voidAttempts to give a player's team a stage.intclearStages(dev.ftb.mods.ftbteams.api.Team team) Removes all stages from a team.intclearStages(net.minecraft.server.level.ServerPlayer player) Removes all stages from a player's team.net.darkhax.gamestages.data.IStageDatagetTeamData(dev.ftb.mods.ftbteams.api.Team team) Attempts to resolve the stage data for a team.net.darkhax.gamestages.data.IStageDatagetTeamData(net.minecraft.world.entity.player.Player player) Attempts to resolve the team stage data for a player.booleanChecks if the team has all of the stages.booleanhasAllOf(dev.ftb.mods.ftbteams.api.Team team, Collection<String> stages) Checks if the team has all of the stages.booleanhasAllOf(dev.ftb.mods.ftbteams.api.Team team, net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the team has all of the stages.booleanhasAllOf(dev.ftb.mods.ftbteams.api.Team team, net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the team has all of the stages.booleanChecks if the player's team has all of the stages.booleanhasAllOf(net.minecraft.world.entity.player.Player player, Collection<String> stages) Checks if the player's team has all of the stages.booleanhasAllOf(net.minecraft.world.entity.player.Player player, net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the player's team has all of the stages.booleanhasAllOf(net.minecraft.world.entity.player.Player player, net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the player's team has all of the stages.booleanChecks if the team has at least one of many possible stages.booleanhasAnyOf(dev.ftb.mods.ftbteams.api.Team team, Collection<String> stages) Checks if the team has at least one of many possible stages.booleanhasAnyOf(dev.ftb.mods.ftbteams.api.Team team, net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the team has at least one of many possible stages.booleanhasAnyOf(dev.ftb.mods.ftbteams.api.Team team, net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the team has at least one of many possible stages.booleanChecks if the player's team has at least one of many possible stages.booleanhasAnyOf(net.minecraft.world.entity.player.Player player, Collection<String> stages) Checks if the player's team has at least one of many possible stages.booleanhasAnyOf(net.minecraft.world.entity.player.Player player, net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the player's team has at least one of many possible stages.booleanhasAnyOf(net.minecraft.world.entity.player.Player player, net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the player's team has at least one of many possible stages.booleanChecks if a team has a stage.booleanhasStage(dev.ftb.mods.ftbteams.api.Team team, net.darkhax.gamestages.data.IStageData data, String stage) Checks if a team has a stage.booleanChecks if a player's team has a stage.booleanhasStage(net.minecraft.world.entity.player.Player player, net.darkhax.gamestages.data.IStageData data, String stage) Checks if a player's team has a stage.voidremoveStage(dev.ftb.mods.ftbteams.api.Team team, String... stages) Attempts to remove a stage from a team.voidremoveStage(net.minecraft.server.level.ServerPlayer player, String... stages) Attempts to remove a stage from a player's team.
-
Method Details
-
hasStage
Checks if a player's team has a stage.- Parameters:
player- The player to check.stage- The stage to look for.- Returns:
- Whether or not they have the stage.
-
hasStage
public boolean hasStage(net.minecraft.world.entity.player.Player player, @Nullable net.darkhax.gamestages.data.IStageData data, String stage) Checks if a player's team has a stage.- Parameters:
player- The player to check.data- The player's stage data.stage- The stage to look for.- Returns:
- Whether or not they have the stage.
-
hasAnyOf
Checks if the player's team has at least one of many possible stages.- Parameters:
player- The player to check.stages- The stages to look for.- Returns:
- Whether or not the player had at least one of the stages.
-
hasAnyOf
Checks if the player's team has at least one of many possible stages.- Parameters:
player- The player to check.stages- The stages to look for.- Returns:
- Whether or not the player had at least one of the stages.
-
hasAnyOf
public boolean hasAnyOf(net.minecraft.world.entity.player.Player player, @Nullable net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the player's team has at least one of many possible stages.- Parameters:
player- The player to check.data- The player's stage data.stages- The stages to look for.- Returns:
- Whether or not the player had at least one of the stages.
-
hasAnyOf
public boolean hasAnyOf(net.minecraft.world.entity.player.Player player, @Nullable net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the player's team has at least one of many possible stages.- Parameters:
player- The player to check.data- The player's stage data.stages- The stages to look for.- Returns:
- Whether or not the player had at least one of the stages.
-
hasAllOf
Checks if the player's team has all of the stages.- Parameters:
player- The player to check.stages- The stages to look for.- Returns:
- Whether or not the player had all the stages.
-
hasAllOf
Checks if the player's team has all of the stages.- Parameters:
player- The player to check.stages- The stages to look for.- Returns:
- Whether or not the player had all the stages.
-
hasAllOf
public boolean hasAllOf(net.minecraft.world.entity.player.Player player, @Nullable net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the player's team has all of the stages.- Parameters:
player- The player to check.data- The player's stage data.stages- The stages to look for.- Returns:
- Whether or not the player had all the stages.
-
hasAllOf
public boolean hasAllOf(net.minecraft.world.entity.player.Player player, @Nullable net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the player's team has all of the stages.- Parameters:
player- The player to check.data- The player's stage data.stages- The stages to look for.- Returns:
- Whether or not the player had all the stages.
-
addStage
Attempts to give a player's team a stage. Events may cancel this.- Parameters:
player- The player to give the stage.stages- The stage to give.
-
removeStage
Attempts to remove a stage from a player's team. Events may cancel this.- Parameters:
player- The player to remove the stage from.stages- The stage to remove.
-
clearStages
public int clearStages(net.minecraft.server.level.ServerPlayer player) Removes all stages from a player's team.- Parameters:
player- The player to clear the stages of.- Returns:
- The amount of stages that were removed.
-
hasStage
Checks if a team has a stage.- Parameters:
team- The team to check.stage- The stage to look for.- Returns:
- Whether or not they have the stage.
-
hasStage
public boolean hasStage(dev.ftb.mods.ftbteams.api.Team team, @Nullable net.darkhax.gamestages.data.IStageData data, String stage) Checks if a team has a stage.- Parameters:
team- The team to check.data- The team's stage data.stage- The stage to look for.- Returns:
- Whether or not they have the stage.
-
hasAnyOf
Checks if the team has at least one of many possible stages.- Parameters:
team- The team to check.stages- The stages to look for.- Returns:
- Whether or not the team had at least one of the stages.
-
hasAnyOf
Checks if the team has at least one of many possible stages.- Parameters:
team- The team to check.stages- The stages to look for.- Returns:
- Whether or not the team had at least one of the stages.
-
hasAnyOf
public boolean hasAnyOf(dev.ftb.mods.ftbteams.api.Team team, @Nullable net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the team has at least one of many possible stages.- Parameters:
team- The team to check.data- The team's stage data.stages- The stages to look for.- Returns:
- Whether or not the team had at least one of the stages.
-
hasAnyOf
public boolean hasAnyOf(dev.ftb.mods.ftbteams.api.Team team, @Nullable net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the team has at least one of many possible stages.- Parameters:
team- The team to check.data- The team's stage data.stages- The stages to look for.- Returns:
- Whether or not the team had at least one of the stages.
-
hasAllOf
Checks if the team has all of the stages.- Parameters:
team- The team to check.stages- The stages to look for.- Returns:
- Whether or not the team had all the stages.
-
hasAllOf
Checks if the team has all of the stages.- Parameters:
team- The team to check.stages- The stages to look for.- Returns:
- Whether or not the team had all the stages.
-
hasAllOf
public boolean hasAllOf(dev.ftb.mods.ftbteams.api.Team team, @Nullable net.darkhax.gamestages.data.IStageData data, Collection<String> stages) Checks if the team has all of the stages.- Parameters:
team- The team to check.data- The team's stage data.stages- The stages to look for.- Returns:
- Whether or not the team had all the stages.
-
hasAllOf
public boolean hasAllOf(dev.ftb.mods.ftbteams.api.Team team, @Nullable net.darkhax.gamestages.data.IStageData data, String... stages) Checks if the team has all of the stages.- Parameters:
team- The team to check.data- The team's stage data.stages- The stages to look for.- Returns:
- Whether or not the team had all the stages.
-
addStage
Attempts to give a team a stage. Events may cancel this.- Parameters:
team- The team to give the stage.stages- The stage to give.
-
removeStage
Attempts to remove a stage from a team. Events may cancel this.- Parameters:
team- The team to remove the stage from.stages- The stage to remove.
-
clearStages
public int clearStages(dev.ftb.mods.ftbteams.api.Team team) Removes all stages from a team.- Parameters:
team- The team to clear the stages of.- Returns:
- The amount of stages that were removed.
-
getTeamData
@Nullable public net.darkhax.gamestages.data.IStageData getTeamData(net.minecraft.world.entity.player.Player player) Attempts to resolve the team stage data for a player. If it is a real server player it will look up their data using UUID. If it's a FakePlayer it will check the fake player data file. If it's a client player it will use the client's synced data cache.- Parameters:
player- The player to resolve.- Returns:
- The stage data that was found. Will be null if nothing could be found.
-
getTeamData
@Nullable public net.darkhax.gamestages.data.IStageData getTeamData(dev.ftb.mods.ftbteams.api.Team team) Attempts to resolve the stage data for a team. If called on the client-side it will use the client's synced data cache. Otherwise, it will look up the team's data using UUID.- Parameters:
team- The team to resolve.- Returns:
- The stage data that was found. Will be null if nothing could be found.
-