Add option to disable Warden Sonic Boom (#1713)

This commit is contained in:
Amine KACIMI
2025-10-26 22:09:06 +01:00
committed by GitHub
parent 917675d050
commit ffe2f809fe
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
--- a/net/minecraft/world/entity/monster/warden/WardenAi.java
+++ b/net/minecraft/world/entity/monster/warden/WardenAi.java
@@ -175,15 +_,16 @@
brain.addActivityAndRemoveMemoryWhenStopped(
Activity.FIGHT,
10,
- ImmutableList.of(
+ ImmutableList.copyOf(java.util.stream.Stream.<BehaviorControl<? super Warden>>of( // Purpur - configurable warden sonic boom
DIG_COOLDOWN_SETTER,
StopAttackingIfTargetInvalid.<Warden>create(
(level, entity) -> !warden.getAngerLevel().isAngry() || !warden.canTargetEntity(entity), WardenAi::onTargetInvalid, false
),
SetEntityLookTarget.create(entity -> isTarget(warden, entity), (float)warden.getAttributeValue(Attributes.FOLLOW_RANGE)),
SetWalkTargetFromAttackTargetIfTargetOutOfReach.create(1.2F),
- new SonicBoom(),
+ warden.level().purpurConfig.wardenCanUseSonicBoom ? new SonicBoom() : null, // Purpur - configurable warden sonic boom
MeleeAttack.create(18)
+ ).filter(java.util.Objects::nonNull).toList() // Purpur - configurable warden sonic boom
),
MemoryModuleType.ATTACK_TARGET
);