Package net.citizensnpcs.api.trait.trait
Class PlayerFilter
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.api.trait.trait.PlayerFilter
- 
Nested Class SummaryNested Classes
- 
Field Summary
- 
Constructor SummaryConstructorsConstructorDescriptionPlayerFilter(BiConsumer<Player, Entity> hideFunction, BiConsumer<Player, Entity> viewFunction) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddChildNPC(NPC npc) voidManages NPC hiding using the given permissions groupvoidaddPermission(String permission) Manages NPC hiding using the given permissionvoidManages NPC hiding from the provided UUIDbooleanaffectsGroup(String group) booleanaffectsPlayer(UUID uuid) voidclear()Clears all set UUID filters.doubleImplementation detail: may change in the future.Implementation detail: may change in the future.Implementation detail: may change in the future.booleanbooleanbooleanWhether the NPC should be hidden from the given PlayervoidCalled just before the attachedNPCis despawned.booleanonSeenByPlayer(Player player) For internal use.voidvoidremoveGroup(String group) Unhides the given permissions groupvoidremovePermission(String permission) Unhides the given permissionvoidremovePlayer(UUID uuid) Unhides the given Player UUIDvoidrun()Called every tick if overridden.voidvoidsetApplyRange(double range) Sets the range in blocks where the filter applies.voidImplementation detail: may change in the future.voidsetPlayerFilter(Function<Player, Boolean> filter) voidsetPlayers(Set<UUID> players) Implementation detail: may change in the future.
- 
Constructor Details- 
PlayerFilterpublic PlayerFilter()
- 
PlayerFilter
 
- 
- 
Method Details- 
addChildNPC
- 
addGroupManages NPC hiding using the given permissions group
- 
addPermissionManages NPC hiding using the given permission
- 
addPlayerManages NPC hiding from the provided UUID- Parameters:
- uuid-
 
- 
affectsGroup
- 
affectsPlayer
- 
clearpublic void clear()Clears all set UUID filters.
- 
getApplyRangepublic double getApplyRange()
- 
getGroupsImplementation detail: may change in the future.
- 
getPermissionsImplementation detail: may change in the future.
- 
getPlayerUUIDsImplementation detail: may change in the future.
- 
isAllowlistpublic boolean isAllowlist()
- 
isDenylistpublic boolean isDenylist()
- 
isHiddenWhether the NPC should be hidden from the given Player
- 
onDespawnpublic void onDespawn()Description copied from class:TraitCalled just before the attachedNPCis despawned.NPC.getEntity()will be non-null.
- 
onSeenByPlayerFor internal use. Method signature may be changed at any time.
- 
recalculatepublic void recalculate()
- 
removeGroupUnhides the given permissions group
- 
removePermissionUnhides the given permission
- 
removePlayerUnhides the given Player UUID
- 
runpublic void run()Description copied from class:TraitCalled every tick if overridden.
- 
setAllowlistpublic void setAllowlist()
- 
setApplyRangepublic void setApplyRange(double range) Sets the range in blocks where the filter applies. For example, if the range is 25 blocks and the Player is more than 25 blocks away, the filter is ignored and the Player will not be hidden.- Parameters:
- range- The new range
 
- 
setDenylistpublic void setDenylist()Implementation detail: may change in the future.
- 
setPlayerFilter
- 
setPlayersImplementation detail: may change in the future.
 
-