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, CGLComponent

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

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    static final dev.onyxstudios.cca.api.v3.component.ComponentKey<ColorComponent>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColorComponent(net.minecraft.entity.LivingEntity livingEntity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    void
    readFromNbt(net.minecraft.nbt.NbtCompound tag)
     
    void
     
    void
    writeToNbt(net.minecraft.nbt.NbtCompound tag)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.onyxstudios.cca.api.v3.component.sync.AutoSyncedComponent

    applySyncPacket, shouldSyncWith, writeSyncPacket

    Methods inherited from interface dev.onyxstudios.cca.api.v3.component.Component

    equals
  • Field Details

    • COLOR_COMPONENT

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

      protected String color
  • Constructor Details

    • ColorComponent

      public ColorComponent(net.minecraft.entity.LivingEntity livingEntity)
  • Method Details

    • readFromNbt

      public void readFromNbt(net.minecraft.nbt.NbtCompound tag)
      Specified by:
      readFromNbt in interface CGLComponent
      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 CGLComponent
      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"
    • clear

      public void clear()