public class Brain<E extends LivingEntity> extends java.lang.Object implements IDynamicSerializable
Modifier and Type | Field and Description |
---|---|
private java.util.Set<Activity> |
activities |
private java.util.Set<Activity> |
defaultActivities |
private Activity |
fallbackActivity |
private java.util.Map<java.lang.Integer,java.util.Map<Activity,java.util.Set<Task<? super E>>>> |
field_218232_c |
private long |
lastGameTime |
private java.util.Map<MemoryModuleType<?>,java.util.Optional<?>> |
memories |
private java.util.Map<Activity,java.util.Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,MemoryModuleStatus>>> |
requiredMemoryStates |
private Schedule |
schedule |
private java.util.Map<SensorType<? extends Sensor<? super E>>,Sensor<? super E>> |
sensors |
Constructor and Description |
---|
Brain(java.util.Collection<MemoryModuleType<?>> memoryModules,
java.util.Collection<SensorType<? extends Sensor<? super E>>> sensorTypes,
com.mojang.datafixers.Dynamic<T> dynamicIn) |
Modifier and Type | Method and Description |
---|---|
Brain<E> |
copy() |
<U> java.util.Optional<U> |
getMemory(MemoryModuleType<U> type) |
java.util.stream.Stream<Task<? super E>> |
getRunningTasks()
Deprecated.
|
Schedule |
getSchedule() |
boolean |
hasActivity(Activity activityIn) |
boolean |
hasMemory(MemoryModuleType<?> typeIn) |
boolean |
hasMemory(MemoryModuleType<?> memoryTypeIn,
MemoryModuleStatus memoryStatusIn) |
private boolean |
hasRequiredMemories(Activity activityIn) |
private boolean |
isEmptyCollection(java.lang.Object p_218213_1_) |
void |
registerActivity(Activity activityIn,
com.google.common.collect.ImmutableList<com.mojang.datafixers.util.Pair<java.lang.Integer,? extends Task<? super E>>> p_218208_2_) |
void |
registerActivity(Activity activityIn,
com.google.common.collect.ImmutableList<com.mojang.datafixers.util.Pair<java.lang.Integer,? extends Task<? super E>>> p_218224_2_,
java.util.Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,MemoryModuleStatus>> p_218224_3_) |
<U> void |
removeMemory(MemoryModuleType<U> type) |
<T> T |
serialize(com.mojang.datafixers.types.DynamicOps<T> p_218175_1_) |
void |
setDefaultActivities(java.util.Set<Activity> newActivities) |
void |
setFallbackActivity(Activity newFallbackActivity) |
private <T,U> void |
setMemory(MemoryModuleType<U> typeIn,
com.mojang.datafixers.Dynamic<T> dynamicIn) |
<U> void |
setMemory(MemoryModuleType<U> memoryType,
java.util.Optional<U> p_218226_2_) |
<U> void |
setMemory(MemoryModuleType<U> memoryType,
U p_218205_2_) |
void |
setSchedule(Schedule newSchedule) |
private void |
startTasks(ServerWorld worldIn,
E entityIn) |
void |
stopAllTasks(ServerWorld worldIn,
E owner) |
void |
switchTo(Activity activityIn) |
void |
tick(ServerWorld worldIn,
E entityIn) |
private void |
tickTasks(ServerWorld worldIn,
E entityIn) |
void |
updateActivity(long dayTime,
long gameTime) |
private void |
updateSensors(ServerWorld worldIn,
E entityIn) |
private final java.util.Map<MemoryModuleType<?>,java.util.Optional<?>> memories
private final java.util.Map<SensorType<? extends Sensor<? super E extends LivingEntity>>,Sensor<? super E extends LivingEntity>> sensors
private final java.util.Map<java.lang.Integer,java.util.Map<Activity,java.util.Set<Task<? super E extends LivingEntity>>>> field_218232_c
private Schedule schedule
private final java.util.Map<Activity,java.util.Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,MemoryModuleStatus>>> requiredMemoryStates
private java.util.Set<Activity> defaultActivities
private final java.util.Set<Activity> activities
private Activity fallbackActivity
private long lastGameTime
public Brain(java.util.Collection<MemoryModuleType<?>> memoryModules, java.util.Collection<SensorType<? extends Sensor<? super E>>> sensorTypes, com.mojang.datafixers.Dynamic<T> dynamicIn)
public boolean hasMemory(MemoryModuleType<?> typeIn)
private <T,U> void setMemory(MemoryModuleType<U> typeIn, com.mojang.datafixers.Dynamic<T> dynamicIn)
public <U> void removeMemory(MemoryModuleType<U> type)
public <U> void setMemory(MemoryModuleType<U> memoryType, @Nullable U p_218205_2_)
public <U> void setMemory(MemoryModuleType<U> memoryType, java.util.Optional<U> p_218226_2_)
public <U> java.util.Optional<U> getMemory(MemoryModuleType<U> type)
public boolean hasMemory(MemoryModuleType<?> memoryTypeIn, MemoryModuleStatus memoryStatusIn)
public Schedule getSchedule()
public void setSchedule(Schedule newSchedule)
public void setDefaultActivities(java.util.Set<Activity> newActivities)
@Deprecated public java.util.stream.Stream<Task<? super E>> getRunningTasks()
public void switchTo(Activity activityIn)
public void updateActivity(long dayTime, long gameTime)
public void setFallbackActivity(Activity newFallbackActivity)
public void registerActivity(Activity activityIn, com.google.common.collect.ImmutableList<com.mojang.datafixers.util.Pair<java.lang.Integer,? extends Task<? super E>>> p_218208_2_)
public void registerActivity(Activity activityIn, com.google.common.collect.ImmutableList<com.mojang.datafixers.util.Pair<java.lang.Integer,? extends Task<? super E>>> p_218224_2_, java.util.Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>,MemoryModuleStatus>> p_218224_3_)
public boolean hasActivity(Activity activityIn)
public void tick(ServerWorld worldIn, E entityIn)
public void stopAllTasks(ServerWorld worldIn, E owner)
public <T> T serialize(com.mojang.datafixers.types.DynamicOps<T> p_218175_1_)
serialize
in interface IDynamicSerializable
private void updateSensors(ServerWorld worldIn, E entityIn)
private void startTasks(ServerWorld worldIn, E entityIn)
private void tickTasks(ServerWorld worldIn, E entityIn)
private boolean hasRequiredMemories(Activity activityIn)
private boolean isEmptyCollection(java.lang.Object p_218213_1_)