net.minecraft.world.entity.ai

public class Brain<E extends LivingEntity>

bwk
net.minecraft.world.entity.ai.Brain
net.minecraft.class_4095
net.minecraft.entity.ai.brain.Brain
net.minecraft.world.entity.ai.BehaviorController

Field summary

Modifier and TypeField
static final org.slf4j.Logger
a
LOGGER
field_24656
LOGGER
private final Supplier<com.mojang.serialization.Codec<Brain<E>>>
b
codec
field_24657
codecSupplier
private static final int
c
SCHEDULE_UPDATE_DELAY
field_30096
ACTIVITY_REFRESH_COOLDOWN
private final Map<MemoryModuleType<?>, Optional<? extends ExpirableValue<?>>>
d
memories
field_18322
memories
private final Map<SensorType<? extends Sensor<? super E>>, Sensor<? super E>>
e
sensors
field_18323
sensors
private final Map<Integer, Map<Activity, Set<BehaviorControl<? super E>>>>
f
availableBehaviorsByPriority
field_18324
tasks
private Schedule
g
schedule
field_18325
schedule
private final Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>>
h
activityRequirements
field_18326
requiredActivityMemories
private final Map<Activity, Set<MemoryModuleType<?>>>
i
activityMemoriesToEraseWhenStopped
field_22282
forgettingActivityMemories
private Set<Activity>
j
coreActivities
field_18327
coreActivities
private final Set<Activity>
k
activeActivities
field_18328
possibleActivities
private Activity
l
defaultActivity
field_18329
defaultActivity
private long
m
lastScheduleUpdate
field_18853
activityStartTime

Constructor summary

ModifierConstructor
public (Collection<? extends MemoryModuleType<?>> memories, Collection<? extends SensorType<? extends Sensor<? super E>>> sensors, com.google.common.collect.ImmutableList<Brain$MemoryValue<?>> memoryEntries, Supplier<com.mojang.serialization.Codec<Brain<E>>> codecSupplier)

Method summary

