Skip to content

Commit

Permalink
Merge branch '1.20.2' into 1.20.4
Browse files Browse the repository at this point in the history
* 1.20.2:
  format
  Fixed Glare follow logic when tamed
  • Loading branch information
Faboslav committed Feb 1, 2024
2 parents 8507e74 + 1024bee commit a87b493
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.9

- Fixed Glare follow logic when tamed

## 2.0.8

- Reworked Glare AI to use brain/tasks instead of goals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ private static void addAvoidActivities(Brain<GlareEntity> brain) {
),
ImmutableSet.of(
Pair.of(MemoryModuleType.AVOID_TARGET, MemoryModuleState.VALUE_PRESENT),
Pair.of(FriendsAndFoesMemoryModuleTypes.GLARE_IS_TAMED.get(), MemoryModuleState.VALUE_ABSENT),
Pair.of(FriendsAndFoesMemoryModuleTypes.GLARE_IS_IDLE.get(), MemoryModuleState.VALUE_ABSENT)
)
);
Expand Down Expand Up @@ -172,8 +173,8 @@ public static void updateActivities(GlareEntity glare) {
public static void updateMemories(GlareEntity glare) {
if (
(
glare.isBaby()
|| (glare.isBaby() == false && glare.isTamed() == false)
(glare.isBaby() == false && glare.isTamed() == false)
|| GlareLocateDarkSpotTask.canLocateDarkSpot(glare) == false
)
&& glare.getBrain().isMemoryInState(FriendsAndFoesMemoryModuleTypes.GLARE_DARK_SPOT_LOCATING_COOLDOWN.get(), MemoryModuleState.VALUE_ABSENT)
) {
Expand All @@ -183,6 +184,7 @@ public static void updateMemories(GlareEntity glare) {
if (
glare.isSitting()
|| glare.isLeashed()
|| glare.hasVehicle()
) {
glare.getBrain().remember(FriendsAndFoesMemoryModuleTypes.GLARE_IS_IDLE.get(), true);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected void sense(ServerWorld world, GlareEntity glare) {
LivingTargetCache livingTargetCache = brain.getOptionalMemory(MemoryModuleType.VISIBLE_MOBS).orElse(LivingTargetCache.empty());
LivingEntity firstHostileEntity = livingTargetCache.findFirst(livingEntity -> livingEntity instanceof HostileEntity).orElse(null);

if (firstHostileEntity == null) {
if (firstHostileEntity == null || glare.isTamed()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public static boolean canLocateDarkSpot(GlareEntity glare) {
if (
glare.isLeashed()
|| glare.isSitting()
|| glare.hasVehicle()
|| glare.isTamed() == false
|| glare.isBaby()
|| (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ protected boolean shouldRun(ServerWorld world, GlareEntity glare) {
return FriendsAndFoes.getConfig().enableGlareGriefing != false
&& !glare.isLeashed()
&& !glare.isSitting()
&& !glare.hasVehicle()
&& glare.getEquippedStack(EquipmentSlot.MAINHAND).isEmpty() != false;
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.configureondemand=false
# Mod
mod_name=Friends&Foes
mod_id=friendsandfoes
mod_version=2.0.8
mod_version=2.0.9
mod_author=Faboslav
mod_description=Adds outvoted and forgotten mobs from the mob votes in a believable vanilla plus style.
maven_group=com.faboslav.friendsandfoes
Expand Down

0 comments on commit a87b493

Please sign in to comment.