Class PlayerDataComponentImpl
java.lang.Object
me.andreasmelone.glowingeyes.neoforge.common.component.data.PlayerDataComponentImpl
- All Implemented Interfaces:
IPlayerDataComponent
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerDataComponentImpl(net.neoforged.neoforge.registries.DeferredHolder<net.neoforged.neoforge.attachment.AttachmentType<?>, net.neoforged.neoforge.attachment.AttachmentType<IPlayerData>> attachmentType) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTrackedBy(net.minecraft.world.entity.player.Player playerTracked, net.minecraft.world.entity.player.Player trackedBy) Adds a player to the list of players tracking the given playergetComponent(net.minecraft.world.entity.player.Player player) Set<net.minecraft.world.entity.player.Player> getTrackedBy(net.minecraft.world.entity.player.Player player) Gets the players that are tracking the given playerbooleanhasMod(net.minecraft.world.entity.player.Player player) Gets whether the player has the mod installedvoidremoveTrackedBy(net.minecraft.world.entity.player.Player playerTracked, net.minecraft.world.entity.player.Player trackedBy) Removes a player from the list of players tracking the given playervoidsetHasMod(net.minecraft.world.entity.player.Player player, boolean hasMod) Sets whether the player has the mod installed
-
Constructor Details
-
PlayerDataComponentImpl
public PlayerDataComponentImpl(net.neoforged.neoforge.registries.DeferredHolder<net.neoforged.neoforge.attachment.AttachmentType<?>, net.neoforged.neoforge.attachment.AttachmentType<IPlayerData>> attachmentType)
-
-
Method Details
-
getComponent
-
hasMod
public boolean hasMod(net.minecraft.world.entity.player.Player player) Description copied from interface:IPlayerDataComponentGets whether the player has the mod installed- Specified by:
hasModin interfaceIPlayerDataComponent- Parameters:
player- the player to check- Returns:
- whether the player has the mod installed
-
setHasMod
public void setHasMod(net.minecraft.world.entity.player.Player player, boolean hasMod) Description copied from interface:IPlayerDataComponentSets whether the player has the mod installed- Specified by:
setHasModin interfaceIPlayerDataComponent- Parameters:
player- the player to set the mod installed status for
-
getTrackedBy
public Set<net.minecraft.world.entity.player.Player> getTrackedBy(net.minecraft.world.entity.player.Player player) Description copied from interface:IPlayerDataComponentGets the players that are tracking the given player- Specified by:
getTrackedByin interfaceIPlayerDataComponent- Parameters:
player- the player to get the tracking players for
-
addTrackedBy
public void addTrackedBy(net.minecraft.world.entity.player.Player playerTracked, net.minecraft.world.entity.player.Player trackedBy) Description copied from interface:IPlayerDataComponentAdds a player to the list of players tracking the given player- Specified by:
addTrackedByin interfaceIPlayerDataComponent- Parameters:
playerTracked- the player to add to the list of players trackingtrackedBy- the player tracking the other player
-
removeTrackedBy
public void removeTrackedBy(net.minecraft.world.entity.player.Player playerTracked, net.minecraft.world.entity.player.Player trackedBy) Description copied from interface:IPlayerDataComponentRemoves a player from the list of players tracking the given player- Specified by:
removeTrackedByin interfaceIPlayerDataComponent- Parameters:
playerTracked- the player to remove from the list of players trackingtrackedBy- the player tracking the other player
-