Record Class ResearchTeamMap
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.team.ResearchTeamMap
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ResearchTeamMap> static final ResearchTeamMapstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ResearchTeamMap> -
Constructor Summary
ConstructorsConstructorDescriptionResearchTeamMap(Map<UUID, SimpleResearchTeam> researchTeams) Creates an instance of aResearchTeamMaprecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidafterSync(net.minecraft.world.entity.player.Player player) final booleanIndicates whether some other object is "equal to" this one.@Nullable SimpleResearchTeamgetTeamByMember(UUID memberUuid) @NotNull ResearchTeamgetTeamByMemberOrThrow(UUID memberUuid) @Nullable SimpleResearchTeamgetTeamByPlayer(net.minecraft.world.entity.player.Player player) @Nullable SimpleResearchTeamgetTeamByUUID(UUID teamUuid) final inthashCode()Returns a hash code value for this object.booleaninitPlayer(net.minecraft.server.level.ServerPlayer player) Creates a team for the player if it doesn't exist.Returns the value of theresearchTeamsrecord component.voidsetDefaultTeam(UUID uuid, net.minecraft.world.level.Level level) voidsetDefaultTeam(net.minecraft.server.level.ServerPlayer player) static ResearchTeamMapteamMapFromString(Map<String, SimpleResearchTeam> stringedMap) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ResearchTeamMap> STREAM_CODEC
-
-
Constructor Details
-
ResearchTeamMap
public ResearchTeamMap() -
ResearchTeamMap
Creates an instance of aResearchTeamMaprecord class.- Parameters:
researchTeams- the value for theresearchTeamsrecord component
-
-
Method Details
-
getTeamByMember
-
getTeamByMemberOrThrow
-
getTeamByPlayer
@Nullable public @Nullable SimpleResearchTeam getTeamByPlayer(net.minecraft.world.entity.player.Player player) -
getTeamByUUID
-
afterSync
public static void afterSync(net.minecraft.world.entity.player.Player player) -
setDefaultTeam
-
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
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
researchTeams
Returns the value of theresearchTeamsrecord component.- Returns:
- the value of the
researchTeamsrecord component
-