Class EverybodyTeam
java.lang.Object
petrolpark.mc.library.core.world.entity.player.team.AbstractTeam
petrolpark.mc.library.core.world.entity.player.team.everybody.EverybodyTeam
- All Implemented Interfaces:
net.minecraft.core.component.DataComponentHolder,net.neoforged.neoforge.common.extensions.IDataComponentHolderExtension,net.neoforged.neoforge.common.MutableDataComponentHolder,ITeam
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface petrolpark.mc.library.core.world.entity.player.team.ITeam
ITeam.ProviderType -
Field Summary
FieldsFields inherited from class petrolpark.mc.library.core.world.entity.player.team.AbstractTeam
components -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEverybodyTeam(net.minecraft.world.level.Level level, net.minecraft.core.component.DataComponentPatch components) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentgetName()The name of this Team, without necessarily referring to anymembers.TheITeam.Providerthat provides this exact Team instance.booleanisAdmin(net.minecraft.world.entity.player.Player player) What this means will be different for every system that uses Teams.booleanisMember(net.minecraft.world.entity.player.Player player) Whether the given Player is in this Team, meaning they have access client-side to the Team'sData Components, and have any non-adminabilities.intThe number ofmembersof this Team.voidrenderIcon(net.minecraft.client.gui.GuiGraphics graphics) Render an icon for thisITeam.voidsetChanged(net.minecraft.core.component.DataComponentPatch patch) Called if anyData Componentsactually change.The uniqueusernameof everymemberof this Team, in no particular order.Stream<net.minecraft.server.level.ServerPlayer> Everymemberof this Team, with no guarantee of order.Methods inherited from class petrolpark.mc.library.core.world.entity.player.team.AbstractTeam
applyComponents, applyComponents, getComponents, getDataComponentPatch, isNone, remove, set, writeDataComponentsTagMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.core.component.DataComponentHolder
get, getOrDefault, hasMethods inherited from interface net.neoforged.neoforge.common.extensions.IDataComponentHolderExtension
addToTooltip, addToTooltip, get, getOrDefault, hasMethods inherited from interface petrolpark.mc.library.core.world.entity.player.team.ITeam
getRenderedMemberList, sendToAllMembersMethods inherited from interface net.neoforged.neoforge.common.MutableDataComponentHolder
copyFrom, copyFrom, remove, set, update, update, update, update
-
Field Details
-
level
public final net.minecraft.world.level.Level level
-
-
Constructor Details
-
EverybodyTeam
protected EverybodyTeam(net.minecraft.world.level.Level level, net.minecraft.core.component.DataComponentPatch components)
-
-
Method Details
-
isMember
public boolean isMember(net.minecraft.world.entity.player.Player player) Description copied from interface:ITeamWhether the given Player is in this Team, meaning they have access client-side to the Team'sData Components, and have any non-adminabilities.- Parameters:
player-
-
getProvider
Description copied from interface:ITeamTheITeam.Providerthat provides this exact Team instance. -
memberCount
public int memberCount()Description copied from interface:ITeamThe number ofmembersof this Team.- Returns:
- Positive integer
almost alwaysgreater than0.
-
streamMemberUsernames
Description copied from interface:ITeamThe uniqueusernameof everymemberof this Team, in no particular order. ForScoreboardTeams in particular, this method is faster thanITeam.streamOnlineMembers()and should be used in preference to calling that method and then getting the usernames. -
streamOnlineMembers
Description copied from interface:ITeamEverymemberof this Team, with no guarantee of order. It is faster to useITeam.streamMemberUsernames()unless having the Player itself is vital. On the client side, that is the only way to know the members of the Team. -
isAdmin
public boolean isAdmin(net.minecraft.world.entity.player.Player player) Description copied from interface:ITeamWhat this means will be different for every system that uses Teams. It could mean the ability to change the name of aRestaurant, for example. It has nothing to do with operator permissions. If called, it is assumed thatITeam.isMember(Player)has already passed.- Parameters:
player-
-
getName
public net.minecraft.network.chat.Component getName()Description copied from interface:ITeamThe name of this Team, without necessarily referring to anymembers.- See Also:
-
renderIcon
public void renderIcon(net.minecraft.client.gui.GuiGraphics graphics) Description copied from interface:ITeamRender an icon for thisITeam. The icon should occupy(0, 0) -> (16, 16)of the given PoseStack.- Parameters:
graphics-
-
setChanged
public void setChanged(@Nullable net.minecraft.core.component.DataComponentPatch patch) Description copied from class:AbstractTeamCalled if anyData Componentsactually change. Use this to sync changes to the clients ofmembersof this Team.- Specified by:
setChangedin classAbstractTeam- Parameters:
patch-
-