feat: navigate to CTS area
This commit is contained in:
parent
c290984202
commit
dc4a9764cd
@ -4,6 +4,7 @@ import net.minecraft.core.BlockPos
|
||||
import net.minecraft.world.entity.ai.navigation.GroundPathNavigation
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.pathfinder.Path
|
||||
import quaedam.misc.cts.ConstantTemporalSink
|
||||
import quaedam.projection.swarm.ProjectedPersonEntity
|
||||
import quaedam.projection.swarm.SwarmProjection
|
||||
import quaedam.projector.Projector
|
||||
@ -11,7 +12,10 @@ import quaedam.projector.Projector
|
||||
class ProjectedPersonNavigation(val entity: ProjectedPersonEntity, level: Level) : GroundPathNavigation(entity, level) {
|
||||
|
||||
override fun createPath(set: MutableSet<BlockPos>, i: Int, bl: Boolean, j: Int, f: Float): Path? {
|
||||
if (set.any { Projector.findNearbyProjections(level, it, SwarmProjection.effect.get()).isEmpty() }) {
|
||||
if (set.any {
|
||||
Projector.findNearbyProjections(level, it, SwarmProjection.effect.get())
|
||||
.isEmpty() && !ConstantTemporalSink.checkEffect(level, it)
|
||||
}) {
|
||||
return null
|
||||
}
|
||||
return super.createPath(set, i, bl, j, f)
|
||||
|
Loading…
Reference in New Issue
Block a user