Package net.citizensnpcs.trait
Interface HologramTrait.HologramRenderer
- All Known Implementing Classes:
HologramTrait.AreaEffectCloudRenderer
,HologramTrait.ArmorstandRenderer
,HologramTrait.ArmorstandVehicleRenderer
,HologramTrait.InteractionVehicleRenderer
,HologramTrait.ItemDisplayRenderer
,HologramTrait.ItemRenderer
,HologramTrait.SingleEntityHologramRenderer
,HologramTrait.TextDisplayRenderer
,HologramTrait.TextDisplayVehicleRenderer
- Enclosing class:
HologramTrait
public static interface HologramTrait.HologramRenderer
API for rendering holograms. Assumptions are documented in Javadoc but the API is early and subject to change.
Feedback is welcomed.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroy/teardown any rendered holograms.getPerPlayerText
(NPC hologram, Player viewer) Ifinvalid reference
NPC.Metadata.HOLOGRAM_RENDERER
default boolean
isSneaking
(NPC npc, Player player) Ifinvalid reference
NPC.Metadata.HOLOGRAM_RENDERER
default void
onSeenByPlayer
(NPC hologram, Player player) Ifinvalid reference
NPC.Metadata.HOLOGRAM_RENDERER
void
Render the hologram at a given offset.default void
setBackgroundColor
(Color color) void
updateText
(NPC parent, String text) Update the hologram text.
-
Method Details
-
destroy
void destroy()Destroy/teardown any rendered holograms. -
getEntities
Collection<Entity> getEntities()- Returns:
- Any associated hologram entities. Used in
getEntities()
.
-
getPerPlayerText
Ifinvalid reference
NPC.Metadata.HOLOGRAM_RENDERER
- Parameters:
hologram
- the hologram NPCviewer
- the viewing Player- Returns:
- the modified text per Player
-
isSneaking
Ifinvalid reference
NPC.Metadata.HOLOGRAM_RENDERER
- Parameters:
npc
- the NPCplayer
- the viewing Player- Returns:
- whether the NPC is sneaking
-
onSeenByPlayer
Ifinvalid reference
NPC.Metadata.HOLOGRAM_RENDERER
- Parameters:
hologram
- the hologram NPCplayer
- the viewing Player
-
render
Render the hologram at a given offset. Any underlying hologram NPCs should be spawned at this point.- Parameters:
parent
- the parent NPC.offset
- the offset, in blocks
-
setBackgroundColor
-
updateText
Update the hologram text. Will be called first beforerender(NPC, Vector3d)
.- Parameters:
parent
- the parent NPCtext
- the new hologram text
-