Record Class ResearchTeamMap

java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.team.ResearchTeamMap

public record ResearchTeamMap(Map<UUID,SimpleResearchTeam> researchTeams) extends Record
  • Field Details

    • EMPTY

      public static final ResearchTeamMap EMPTY
    • CODEC

      public static final com.mojang.serialization.Codec<ResearchTeamMap> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ResearchTeamMap> STREAM_CODEC
  • Constructor Details

    • ResearchTeamMap

      public ResearchTeamMap()
    • ResearchTeamMap

      public ResearchTeamMap(Map<UUID,SimpleResearchTeam> researchTeams)
      Creates an instance of a ResearchTeamMap record class.
      Parameters:
      researchTeams - the value for the researchTeams record component
  • Method Details

    • getTeamByMember

      @Nullable public @Nullable SimpleResearchTeam getTeamByMember(UUID memberUuid)
    • getTeamByMemberOrThrow

      @NotNull public @NotNull ResearchTeam getTeamByMemberOrThrow(UUID memberUuid)
    • getTeamByPlayer

      @Nullable public @Nullable SimpleResearchTeam getTeamByPlayer(net.minecraft.world.entity.player.Player player)
    • getTeamByUUID

      @Nullable public @Nullable SimpleResearchTeam getTeamByUUID(UUID teamUuid)
    • afterSync

      public static void afterSync(net.minecraft.world.entity.player.Player player)
    • setDefaultTeam

      public void setDefaultTeam(UUID uuid, net.minecraft.world.level.Level level)
    • setDefaultTeam

      public void setDefaultTeam(net.minecraft.server.level.ServerPlayer player)
    • initPlayer

      public boolean initPlayer(net.minecraft.server.level.ServerPlayer player)
      Creates a team for the player if it doesn't exist. Does nothing if the player is already in a team.

      Returns true if a team was created, false if not.

    • teamMapFromString

      public static ResearchTeamMap teamMapFromString(Map<String,SimpleResearchTeam> stringedMap)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • researchTeams

      public Map<UUID,SimpleResearchTeam> researchTeams()
      Returns the value of the researchTeams record component.
      Returns:
      the value of the researchTeams record component