public class PositionCache
Class PositionCache. Provides positioncache functionality for the Hytale server.
java.lang.Object > PositionCache
Field Summary
maxDroppedItemDistance
Field maxDroppedItemDistance.
maxSpawnMarkerDistance
Field maxSpawnMarkerDistance.
maxSpawnBeaconDistance
Field maxSpawnBeaconDistance.
opaqueBlockSet
Field opaqueBlockSet.
players
Field players.
npcs
Field npcs.
cacheTTL
Field cacheTTL.
positionCacheNextUpdate
Field positionCacheNextUpdate.
isBenchmarking
Field isBenchmarking.
isConfiguring
Field isConfiguring.
couldBreathe
Field couldBreathe.
roleStats
Field roleStats.
droppedItemsSize
Field droppedItemsSize.
transformComponent
Field transformComponent.
position
Field position.
itemEntityRef
Field itemEntityRef.
itemComponent
Field itemComponent.
itemEntityTransformComponent
Field itemEntityTransformComponent.
squaredDistance
Field squaredDistance.
value
Field value.
modelComponent
Field modelComponent.
eyeHeight
Field eyeHeight.
sx
Field sx.
sy
Field sy.
sz
Field sz.
targetTransformComponent
Field targetTransformComponent.
targetPosition
Field targetPosition.
tx
Field tx.
ty
Field ty.
tz
Field tz.
targetModelComponent
Field targetModelComponent.
boundingBoxComponent
Field boundingBoxComponent.
boundingBox
Field boundingBox.
world
Field world.
blockSets
Field blockSets.
opaqueSet
Field opaqueSet.
blockId
Field blockId.
blockType
Field blockType.
cached
Field cached.
start
Field start.
hasLineOfSight
Field hasLineOfSight.
blocking
Field blocking.
squaredLength
Field squaredLength.
px
Field px.
py
Field py.
pz
Field pz.
dx
Field dx.
dy
Field dy.
dz
Field dz.
dotProduct
Field dotProduct.
dist2
Field dist2.
playerComponent
Field playerComponent.
playerSettingsComponent
Field playerSettingsComponent.
chunk
Field chunk.
result
Field result.
Method Detail
isBenchmarking
boolean
isBenchmarking
()
Method isBenchmarking.
setBenchmarking
void
setBenchmarking
(final boolean benchmarking)
Method setBenchmarking.
- Parameters:
final booleanbenchmarking
setCouldBreathe
void
setCouldBreathe
(final boolean couldBreathe)
Method setCouldBreathe.
- Parameters:
final booleancouldBreathe
tickPositionCacheNextUpdate
boolean
tickPositionCacheNextUpdate
(final float dt)
Method tickPositionCacheNextUpdate.
- Parameters:
final floatdt
resetPositionCacheNextUpdate
void
resetPositionCacheNextUpdate
()
Method resetPositionCacheNextUpdate.
getMaxDroppedItemDistance
double
getMaxDroppedItemDistance
()
Method getMaxDroppedItemDistance.
getMaxSpawnMarkerDistance
double
getMaxSpawnMarkerDistance
()
Method getMaxSpawnMarkerDistance.
getMaxSpawnBeaconDistance
int
getMaxSpawnBeaconDistance
()
Method getMaxSpawnBeaconDistance.
addExternalPositionCacheRegistration
void
addExternalPositionCacheRegistration
(final Consumer registration)
Method addExternalPositionCacheRegistration.
- Parameters:
final Consumerregistration
getExternalRegistrations
List>
getExternalRegistrations
()
Method getExternalRegistrations.
reset
void
reset
(final boolean isConfiguring)
Method reset.
- Parameters:
final booleanisConfiguring
finalizeConfiguration
void
finalizeConfiguration
()
Method finalizeConfiguration.
clear
void
clear
(final double tickTime)
Method clear.
- Parameters:
final doubletickTime
couldBreatheCached
boolean
couldBreatheCached
()
Method couldBreatheCached.
forEachPlayer
void
forEachPlayer
(@Nonnull final DoubleQuadObjectConsumer, T, U, V> consumer, final T t, final U u, final V v, final double d, final ComponentAccessor componentAccessor)
Method forEachPlayer.
- Parameters:
@Nonnull final DoubleQuadObjectConsumer, T, U, V>consumerfinal Ttfinal Uufinal Vvfinal doubledfinal ComponentAccessorcomponentAccessor
getClosestPlayerInRange
Ref
getClosestPlayerInRange
(final double minRange, final double maxRange, @Nonnull final ComponentAccessor componentAccessor)
Method getClosestPlayerInRange.
- Parameters:
final doubleminRangefinal doublemaxRange@Nonnull final ComponentAccessorcomponentAccessor
getClosestNPCInRange
Ref
getClosestNPCInRange
(final double minRange, final double maxRange, @Nonnull final Predicate> filter, @Nonnull final ComponentAccessor componentAccessor)
Method getClosestNPCInRange.
- Parameters:
final doubleminRangefinal doublemaxRange@Nonnull final Predicate>filter@Nonnull final ComponentAccessorcomponentAccessor
processNPCsInRange
void
processNPCsInRange
(@Nonnull final Ref ref, final double minRange, final double maxRange, final boolean useProjectedDistance, final Ref ignoredEntityReference, @Nonnull final Role role, @Nonnull final QuadPredicate, Role, T> filter, final S s, final T t, @Nonnull final ComponentAccessor componentAccessor)
Method processNPCsInRange.
- Parameters:
@Nonnull final Refreffinal doubleminRangefinal doublemaxRangefinal booleanuseProjectedDistancefinal RefignoredEntityReference@Nonnull final Rolerole@Nonnull final QuadPredicatefilter, Role, T>final Ssfinal Tt@Nonnull final ComponentAccessorcomponentAccessor
processPlayersInRange
void
processPlayersInRange
(@Nonnull final Ref ref, final double minRange, final double maxRange, final boolean useProjectedDistance, final Ref ignoredEntityReference, @Nonnull final Role role, @Nonnull final QuadPredicate, Role, T> filter, final S s, final T t, @Nonnull final ComponentAccessor componentAccessor)
Method processPlayersInRange.
- Parameters:
@Nonnull final Refreffinal doubleminRangefinal doublemaxRangefinal booleanuseProjectedDistancefinal RefignoredEntityReference@Nonnull final Rolerole@Nonnull final QuadPredicatefilter, Role, T>final Ssfinal Tt@Nonnull final ComponentAccessorcomponentAccessor
processEntitiesInRange
void
processEntitiesInRange
(@Nonnull final Ref ref, @Nonnull final EntityList entities, final double minRange, final double maxRange, final boolean useProjectedDistance, final Ref ignoredEntityReference, @Nonnull final Role role, @Nonnull final QuadPredicate, Role, T> filter, final S s, final T t, @Nonnull final ComponentAccessor componentAccessor)
Method processEntitiesInRange.
- Parameters:
@Nonnull final Refref@Nonnull final EntityListentitiesfinal doubleminRangefinal doublemaxRangefinal booleanuseProjectedDistancefinal RefignoredEntityReference@Nonnull final Rolerole@Nonnull final QuadPredicatefilter, Role, T>final Ssfinal Tt@Nonnull final ComponentAccessorcomponentAccessor
getClosestDroppedItemInRange
Ref
getClosestDroppedItemInRange
(@Nonnull final Ref ref, double minRange, double maxRange, @Nonnull final QuadPredicate, Role, ComponentAccessor> filter, final Role role, final S s, @Nonnull final ComponentAccessor componentAccessor)
Method getClosestDroppedItemInRange.
- Parameters:
@Nonnull final RefrefdoubleminRangedoublemaxRange@Nonnull final QuadPredicatefilter, Role, ComponentAccessor> final Rolerolefinal Ss@Nonnull final ComponentAccessorcomponentAccessor
isEntityCountInRange
boolean
isEntityCountInRange
(final double minRange, final double maxRange, final int minCount, final int maxCount, final boolean findPlayers, final Role role, @Nonnull final QuadPredicate, Role, ComponentAccessor> filter, final S s, final ComponentAccessor componentAccessor)
Method isEntityCountInRange.
- Parameters:
final doubleminRangefinal doublemaxRangefinal intminCountfinal intmaxCountfinal booleanfindPlayersfinal Rolerole@Nonnull final QuadPredicatefilter, Role, ComponentAccessor> final Ssfinal ComponentAccessorcomponentAccessor
countEntitiesInRange
int
countEntitiesInRange
(final double minRange, final double maxRange, final boolean findPlayers, @Nonnull final QuadPredicate, T, ComponentAccessor> filter, final S s, final T t, final ComponentAccessor componentAccessor)
Method countEntitiesInRange.
- Parameters:
final doubleminRangefinal doublemaxRangefinal booleanfindPlayers@Nonnull final QuadPredicatefilter, T, ComponentAccessor> final Ssfinal Ttfinal ComponentAccessorcomponentAccessor
requirePlayerDistanceSorted
void
requirePlayerDistanceSorted
(final double v)
Method requirePlayerDistanceSorted.
- Parameters:
final doublev
requirePlayerDistanceUnsorted
void
requirePlayerDistanceUnsorted
(final double v)
Method requirePlayerDistanceUnsorted.
- Parameters:
final doublev
requirePlayerDistanceAvoidance
void
requirePlayerDistanceAvoidance
(final double v)
Method requirePlayerDistanceAvoidance.
- Parameters:
final doublev
requireEntityDistanceSorted
void
requireEntityDistanceSorted
(final double v)
Method requireEntityDistanceSorted.
- Parameters:
final doublev
requireEntityDistanceUnsorted
void
requireEntityDistanceUnsorted
(final double v)
Method requireEntityDistanceUnsorted.
- Parameters:
final doublev
requireEntityDistanceAvoidance
void
requireEntityDistanceAvoidance
(final double v)
Method requireEntityDistanceAvoidance.
- Parameters:
final doublev
requireDroppedItemDistance
void
requireDroppedItemDistance
(final double value)
Method requireDroppedItemDistance.
- Parameters:
final doublevalue
requireSpawnMarkerDistance
void
requireSpawnMarkerDistance
(final double value)
Method requireSpawnMarkerDistance.
- Parameters:
final doublevalue
requireSpawnBeaconDistance
void
requireSpawnBeaconDistance
(final int value)
Method requireSpawnBeaconDistance.
- Parameters:
final intvalue
forEachNPCUnordered
void
forEachNPCUnordered
(final double maxDistance, @Nonnull final QuadPredicate, T, U, ComponentAccessor> predicate, @Nonnull final QuadConsumer, T, V, R> consumer, final T t, final U u, final V v, final R r, final ComponentAccessor componentAccessor)
Method forEachNPCUnordered.
- Parameters:
final doublemaxDistance@Nonnull final QuadPredicate, T, U, ComponentAccessorpredicate> @Nonnull final QuadConsumer, T, V, R>consumerfinal Ttfinal Uufinal Vvfinal Rrfinal ComponentAccessorcomponentAccessor
forEachEntityInAvoidanceRange
void
forEachEntityInAvoidanceRange
(@Nonnull final Set> ignoredEntitiesForAvoidance, @Nonnull final TriConsumer, T, CommandBuffer> consumer, final T t, final CommandBuffer commandBuffer)
Method forEachEntityInAvoidanceRange.
- Parameters:
@Nonnull final Set>ignoredEntitiesForAvoidance@Nonnull final TriConsumer, T, CommandBufferconsumer> final Ttfinal CommandBuffercommandBuffer
setOpaqueBlockSet
void
setOpaqueBlockSet
(final int blockSet)
Method setOpaqueBlockSet.
- Parameters:
final intblockSet
testLineOfSightRays
boolean
testLineOfSightRays
(@Nonnull final Ref ref, @Nonnull final Ref targetRef, @Nonnull final RayPredicate predicate, @Nonnull final T t, @Nonnull final ComponentAccessor componentAccessor)
Method testLineOfSightRays.
- Parameters:
@Nonnull final Refref@Nonnull final ReftargetRef@Nonnull final RayPredicatepredicate@Nonnull final Tt@Nonnull final ComponentAccessorcomponentAccessor
hasLineOfSightInternal
boolean
hasLineOfSightInternal
(@Nonnull final Ref ref, @Nonnull final Ref targetRef, @Nonnull final ComponentAccessor componentAccessor)
Method hasLineOfSightInternal.
- Parameters:
@Nonnull final Refref@Nonnull final ReftargetRef@Nonnull final ComponentAccessorcomponentAccessor
hasLineOfSight
boolean
hasLineOfSight
(@Nonnull final Ref ref, @Nonnull final Ref targetRef, @Nonnull final ComponentAccessor componentAccessor)
Method hasLineOfSight.
- Parameters:
@Nonnull final Refref@Nonnull final ReftargetRef@Nonnull final ComponentAccessorcomponentAccessor
hasInverseLineOfSight
boolean
hasInverseLineOfSight
(@Nonnull final Ref ref, @Nonnull final Ref targetRef, @Nonnull final ComponentAccessor componentAccessor)
Method hasInverseLineOfSight.
- Parameters:
@Nonnull final Refref@Nonnull final ReftargetRef@Nonnull final ComponentAccessorcomponentAccessor
isFriendlyBlockingLineOfSight
boolean
isFriendlyBlockingLineOfSight
(@Nonnull final Ref ref, @Nonnull final Ref targetRef, @Nonnull final ComponentAccessor componentAccessor)
Method isFriendlyBlockingLineOfSight.
- Parameters:
@Nonnull final Refref@Nonnull final ReftargetRef@Nonnull final ComponentAccessorcomponentAccessor
testLineOfSightEntity
boolean
testLineOfSightEntity
(@Nonnull final Ref ref, @Nonnull final Ref targetRef, @Nonnull final LineOfSightEntityBuffer buffer, @Nonnull final ComponentAccessor componentAccessor, final double length2)
Method testLineOfSightEntity.
- Parameters:
@Nonnull final Refref@Nonnull final ReftargetRef@Nonnull final LineOfSightEntityBufferbuffer@Nonnull final ComponentAccessorcomponentAccessorfinal doublelength2
clearLineOfSightCache
void
clearLineOfSightCache
(final double tickTime)
Method clearLineOfSightCache.
- Parameters:
final doubletickTime
rayIsIntersectingEntity
boolean
rayIsIntersectingEntity
(@Nonnull final Ref ref, @Nonnull final Vector3d pos, @Nonnull final Vector3d dir, @Nonnull final Vector2d minMax, final double length2, @Nonnull final ComponentAccessor componentAccessor)
Method rayIsIntersectingEntity.
- Parameters:
@Nonnull final Refref@Nonnull final Vector3dpos@Nonnull final Vector3ddir@Nonnull final Vector2dminMaxfinal doublelength2@Nonnull final ComponentAccessorcomponentAccessor
if
else
if
(playerComponent.getGameMode()
Method if.
- Parameters:
playerComponent.getGameMode(playerComponent.getGameMode(
clearRefs
void
clearRefs
()
Method clearRefs.