Class ColorComponent

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

public class ColorComponent extends Object implements dev.onyxstudios.cca.api.v3.component.ComponentV3, dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent
  • Field Details

    • COLOR_COMPONENT

      public static final dev.onyxstudios.cca.api.v3.component.ComponentKey<ColorComponent> COLOR_COMPONENT
    • color

      protected String color
    • exclusiveTargetColorMap

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

    • ColorComponent

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

    • readFromNbt

      public void readFromNbt(net.minecraft.nbt.NbtCompound tag)
      Specified by:
      readFromNbt in interface dev.onyxstudios.cca.api.v3.component.Component
    • writeToNbt

      public void writeToNbt(net.minecraft.nbt.NbtCompound tag)
      Specified by:
      writeToNbt in interface dev.onyxstudios.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()