Class TeamStageHelper.TeamHelper

java.lang.Object
dev.scsupercraft.teamstages.data.TeamStageHelper.TeamHelper
Enclosing class:
TeamStageHelper

public static class TeamStageHelper.TeamHelper extends Object
A helper class for managing team stages.

Get an instance of this class using TeamStageHelper.team().

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addStage(dev.ftb.mods.ftbteams.api.Team team, String... stages)
    Attempts to give a team a stage.
    void
    addStage(net.minecraft.server.level.ServerPlayer player, String... stages)
    Attempts to give a player's team a stage.
    int
    clearStages(dev.ftb.mods.ftbteams.api.Team team)
    Removes all stages from a team.
    int
    clearStages(net.minecraft.server.level.ServerPlayer player)
    Removes all stages from a player's team.
    net.darkhax.gamestages.data.IStageData
    getTeamData(dev.ftb.mods.ftbteams.api.Team team)
    Attempts to resolve the stage data for a team.
    net.darkhax.gamestages.data.IStageData
    getTeamData(net.minecraft.world.entity.player.Player player)
    Attempts to resolve the team stage data for a player.
    boolean
    hasAllOf(dev.ftb.mods.ftbteams.api.Team team, String... stages)
    Checks if the team has all of the stages.
    boolean
    hasAllOf(dev.ftb.mods.ftbteams.api.Team team, Collection<String> stages)
    Checks if the team has all of the stages.
    boolean
    hasAllOf(dev.ftb.mods.ftbteams.api.Team team, net.darkhax.gamestages.data.IStageData data, String... stages)
    Checks if the team has all of the stages.
    boolean
    hasAllOf(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.
    boolean
    hasAllOf(net.minecraft.world.entity.player.Player player, String... stages)
    Checks if the player's team has all of the stages.
    boolean
    hasAllOf(net.minecraft.world.entity.player.Player player, Collection<String> stages)
    Checks if the player's team has all of the stages.
    boolean
    hasAllOf(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.
    boolean
    hasAllOf(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.
    boolean
    hasAnyOf(dev.ftb.mods.ftbteams.api.Team team, String... stages)
    Checks if the team has at least one of many possible stages.
    boolean
    hasAnyOf(dev.ftb.mods.ftbteams.api.Team team, Collection<String> stages)
    Checks if the team has at least one of many possible stages.
    boolean
    hasAnyOf(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.
    boolean
    hasAnyOf(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.
    boolean
    hasAnyOf(net.minecraft.world.entity.player.Player player, String... stages)
    Checks if the player's team has at least one of many possible stages.
    boolean
    hasAnyOf(net.minecraft.world.entity.player.Player player, Collection<String> stages)
    Checks if the player's team has at least one of many possible stages.
    boolean
    hasAnyOf(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.
    boolean
    hasAnyOf(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.
    boolean
    hasStage(dev.ftb.mods.ftbteams.api.Team team, String stage)
    Checks if a team has a stage.
    boolean
    hasStage(dev.ftb.mods.ftbteams.api.Team team, net.darkhax.gamestages.data.IStageData data, String stage)
    Checks if a team has a stage.
    boolean
    hasStage(net.minecraft.world.entity.player.Player player, String stage)
    Checks if a player's team has a stage.
    boolean
    hasStage(net.minecraft.world.entity.player.Player player, net.darkhax.gamestages.data.IStageData data, String stage)
    Checks if a player's team has a stage.
    void
    removeStage(dev.ftb.mods.ftbteams.api.Team team, String... stages)
    Attempts to remove a stage from a team.
    void
    removeStage(net.minecraft.server.level.ServerPlayer player, String... stages)
    Attempts to remove a stage from a player's team.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • hasStage

      public boolean hasStage(net.minecraft.world.entity.player.Player player, String stage)
      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

      public boolean hasAnyOf(net.minecraft.world.entity.player.Player player, String... stages)
      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, Collection<String> stages)
      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

      public boolean hasAllOf(net.minecraft.world.entity.player.Player player, String... stages)
      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, Collection<String> stages)
      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

      public void addStage(net.minecraft.server.level.ServerPlayer player, String... stages)
      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

      public void removeStage(net.minecraft.server.level.ServerPlayer player, String... stages)
      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

      public boolean hasStage(dev.ftb.mods.ftbteams.api.Team team, String stage)
      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

      public boolean hasAnyOf(dev.ftb.mods.ftbteams.api.Team team, String... stages)
      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, Collection<String> stages)
      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

      public boolean hasAllOf(dev.ftb.mods.ftbteams.api.Team team, String... stages)
      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, Collection<String> stages)
      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

      public void addStage(dev.ftb.mods.ftbteams.api.Team team, String... stages)
      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

      public void removeStage(dev.ftb.mods.ftbteams.api.Team team, String... stages)
      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.