Class GlowingEyesComponentImpl
java.lang.Object
me.andreasmelone.glowingeyes.forge.common.component.eyes.GlowingEyesComponentImpl
- All Implemented Interfaces:
IGlowingEyesComponent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final net.minecraftforge.common.capabilities.Capability<IGlowingEyes> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetComponent(net.minecraft.world.entity.player.Player player) Get the GlowingEyes capability from a playergetGlowingEyesMap(net.minecraft.world.entity.player.Player player) Gets the glowing eyes map from a playerbooleanisToggledOn(net.minecraft.world.entity.player.Player player) Gets whether the glowing eyes are toggled on for a playerstatic voidregister(net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent event) voidsendUpdate(net.minecraft.server.level.ServerPlayer updatedPlayer) Server-side-only method to send the updated component to the clientvoidsendUpdate(net.minecraft.server.level.ServerPlayer updatedPlayer, net.minecraft.server.level.ServerPlayer receivingPlayer) Server-side-only method to send the updated component to the clientvoidsetGlowingEyesMap(net.minecraft.world.entity.player.Player player, Map<Point, Color> glowingEyesMap) Sets the glowing eyes map (should only be using when completely overwriting the map) Otherwise, get the glowing eyes map and modify itvoidsetToggledOn(net.minecraft.world.entity.player.Player player, boolean toggledOn) Sets whether the glowing eyes are toggled on for a player
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
GlowingEyesComponentImpl
public GlowingEyesComponentImpl()
-
-
Method Details
-
register
public static void register(net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent event) -
getComponent
Get the GlowingEyes capability from a player- Parameters:
player- the player to get the capability from- Returns:
- the GlowingEyes capability
-
getGlowingEyesMap
Description copied from interface:IGlowingEyesComponentGets the glowing eyes map from a player- Specified by:
getGlowingEyesMapin interfaceIGlowingEyesComponent- Parameters:
player- the player to get the glowing eyes map from- Returns:
- the glowing eyes map (Point, Color)
-
setGlowingEyesMap
public void setGlowingEyesMap(net.minecraft.world.entity.player.Player player, Map<Point, Color> glowingEyesMap) Description copied from interface:IGlowingEyesComponentSets the glowing eyes map (should only be using when completely overwriting the map) Otherwise, get the glowing eyes map and modify it- Specified by:
setGlowingEyesMapin interfaceIGlowingEyesComponent- Parameters:
player- the player to set the glowing eyes map forglowingEyesMap- the glowing eyes map to set
-
isToggledOn
public boolean isToggledOn(net.minecraft.world.entity.player.Player player) Description copied from interface:IGlowingEyesComponentGets whether the glowing eyes are toggled on for a player- Specified by:
isToggledOnin interfaceIGlowingEyesComponent- Parameters:
player- the player to get the toggled on status for- Returns:
- whether the glowing eyes are toggled on
-
setToggledOn
public void setToggledOn(net.minecraft.world.entity.player.Player player, boolean toggledOn) Description copied from interface:IGlowingEyesComponentSets whether the glowing eyes are toggled on for a player- Specified by:
setToggledOnin interfaceIGlowingEyesComponent- Parameters:
player- the player to set the toggled on status fortoggledOn- whether the glowing eyes are toggled on
-
sendUpdate
public void sendUpdate(net.minecraft.server.level.ServerPlayer updatedPlayer) Description copied from interface:IGlowingEyesComponentServer-side-only method to send the updated component to the client- Specified by:
sendUpdatein interfaceIGlowingEyesComponent- Parameters:
updatedPlayer- the player who has been updated (will receive the update if no second player is specified)
-
sendUpdate
public void sendUpdate(net.minecraft.server.level.ServerPlayer updatedPlayer, net.minecraft.server.level.ServerPlayer receivingPlayer) Description copied from interface:IGlowingEyesComponentServer-side-only method to send the updated component to the client- Specified by:
sendUpdatein interfaceIGlowingEyesComponent- Parameters:
updatedPlayer- the player who has been updatedreceivingPlayer- another player who will receive the update
-