Package net.minecraftforge.common.util
Class BrainBuilder<E extends LivingEntity>
java.lang.Object
net.minecraftforge.common.util.BrainBuilder<E>
This object is used to encapsulate state found inside a
Provided are a variety of getter/setter methods to access and manipulate the encapsulated state.
Methods marked with "INTENDED FOR INTERNAL USE" are only meant to be used inside:
Brain
instance,
to make it easily accessible for modders to manipulate during LivingMakeBrainEvent
.Provided are a variety of getter/setter methods to access and manipulate the encapsulated state.
Methods marked with "INTENDED FOR INTERNAL USE" are only meant to be used inside:
ForgeHooks.onLivingMakeBrain(LivingEntity, Brain, Dynamic)
Brain.createBuilder()
Brain.copyFromBuilder(BrainBuilder)
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<Activity,
Set<MemoryModuleType<?>>> private final Map<Activity,
Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> private Activity
private final Collection<MemoryModuleType<?>>
private Schedule
private final Collection<SensorType<? extends Sensor<? super E>>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addActivityMemoriesToEraseWhenStoppedFrom
(Map<Activity, Set<MemoryModuleType<?>>> addFrom) void
void
addActivityRequirementsFrom
(Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> addFrom) void
addActivityRequirementsTo
(Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> addTo) void
addAvailableBehaviorsByPriorityFrom
(Map<Integer, Map<Activity, Set<BehaviorControl<? super E>>>> addFrom) void
addAvailableBehaviorsByPriorityTo
(Map<Integer, Map<Activity, Set<BehaviorControl<? super E>>>> addTo) void
addBehaviorToActivityByPriority
(Integer priority, Activity activity, BehaviorControl<? super E> behaviorControl) You may use this as a helper method for adding a behavior to an Activity by priority to an entity's brain.void
addMemoriesToEraseWhenActivityStopped
(Activity activity, Collection<MemoryModuleType<?>> memories) You may use this as a helper method for adding a collection of memories to erase when an Activity is stopped to entity's brain.private static void
addMemoriesToEraseWhenActivityStoppedInternal
(Map<Activity, Set<MemoryModuleType<?>>> activityMemoriesToEraseWhenStopped, Activity activity, Collection<MemoryModuleType<?>> memories) void
addRequirementsToActivity
(Activity activity, Collection<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> requirements) You may use this as a helper method for adding memory requirements for an Activity to an entity's brain.private static void
addRequirementsToActivityInternal
(Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> activityRequirements, Activity activity, Collection<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> requirements) Map<Activity,
Set<MemoryModuleType<?>>> Map<Activity,
Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> Collection<SensorType<? extends Sensor<? super E>>>
makeBrain
(com.mojang.serialization.Dynamic<?> dynamic) provider()
void
setActiveActivites
(Set<Activity> value) void
setDefaultActivity
(Activity defaultActivity) void
setSchedule
(Schedule schedule)
-
Field Details
-
memoryTypes
-
sensorTypes
-
availableBehaviorsByPriority
private final Map<Integer,Map<Activity, availableBehaviorsByPrioritySet<BehaviorControl<? super E extends LivingEntity>>>> -
schedule
-
activityRequirements
private final Map<Activity,Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, activityRequirementsMemoryStatus>>> -
activityMemoriesToEraseWhenStopped
-
coreActivities
-
activeActivites
-
defaultActivity
-
-
Constructor Details
-
BrainBuilder
-
-
Method Details
-
provider
-
getMemoryTypes
-
getSensorTypes
-
getAvailableBehaviorsByPriority
-
getSchedule
-
setSchedule
-
getActivityRequirements
public Map<Activity,Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, getActivityRequirements()MemoryStatus>>> -
getActivityMemoriesToEraseWhenStopped
-
getCoreActivities
-
getDefaultActivity
-
setDefaultActivity
-
getActiveActivites
-
setActiveActivites
-
addBehaviorToActivityByPriority
public void addBehaviorToActivityByPriority(Integer priority, Activity activity, BehaviorControl<? super E> behaviorControl) You may use this as a helper method for adding a behavior to an Activity by priority to an entity's brain. -
addRequirementsToActivity
public void addRequirementsToActivity(Activity activity, Collection<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> requirements) You may use this as a helper method for adding memory requirements for an Activity to an entity's brain. -
addMemoriesToEraseWhenActivityStopped
public void addMemoriesToEraseWhenActivityStopped(Activity activity, Collection<MemoryModuleType<?>> memories) You may use this as a helper method for adding a collection of memories to erase when an Activity is stopped to entity's brain. -
addAvailableBehaviorsByPriorityFrom
-
addAvailableBehaviorsByPriorityTo
-
addActivityRequirementsFrom
@Internal public void addActivityRequirementsFrom(Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> addFrom) -
addActivityRequirementsTo
@Internal public void addActivityRequirementsTo(Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> addTo) -
addActivityMemoriesToEraseWhenStoppedFrom
@Internal public void addActivityMemoriesToEraseWhenStoppedFrom(Map<Activity, Set<MemoryModuleType<?>>> addFrom) -
addActivityMemoriesToEraseWhenStoppedTo
@Internal public void addActivityMemoriesToEraseWhenStoppedTo(Map<Activity, Set<MemoryModuleType<?>>> addTo) -
addMemoriesToEraseWhenActivityStoppedInternal
private static void addMemoriesToEraseWhenActivityStoppedInternal(Map<Activity, Set<MemoryModuleType<?>>> activityMemoriesToEraseWhenStopped, Activity activity, Collection<MemoryModuleType<?>> memories) -
addRequirementsToActivityInternal
private static void addRequirementsToActivityInternal(Map<Activity, Set<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>>> activityRequirements, Activity activity, Collection<com.mojang.datafixers.util.Pair<MemoryModuleType<?>, MemoryStatus>> requirements) -
makeBrain
-