Class ColorComponent

java.lang.Object
me.emafire003.dev.coloredglowlib.component.ColorComponent
All Implemented Interfaces:
org.ladysnake.cca.api.v3.component.Component, org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent, org.ladysnake.cca.api.v3.component.sync.ComponentPacketWriter, org.ladysnake.cca.api.v3.component.sync.PlayerSyncPredicate

public class ColorComponent extends Object implements org.ladysnake.cca.api.v3.component.Component, org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent
  • Field Details

    • COLOR_COMPONENT

      public static final org.ladysnake.cca.api.v3.component.ComponentKey<ColorComponent> COLOR_COMPONENT
    • color

      protected String color
    • exclusiveTargetColorMap

      protected net.minecraft.nbt.CompoundTag exclusiveTargetColorMap
  • Constructor Details

    • ColorComponent

      public ColorComponent(net.minecraft.world.entity.Entity entity)
  • Method Details

    • readData

      public void readData(net.minecraft.world.level.storage.ValueInput tag)
      Specified by:
      readData in interface org.ladysnake.cca.api.v3.component.Component
    • writeData

      public void writeData(net.minecraft.world.level.storage.ValueOutput tag)
      Specified by:
      writeData in interface org.ladysnake.cca.api.v3.component.Component
    • getColor

      public String getColor()
      Returns:
      A hex color or "rainbow". If no color has been set, returns the default white one
    • setColor

      public void setColor(String color)
      Parameters:
      color - A hex color or "rainbow"
    • getExclusiveTargetColorMap

      public HashMap<UUID,String> getExclusiveTargetColorMap()
    • addExclusiveColorFor

      public void addExclusiveColorFor(UUID uuid, String color)
      Parameters:
      uuid - The uuid of the player that will see the specific color
      color - A hex color or "rainbow"
    • setExclusiveColorFor

      public void setExclusiveColorFor(UUID uuid, String color)
      WARNING! THIS CANNOT BE USED TO CLEAR A TYPE! USE clearExclusiveColor INSTEAD!
      Parameters:
      uuid - The uuid of the player that will see the specific color
      color - A hex color or "rainbow"
    • clearExclusiveColorFor

      public void clearExclusiveColorFor(UUID uuid)
    • getExclusiveColorFor

      public String getExclusiveColorFor(UUID uuid)
    • clear

      public void clear()