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 Summary
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final org.ladysnake.cca.api.v3.component.ComponentKey<ColorComponent> protected net.minecraft.nbt.CompoundTag -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExclusiveColorFor(UUID uuid, String color) voidclear()voidclearExclusiveColorFor(UUID uuid) getColor()getExclusiveColorFor(UUID uuid) voidreadData(net.minecraft.world.level.storage.ValueInput tag) voidvoidsetExclusiveColorFor(UUID uuid, String color) WARNING!voidwriteData(net.minecraft.world.level.storage.ValueOutput tag) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent
applySyncPacket, shouldSyncWith, writeSyncPacketMethods inherited from interface org.ladysnake.cca.api.v3.component.sync.PlayerSyncPredicate
isRequiredOnClient
-
Field Details
-
COLOR_COMPONENT
-
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:
readDatain interfaceorg.ladysnake.cca.api.v3.component.Component
-
writeData
public void writeData(net.minecraft.world.level.storage.ValueOutput tag) - Specified by:
writeDatain interfaceorg.ladysnake.cca.api.v3.component.Component
-
getColor
- Returns:
- A hex color or "rainbow". If no color has been set, returns the default white one
-
setColor
- Parameters:
color- A hex color or "rainbow"
-
getExclusiveTargetColorMap
-
addExclusiveColorFor
- Parameters:
uuid- The uuid of the player that will see the specific colorcolor- A hex color or "rainbow"
-
setExclusiveColorFor
WARNING! THIS CANNOT BE USED TO CLEAR A TYPE! USE clearExclusiveColor INSTEAD!- Parameters:
uuid- The uuid of the player that will see the specific colorcolor- A hex color or "rainbow"
-
clearExclusiveColorFor
-
getExclusiveColorFor
-
clear
public void clear()
-