Class PlayerDataComponentImpl

java.lang.Object
me.andreasmelone.glowingeyes.neoforge.common.component.data.PlayerDataComponentImpl
All Implemented Interfaces:
IPlayerDataComponent

public class PlayerDataComponentImpl extends Object implements IPlayerDataComponent
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerDataComponentImpl(net.neoforged.neoforge.registries.DeferredHolder<net.neoforged.neoforge.attachment.AttachmentType<?>,net.neoforged.neoforge.attachment.AttachmentType<IPlayerData>> attachmentType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addTrackedBy(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 player
    getComponent(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 player
    boolean
    hasMod(net.minecraft.world.entity.player.Player player)
    Gets whether the player has the mod installed
    void
    removeTrackedBy(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 player
    void
    setHasMod(net.minecraft.world.entity.player.Player player, boolean hasMod)
    Sets whether the player has the mod installed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public IPlayerData getComponent(net.minecraft.world.entity.player.Player player)
    • hasMod

      public boolean hasMod(net.minecraft.world.entity.player.Player player)
      Description copied from interface: IPlayerDataComponent
      Gets whether the player has the mod installed
      Specified by:
      hasMod in interface IPlayerDataComponent
      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: IPlayerDataComponent
      Sets whether the player has the mod installed
      Specified by:
      setHasMod in interface IPlayerDataComponent
      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: IPlayerDataComponent
      Gets the players that are tracking the given player
      Specified by:
      getTrackedBy in interface IPlayerDataComponent
      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: IPlayerDataComponent
      Adds a player to the list of players tracking the given player
      Specified by:
      addTrackedBy in interface IPlayerDataComponent
      Parameters:
      playerTracked - the player to add to the list of players tracking
      trackedBy - 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: IPlayerDataComponent
      Removes a player from the list of players tracking the given player
      Specified by:
      removeTrackedBy in interface IPlayerDataComponent
      Parameters:
      playerTracked - the player to remove from the list of players tracking
      trackedBy - the player tracking the other player