Modifier and TypeMethod
public static <E extends LivingEntity> Brain$Provider<E>
a(Collection<? extends cem<?>> arg0, Collection<? extends cft<? extends cfs<? super E>>> arg1)
provider(Collection<? extends MemoryModuleType<?>> arg0, Collection<? extends SensorType<? extends Sensor<? super E>>> arg1)
method_28311(Collection<? extends class_4140<?>> arg0, Collection<? extends class_4149<? extends class_4148<? super E>>> arg1)
createProfile(Collection<? extends MemoryModuleType<?>> memoryModules, Collection<? extends SensorType<? extends Sensor<? super E>>> sensors)
public static <E extends LivingEntity> com.mojang.serialization.Codec<Brain<E>>
b(Collection<? extends cem<?>> arg0, Collection<? extends cft<? extends cfs<? super E>>> arg1)
codec(Collection<? extends MemoryModuleType<?>> arg0, Collection<? extends SensorType<? extends Sensor<? super E>>> arg1)
method_28313(Collection<? extends class_4140<?>> arg0, Collection<? extends class_4149<? extends class_4148<? super E>>> arg1)
createBrainCodec(Collection<? extends MemoryModuleType<?>> memoryModules, Collection<? extends SensorType<? extends Sensor<? super E>>> sensors)
public <T> com.mojang.serialization.DataResult<T>
a(com.mojang.serialization.DynamicOps<T> arg0)
serializeStart(com.mojang.serialization.DynamicOps<T> arg0)
method_28310(com.mojang.serialization.DynamicOps<T> arg0)
encode(com.mojang.serialization.DynamicOps<T> ops)
Stream<Brain$MemoryValue<?>>
j()
memories()
method_28315()
streamMemories()
public boolean
a(cem<?> arg0)
hasMemoryValue(MemoryModuleType<?> arg0)
method_18896(class_4140<?> arg0)
hasMemoryModule(MemoryModuleType<?> type)
public void
a()
clearMemories()
method_49709()
forgetAll()
public <U> void
b(cem<U> arg0)
eraseMemory(MemoryModuleType<U> arg0)
method_18875(class_4140<U> arg0)
forget(MemoryModuleType<U> type)
public <U> void
a(cem<U> arg0, U arg1)
setMemory(MemoryModuleType<U> arg0, U arg1)
method_18878(class_4140<U> arg0, U arg1)
remember(MemoryModuleType<U> type, U value)
public <U> void
a(cem<U> arg0, U arg1, long arg2)
setMemoryWithExpiry(MemoryModuleType<U> arg0, U arg1, long arg2)
method_24525(class_4140<U> arg0, U arg1, long arg2)
remember(MemoryModuleType<U> type, U value, long expiry)
public <U> void
a(cem<U> arg0, Optional<? extends U> arg1)
setMemory(MemoryModuleType<U> arg0, Optional<? extends U> arg1)
method_18879(class_4140<U> arg0, Optional<? extends U> arg1)
remember(MemoryModuleType<U> type, Optional<? extends U> value)
<U> void
b(cem<U> arg0, Optional<? extends cel<?>> arg1)
setMemoryInternal(MemoryModuleType<U> arg0, Optional<? extends ExpirableValue<?>> arg1)
method_24535(class_4140<U> arg0, Optional<? extends class_4831<?>> arg1)
setMemory(MemoryModuleType<U> type, Optional<? extends Memory<?>> memory)
public <U> Optional<U>
c(cem<U> arg0)
getMemory(MemoryModuleType<U> arg0)
method_18904(class_4140<U> arg0)
getOptionalRegisteredMemory(MemoryModuleType<U> type)
public <U> Optional<U>
d(cem<U> arg0)
getMemoryInternal(MemoryModuleType<U> arg0)
method_46873(class_4140<U> arg0)
getOptionalMemory(MemoryModuleType<U> type)
public <U> long
e(cem<U> arg0)
getTimeUntilExpiry(MemoryModuleType<U> arg0)
method_36978(class_4140<U> arg0)
getMemoryExpiry(MemoryModuleType<U> type)
public Map<MemoryModuleType<?>, Optional<? extends ExpirableValue<?>>>
b()
getMemories()
method_35058()
getMemories()
public <U> boolean
b(cem<U> arg0, U arg1)
isMemoryValue(MemoryModuleType<U> arg0, U arg1)
method_29519(class_4140<U> arg0, U arg1)
hasMemoryModuleWithValue(MemoryModuleType<U> type, U value)
public boolean
a(cem<?> arg0, cen arg1)
checkMemory(MemoryModuleType<?> arg0, MemoryStatus arg1)
method_18876(class_4140<?> arg0, class_4141 arg1)
isMemoryInState(MemoryModuleType<?> type, MemoryModuleState state)
public Schedule
c()
getSchedule()
method_18894()
getSchedule()
public void
a(cqr arg0)
setSchedule(Schedule arg0)
method_18884(class_4170 arg0)
setSchedule(Schedule schedule)
public void
a(Set<cqp> arg0)
setCoreActivities(Set<Activity> arg0)
method_18890(Set<class_4168> arg0)
setCoreActivities(Set<Activity> coreActivities)
public Set<Activity>
d()
getActiveActivities()
method_35059()
getPossibleActivities()
public List<BehaviorControl<? super E>>
e()
getRunningBehaviors()
method_27074()
getRunningTasks()
public void
f()
useDefaultActivity()
method_24536()
resetPossibleActivities()
public Optional<Activity>
g()
getActiveNonCoreActivity()
method_24538()
getFirstPossibleNonCoreActivity()
public void
a(cqp arg0)
setActiveActivityIfPossible(Activity arg0)
method_24526(class_4168 arg0)
doExclusively(Activity activity)
private void
d(cqp arg0)
setActiveActivity(Activity arg0)
method_18880(class_4168 arg0)
resetPossibleActivities(Activity except)
private void
e(cqp arg0)
eraseMemoriesForOtherActivitesThan(Activity arg0)
method_24537(class_4168 arg0)
forgetIrrelevantMemories(Activity except)
public void
a(long arg0, long arg1)
updateActivityFromSchedule(long arg0, long arg1)
method_18871(long arg0, long arg1)
refreshActivities(long timeOfDay, long time)
public void
a(List<cqp> arg0)
setActiveActivityToFirstValid(List<Activity> arg0)
method_24531(List<class_4168> arg0)
resetPossibleActivities(List<Activity> activities)
public void
b(cqp arg0)
setDefaultActivity(Activity arg0)
method_18897(class_4168 arg0)
setDefaultActivity(Activity activity)
public void
a(cqp arg0, int arg1, com.google.common.collect.ImmutableList<? extends bxc<? super E>> arg2)
addActivity(Activity arg0, int arg1, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> arg2)
method_18882(class_4168 arg0, int arg1, com.google.common.collect.ImmutableList<? extends class_7893<? super E>> arg2)
setTaskList(Activity activity, int begin, com.google.common.collect.ImmutableList<? extends Task<? super E>> list)
public void
a(cqp arg0, int arg1, com.google.common.collect.ImmutableList<? extends bxc<? super E>> arg2, cem<?> arg3)
addActivityAndRemoveMemoryWhenStopped(Activity arg0, int arg1, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> arg2, MemoryModuleType<?> arg3)
method_24527(class_4168 arg0, int arg1, com.google.common.collect.ImmutableList<? extends class_7893<? super E>> arg2, class_4140<?> arg3)
setTaskList(Activity activity, int begin, com.google.common.collect.ImmutableList<? extends Task<? super E>> tasks, MemoryModuleType<?> memoryType)
public void
a(cqp arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends bxc<? super E>>> arg1)
addActivity(Activity arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>> arg1)
method_18881(class_4168 arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends class_7893<? super E>>> arg1)
setTaskList(Activity activity, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends Task<? super E>>> indexedTasks)
public void
a(cqp arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends bxc<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<cem<?>, cen>> arg2)
addActivityWithConditions(Activity arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> arg2)
method_24529(class_4168 arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends class_7893<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<class_4140<?>, class_4141>> arg2)
setTaskList(Activity activity, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends Task<? super E>>> indexedTasks, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryModuleState>> requiredMemories)
public void
a(cqp arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends bxc<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<cem<?>, cen>> arg2, Set<cem<?>> arg3)
addActivityAndRemoveMemoriesWhenStopped(Activity arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> arg2, Set<MemoryModuleType<?>> arg3)
method_24530(class_4168 arg0, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends class_7893<? super E>>> arg1, Set<com.mojang.datafixers.util.Pair<class_4140<?>, class_4141>> arg2, Set<class_4140<?>> arg3)
setTaskList(Activity activity, com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends Task<? super E>>> indexedTasks, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryModuleState>> requiredMemories, Set<MemoryModuleType<?>> forgettingMemories)
public void
h()
removeAllBehaviors()
method_35060()
clear()
public boolean
c(cqp arg0)
isActive(Activity arg0)
method_18906(class_4168 arg0)
hasActivity(Activity activity)
public Brain<E>
i()
copyWithoutBehaviors()
method_18911()
copy()
public void
a(ard arg0, E arg1)
tick(ServerLevel arg0, E arg1)
method_19542(class_3218 arg0, E arg1)
tick(ServerWorld world, E entity)
private void
c(ard arg0, E arg1)
tickSensors(ServerLevel arg0, E arg1)
method_27073(class_3218 arg0, E arg1)
tickSensors(ServerWorld world, E entity)
private void
k()
forgetOutdatedMemories()
method_27075()
tickMemories()
public void
b(ard arg0, E arg1)
stopAll(ServerLevel arg0, E arg1)
method_18900(class_3218 arg0, E arg1)
stopAllTasks(ServerWorld world, E entity)
private void
d(ard arg0, E arg1)
startEachNonRunningBehavior(ServerLevel arg0, E arg1)
method_18891(class_3218 arg0, E arg1)
startTasks(ServerWorld world, E entity)
private void
e(ard arg0, E arg1)
tickEachRunningBehavior(ServerLevel arg0, E arg1)
method_19545(class_3218 arg0, E arg1)
updateTasks(ServerWorld world, E entity)
private boolean
f(cqp arg0)
activityRequirementsAreMet(Activity arg0)
method_18874(class_4168 arg0)
canDoActivity(Activity activity)
private boolean
a(Object arg0)
isEmptyCollection(Object arg0)
method_19948(Object arg0)
isEmptyCollection(Object value)
com.google.common.collect.ImmutableList<? extends com.mojang.datafixers.util.Pair<Integer, ? extends BehaviorControl<? super E>>>
a(int arg0, com.google.common.collect.ImmutableList<? extends bxc<? super E>> arg1)
createPriorityPairs(int arg0, com.google.common.collect.ImmutableList<? extends BehaviorControl<? super E>> arg1)
method_24524(int arg0, com.google.common.collect.ImmutableList<? extends class_7893<? super E>> arg1)
indexTaskList(int begin, com.google.common.collect.ImmutableList<? extends Task<? super E>> tasks)