public class NPCPlugin extends JavaPlugin
The main plugin class for Npc. This plugin provides gameplay features for the Hytale server. Extend this class to create a plugin.
java.lang.Object > JavaPlugin > NPCPlugin
Field Summary
builderDescriptors
Field builderDescriptors.
validateBuilder
Field validateBuilder.
maxBlackboardBlockCountPerType
Field maxBlackboardBlockCountPerType.
logFailingTestErrors
Field logFailingTestErrors.
presetCoverageTestNPCs
Field presetCoverageTestNPCs.
pathChangeRevision
Field pathChangeRevision.
benchmarkLock
Field benchmarkLock.
roleTickDistribution
Field roleTickDistribution.
roleSensorSupportDistribution
Field roleSensorSupportDistribution.
roleTickDistributionAll
Field roleTickDistributionAll.
roleSensorSupportDistributionAll
Field roleSensorSupportDistributionAll.
autoReload
Field autoReload.
attitudeMap
Field attitudeMap.
itemAttitudeMap
Field itemAttitudeMap.
entityStoreRegistry
Field entityStoreRegistry.
eventRegistry
Field eventRegistry.
start
Field start.
validateAssets
Field validateAssets.
assetPacks
Field assetPacks.
includeTests
Field includeTests.
loadSucceeded
Field loadSucceeded.
postBehaviourDependency
Field postBehaviourDependency.
schema
Field schema.
hytale
Field hytale.
config
Field config.
roleIndex
Field roleIndex.
flockDefinition
Field flockDefinition.
npcRef
Field npcRef.
npcComponent
Field npcComponent.
npc
Field npc.
attitudeGroupCount
Field attitudeGroupCount.
iterator
Field iterator.
index
Field index.
index2
Field index2.
builder
Field builder.
tagSetIndexMap
Field tagSetIndexMap.
builderInfo
Field builderInfo.
worldTimeResource
Field worldTimeResource.
roleName
Field roleName.
holder
Field holder.
displayNameComponent
Field displayNameComponent.
ref
Field ref.
scope
Field scope.
store
Field store.
entityModelComponent
Field entityModelComponent.
oldModel
Field oldModel.
newModelAsset
Field newModelAsset.
entityReference
Field entityReference.
path
Field path.
distribution
Field distribution.
factory
Field factory.
roleFactory
Field roleFactory.
motionControllerFactory
Field motionControllerFactory.
actionListFactory
Field actionListFactory.
instructionFactory
Field instructionFactory.
transientPathFactory
Field transientPathFactory.
relativeWaypointFactory
Field relativeWaypointFactory.
weightedActionFactory
Field weightedActionFactory.
valueToParameterMappingFactory
Field valueToParameterMappingFactory.
removedAssets
Field removedAssets.
generateDescriptors
Field generateDescriptors.
generateDescriptorsFile
Field generateDescriptorsFile.
maxBlackboardBlockType
Field maxBlackboardBlockType.
Method Detail
setup
void
setup
()
Method setup.
NPCCommand
new
NPCCommand
()
Method NPCCommand.
IndexedLookupTableAssetMap
new
IndexedLookupTableAssetMap
(AttitudeGroup[]::new)
Method IndexedLookupTableAssetMap.
- Parameters:
AttitudeGroup[]::newAttitudeGroup[]::new
DefaultAssetMap
new
DefaultAssetMap
()
Method DefaultAssetMap.
UseNPCInteraction
new
UseNPCInteraction
("*UseNPC")
Method UseNPCInteraction.
- Parameters:
"*UseNPC""*UseNPC"
KDTree
new
KDTree
(Ref::isValid)
Method KDTree.
- Parameters:
Ref::isValidRef::isValid
RoleBuilderSystem
new
RoleBuilderSystem
()
Method RoleBuilderSystem.
BalancingInitialisationSystem
new
BalancingInitialisationSystem
()
Method BalancingInitialisationSystem.
FailedSpawnSystem
new
FailedSpawnSystem
()
Method FailedSpawnSystem.
StateEvaluatorSystem
new
StateEvaluatorSystem
(this.stateEvaluatorComponentType, npcComponentType)
Method StateEvaluatorSystem.
- Parameters:
this.stateEvaluatorComponentTypethis.stateEvaluatorComponentTypenpcComponentTypenpcComponentType
NPCPreTickSystem
new
NPCPreTickSystem
(npcComponentType)
Method NPCPreTickSystem.
- Parameters:
npcComponentTypenpcComponentType
SystemDependency
new
SystemDependency
(Order.AFTER, RoleSystems.PostBehaviourSupportTickSystem.class)
Method SystemDependency.
- Parameters:
Order.AFTEROrder.AFTERRoleSystems.PostBehaviourSupportTickSystem.classRoleSystems.PostBehaviourSupportTickSystem.class
AvoidanceSystem
new
AvoidanceSystem
(npcComponentType)
Method AvoidanceSystem.
- Parameters:
npcComponentTypenpcComponentType
SteeringSystem
new
SteeringSystem
(npcComponentType)
Method SteeringSystem.
- Parameters:
npcComponentTypenpcComponentType
TimerSystem
new
TimerSystem
(this.timersComponentType, postBehaviourDependency)
Method TimerSystem.
- Parameters:
this.timersComponentTypethis.timersComponentTypepostBehaviourDependencypostBehaviourDependency
ComputeVelocitySystem
new
ComputeVelocitySystem
(npcComponentType, EntityModule.get()
Method ComputeVelocitySystem.
- Parameters:
npcComponentTypenpcComponentTypeEntityModule.get(EntityModule.get(
MovementStatesSystem
new
MovementStatesSystem
(npcComponentType, EntityModule.get()
Method MovementStatesSystem.
- Parameters:
npcComponentTypenpcComponentTypeEntityModule.get(EntityModule.get(
StepCleanupSystem
new
StepCleanupSystem
(this.stepComponentType)
Method StepCleanupSystem.
- Parameters:
this.stepComponentTypethis.stepComponentType
NewSpawnStartTickingSystem
new
NewSpawnStartTickingSystem
(this.newSpawnStartTickingQueueResourceType)
Method NewSpawnStartTickingSystem.
- Parameters:
this.newSpawnStartTickingQueueResourceTypethis.newSpawnStartTickingQueueResourceType
RoleChangeSystem
new
RoleChangeSystem
(this.roleChangeQueueResourceType, this.beaconSupportComponentType, this.playerBlockEventSupportComponentType, this.npcBlockEventSupportComponentType, this.playerEntityEventSupportComponentType, this.npcEntityEventSupportComponentType, this.timersComponentType, this.stateEvaluatorComponentType, this.valueStoreComponentType)
Method RoleChangeSystem.
- Parameters:
this.roleChangeQueueResourceTypethis.roleChangeQueueResourceTypethis.beaconSupportComponentTypethis.beaconSupportComponentTypethis.playerBlockEventSupportComponentTypethis.playerBlockEventSupportComponentTypethis.npcBlockEventSupportComponentTypethis.npcBlockEventSupportComponentTypethis.playerEntityEventSupportComponentTypethis.playerEntityEventSupportComponentTypethis.npcEntityEventSupportComponentTypethis.npcEntityEventSupportComponentTypethis.timersComponentTypethis.timersComponentTypethis.stateEvaluatorComponentTypethis.stateEvaluatorComponentTypethis.valueStoreComponentTypethis.valueStoreComponentType
NPCSpatialSystem
new
NPCSpatialSystem
(this.npcSpatialResource)
Method NPCSpatialSystem.
- Parameters:
this.npcSpatialResourcethis.npcSpatialResource
NPCVelocityInstructionSystem
new
NPCVelocityInstructionSystem
()
Method NPCVelocityInstructionSystem.
NPCEntityRegenerateStatsSystem
new
NPCEntityRegenerateStatsSystem
()
Method NPCEntityRegenerateStatsSystem.
start
void
start
()
Method start.
getBlackboardResourceType
Blackboard>
getBlackboardResourceType
()
Method getBlackboardResourceType.
getCombatDataPoolResourceType
CombatViewSystems.CombatDataPool>
getCombatDataPoolResourceType
()
Method getCombatDataPoolResourceType.
getRoleChangeQueueResourceType
RoleChangeSystem.RoleChangeQueue>
getRoleChangeQueueResourceType
()
Method getRoleChangeQueueResourceType.
getNewSpawnStartTickingQueueResourceType
NewSpawnStartTickingSystem.QueueResource>
getNewSpawnStartTickingQueueResourceType
()
Method getNewSpawnStartTickingQueueResourceType.
getSortBufferProviderResourceResourceType
SortBufferProviderResource>
getSortBufferProviderResourceResourceType
()
Method getSortBufferProviderResourceResourceType.
getAStarNodePoolProviderSimpleResourceType
AStarNodePoolProviderSimple>
getAStarNodePoolProviderSimpleResourceType
()
Method getAStarNodePoolProviderSimpleResourceType.
getNpcSpatialResource
EntityStore>>
getNpcSpatialResource
()
Method getNpcSpatialResource.
getCombatDataComponentType
CombatViewSystems.CombatData>
getCombatDataComponentType
()
Method getCombatDataComponentType.
getNpcTestDataComponentType
NPCRunTestsCommand.NPCTestData>
getNpcTestDataComponentType
()
Method getNpcTestDataComponentType.
getBeaconSupportComponentType
BeaconSupport>
getBeaconSupportComponentType
()
Method getBeaconSupportComponentType.
getNpcBlockEventSupportComponentType
NPCBlockEventSupport>
getNpcBlockEventSupportComponentType
()
Method getNpcBlockEventSupportComponentType.
getPlayerBlockEventSupportComponentType
PlayerBlockEventSupport>
getPlayerBlockEventSupportComponentType
()
Method getPlayerBlockEventSupportComponentType.
getNpcEntityEventSupportComponentType
NPCEntityEventSupport>
getNpcEntityEventSupportComponentType
()
Method getNpcEntityEventSupportComponentType.
getPlayerEntityEventSupportComponentType
PlayerEntityEventSupport>
getPlayerEntityEventSupportComponentType
()
Method getPlayerEntityEventSupportComponentType.
getStepComponentType
StepComponent>
getStepComponentType
()
Method getStepComponentType.
getFailedSpawnComponentType
FailedSpawnComponent>
getFailedSpawnComponentType
()
Method getFailedSpawnComponentType.
getTimersComponentType
Timers>
getTimersComponentType
()
Method getTimersComponentType.
getStateEvaluatorComponentType
StateEvaluator>
getStateEvaluatorComponentType
()
Method getStateEvaluatorComponentType.
getValueStoreComponentType
ValueStore>
getValueStoreComponentType
()
Method getValueStoreComponentType.
setupNPCLoading
void
setupNPCLoading
()
Method setupNPCLoading.
getPresetCoverageTestNPCs
String[]
getPresetCoverageTestNPCs
()
Method getPresetCoverageTestNPCs.
spawnNPC
INonPlayerCharacter>
spawnNPC
(@Nonnull final Store store, @Nonnull final String npcType, @Nullable final String groupType, @Nonnull final Vector3d position, @Nonnull final Vector3f rotation)
Method spawnNPC.
- Parameters:
@Nonnull final Storestore@Nonnull final StringnpcType@Nullable final StringgroupType@Nonnull final Vector3dposition@Nonnull final Vector3frotation
reloadNPCsWithRole
void
reloadNPCsWithRole
(final int roleIndex)
Method reloadNPCsWithRole.
- Parameters:
final introleIndex
onAttitudeGroupsLoaded
Method onAttitudeGroupsLoaded.
- Parameters:
@Nonnull final LoadedAssetsEventevent>
onItemAttitudeGroupsLoaded
Method onItemAttitudeGroupsLoaded.
- Parameters:
@Nonnull final LoadedAssetsEventevent>
onItemAttitudeGroupsRemoved
Method onItemAttitudeGroupsRemoved.
- Parameters:
final RemovedAssetsEventevent>
putItemAttitudeGroups
void
putItemAttitudeGroups
()
Method putItemAttitudeGroups.
getPathChangeRevision
int
getPathChangeRevision
()
Method getPathChangeRevision.
putNPCGroups
void
putNPCGroups
()
Method putNPCGroups.
putAttitudeGroups
void
putAttitudeGroups
()
Method putAttitudeGroups.
getName
String
getName
(final int builderIndex)
Method getName.
- Parameters:
final intbuilderIndex
getIndex
int
getIndex
(final String builderName)
Method getIndex.
- Parameters:
final StringbuilderName
tryGetCachedValidRole
Method tryGetCachedValidRole.
- Parameters:
final introleIndex
getRoleTemplateNames
List
getRoleTemplateNames
(final boolean spawnableOnly)
Method getRoleTemplateNames.
- Parameters:
final booleanspawnableOnly
ObjectArrayList
new
ObjectArrayList
()
Method ObjectArrayList.
hasRoleName
boolean
hasRoleName
(final String roleName)
Method hasRoleName.
- Parameters:
final StringroleName
validateSpawnableRole
void
validateSpawnableRole
(final String roleName)
Method validateSpawnableRole.
- Parameters:
final StringroleName
SkipSentryException
new
SkipSentryException
(new IllegalArgumentException(roleName + " does not exist as a role!")
Method SkipSentryException.
- Parameters:
new IllegalArgumentException(roleName + " does not exist as arole!"
getRoleBuilderInfo
Method getRoleBuilderInfo.
- Parameters:
final introleIndex
setBuilderInvalid
void
setBuilderInvalid
(final int builderIndex)
Method setBuilderInvalid.
- Parameters:
final intbuilderIndex
forceValidation
void
forceValidation
(final int builderIndex)
Method forceValidation.
- Parameters:
final intbuilderIndex
spawnEntity
NPCEntity>
spawnEntity
(@Nonnull final Store store, final int roleIndex, @Nonnull final Vector3d position, final Vector3f rotation, final Model spawnModel, final TriConsumer, Store> postSpawn)
Method spawnEntity.
- Parameters:
@Nonnull final Storestorefinal introleIndex@Nonnull final Vector3dpositionfinal Vector3frotationfinal ModelspawnModelfinal TriConsumerpostSpawn, Store >
TransformComponent
new
TransformComponent
(position, rotation)
Method TransformComponent.
- Parameters:
positionpositionrotationrotation
HeadRotation
new
HeadRotation
(rotation)
Method HeadRotation.
- Parameters:
rotationrotation
DisplayNameComponent
new
DisplayNameComponent
(Message.raw(roleName)
Method DisplayNameComponent.
- Parameters:
Message.raw(roleNameMessage.raw(roleName
ModelComponent
new
ModelComponent
(spawnModel)
Method ModelComponent.
- Parameters:
spawnModelspawnModel
PersistentModel
new
PersistentModel
(spawnModel.toReference()
Method PersistentModel.
- Parameters:
spawnModel.toReference(spawnModel.toReference(
prepareRoleBuilderInfo
Method prepareRoleBuilderInfo.
- Parameters:
final introleIndex
buildRole
Role
buildRole
(@Nonnull final Builder roleBuilder, @Nonnull final BuilderInfo builderInfo, @Nonnull final BuilderSupport builderSupport, final int roleIndex)
Method buildRole.
- Parameters:
@Nonnull final BuilderroleBuilder@Nonnull final BuilderInfobuilderInfo@Nonnull final BuilderSupportbuilderSupportfinal introleIndex
generateDescriptors
void
generateDescriptors
()
Method generateDescriptors.
saveDescriptors
void
saveDescriptors
()
Method saveDescriptors.
getMaxBlackboardBlockCountPerType
int
getMaxBlackboardBlockCountPerType
()
Method getMaxBlackboardBlockCountPerType.
isLogFailingTestErrors
boolean
isLogFailingTestErrors
()
Method isLogFailingTestErrors.
startRoleBenchmark
boolean
startRoleBenchmark
(final double seconds, @Nonnull final Consumer> onFinished)
Method startRoleBenchmark.
- Parameters:
final doubleseconds@Nonnull final ConsumeronFinished>
collectRoleTick
void
collectRoleTick
(final int roleIndex, final long nanos)
Method collectRoleTick.
- Parameters:
final introleIndexfinal longnanos
isBenchmarkingRole
boolean
isBenchmarkingRole
()
Method isBenchmarkingRole.
startSensorSupportBenchmark
boolean
startSensorSupportBenchmark
(final double seconds, @Nonnull final Consumer> onFinished)
Method startSensorSupportBenchmark.
- Parameters:
final doubleseconds@Nonnull final ConsumeronFinished>
isBenchmarkingSensorSupport
boolean
isBenchmarkingSensorSupport
()
Method isBenchmarkingSensorSupport.
isBenchmarking
boolean
isBenchmarking
()
Method isBenchmarking.
collectSensorSupportPlayerList
void
collectSensorSupportPlayerList
(final int roleIndex, final long getNanos, final double maxPlayerDistanceSorted, final double maxPlayerDistance, final double maxPlayerDistanceAvoidance, final int numPlayers)
Method collectSensorSupportPlayerList.
- Parameters:
final introleIndexfinal longgetNanosfinal doublemaxPlayerDistanceSortedfinal doublemaxPlayerDistancefinal doublemaxPlayerDistanceAvoidancefinal intnumPlayers
collectSensorSupportEntityList
void
collectSensorSupportEntityList
(final int roleIndex, final long getNanos, final double maxEntityDistanceSorted, final double maxEntityDistance, final double maxEntityDistanceAvoidance, final int numEntities)
Method collectSensorSupportEntityList.
- Parameters:
final introleIndexfinal longgetNanosfinal doublemaxEntityDistanceSortedfinal doublemaxEntityDistancefinal doublemaxEntityDistanceAvoidancefinal intnumEntities
collectSensorSupportLosTest
void
collectSensorSupportLosTest
(final int roleIndex, final boolean cacheHit, final long time)
Method collectSensorSupportLosTest.
- Parameters:
final introleIndexfinal booleancacheHitfinal longtime
collectSensorSupportInverseLosTest
void
collectSensorSupportInverseLosTest
(final int roleIndex, final boolean cacheHit)
Method collectSensorSupportInverseLosTest.
- Parameters:
final introleIndexfinal booleancacheHit
collectSensorSupportFriendlyBlockingTest
void
collectSensorSupportFriendlyBlockingTest
(final int roleIndex, final boolean cacheHit)
Method collectSensorSupportFriendlyBlockingTest.
- Parameters:
final introleIndexfinal booleancacheHit
collectSensorSupportTickDone
void
collectSensorSupportTickDone
(final int roleIndex)
Method collectSensorSupportTickDone.
- Parameters:
final introleIndex
registerCoreComponentType
Method registerCoreComponentType.
- Parameters:
final Stringname@Nonnull final Supplierbuilder>
registerCoreFactories
void
registerCoreFactories
()
Method registerCoreFactories.
onBalanceAssetsChanged
Method onBalanceAssetsChanged.
- Parameters:
@Nonnull final LoadedAssetsEventevent>
onBalanceAssetsRemoved
Method onBalanceAssetsRemoved.
- Parameters:
@Nonnull final RemovedAssetsEventevent>
NPCConfig
public
NPCConfig
()
Method NPCConfig.
isGenerateDescriptors
boolean
isGenerateDescriptors
()
Method isGenerateDescriptors.
isGenerateDescriptorsFile
boolean
isGenerateDescriptorsFile
()
Method isGenerateDescriptorsFile.
isAutoReload
boolean
isAutoReload
()
Method isAutoReload.
isValidateBuilder
boolean
isValidateBuilder
()
Method isValidateBuilder.
getMaxBlackboardBlockType
int
getMaxBlackboardBlockType
()
Method getMaxBlackboardBlockType.